Short: Efun this_function()
From: "Wolf Dieter Dallinger" <wolf.dieter@dallinger.de>
Date: Sun, 31 Mar 2002 13:57:53 +0200
Type: Feature
State: New
This is a multi-part message in MIME format.
------=_NextPart_000_0005_01C1D8BC.0D668B80
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
Hi, Lars!
Ich will einen Call-Out starten, der etwas macht und dann erneut =
gestartet wird. Das geht mit einer Lfun problemlos:
void fun()
{
add_count(-1);
call_out("fun", 3600);
}
call_out("fun", 3600);
Schoen waere es, wenn man das auch mit einer Inline-Closure machen =
koennte. Dazu braeuchte man aber wohl eine Funktion this_function(), die =
eine Closure auf die entsprechende Lfun liefert:
call_out((:
add_count(-1);
call_out(this_function(), 3600);
:), 3600);
Allgemein:
-------------------------------------------------------------------------=
------
SYNOPSIS
closure this_function()
BESCHREIBUNG
Liefert einen Funktionszeiger (Closure) auf die Lfun oder die
Lambda-Funktion, die gerade abgearbeitet wird.
BEISPIELE
Call-Outs, die sich selber neu starten:
call_out((:
tue_irgendwas();
call_out(this_function(), 60);
:), 60);
call_out(lambda(0, ({
#',,
({ #'tue_irgendwas }),
({ #'call_out, ({ #'this_function }), 60 }),
})));
Einen Funktionszeiger irgendwo eintragen, der sich automatisch =
nach
einmaligem Aufruf wieder austraegt:
add_closure((:
tue_irgendwas();
delete_closure(this_function());
:));
SIEHE AUCH
closures(LPC)
-------------------------------------------------------------------------=
------
Ich wuerde mich ueber ein this_function() freuen.
Schoene Ostern!
Gruss
Pulami@UNItopia
Wolf Dieter Dallinger
Eckartshaldenweg 11 - D-70191 Stuttgart
Tel. (07 11) 25 67 55-0 - Fax (07 11) 25 67 55-5
Email wolf.dieter@dallinger.de
WWW http://www.dallinger.de/wolf.dieter/
------=_NextPart_000_0005_01C1D8BC.0D668B80
Content-Type: text/html;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=3DContent-Type content=3D"text/html; =
charset=3Diso-8859-1">
<META content=3D"MSHTML 6.00.2715.400" name=3DGENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=3D#ffffff>
<DIV><FONT face=3DArial size=3D2>Hi, Lars!</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT> </DIV>
<DIV><FONT face=3DArial size=3D2>Ich will einen Call-Out starten, der =
etwas macht=20
und dann erneut gestartet wird. Das geht mit einer Lfun =
problemlos:</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT> </DIV>
<DIV><FONT face=3DArial size=3D2> void =
fun()</FONT></DIV>
<DIV><FONT face=3DArial size=3D2> {</FONT></DIV>
<DIV><FONT face=3DArial =
size=3D2> =20
add_count(-1);<BR> call_out("fun",=20
3600);<BR></FONT><FONT face=3DArial size=3D2> =
}</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT> </DIV>
<DIV><FONT face=3DArial size=3D2> call_out("fun",=20
3600);</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT> </DIV>
<DIV><FONT face=3DArial size=3D2>Schoen waere es, wenn man das auch mit =
einer=20
Inline-Closure machen koennte. Dazu braeuchte man aber wohl eine =
Funktion=20
this_function(), die eine Closure auf die entsprechende Lfun=20
liefert:</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT> </DIV>
<DIV><FONT face=3DArial size=3D2> =20
call_out((:<BR> =20
add_count(-1);<BR> =20
call_out(this_function(), 3600);<BR> =
:),=20
3600);<BR></FONT></DIV>
<DIV><FONT face=3DArial size=3D2>Allgemein:</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT> </DIV>
<DIV><FONT face=3DArial=20
size=3D2>----------------------------------------------------------------=
---------------</FONT></DIV>
<DIV><FONT face=3DArial=20
size=3D2>SYNOPSIS<BR> closure=20
this_function()</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT> </DIV>
<DIV><FONT face=3DArial=20
size=3D2>BESCHREIBUNG<BR> =
Liefert einen=20
Funktionszeiger (Closure) auf die Lfun oder=20
die<BR> Lambda-Funktion, die =
gerade=20
abgearbeitet wird.</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT> </DIV>
<DIV><FONT face=3DArial=20
size=3D2>BEISPIELE<BR> =
Call-Outs, die=20
sich selber neu starten:</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT> </DIV>
<DIV><FONT face=3DArial=20
size=3D2> &nbs=
p;=20
call_out((:<BR> &nbs=
p; =20
tue_irgendwas();<BR>  =
; =20
call_out(this_function(),=20
60);<BR>  =
; =20
:), 60);</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT> </DIV>
<DIV><FONT face=3DArial=20
size=3D2> &nbs=
p;=20
call_out(lambda(0,=20
({<BR> &=
nbsp; =20
#',,<BR>  =
; =20
({ #'tue_irgendwas=20
}),<BR> =
=20
({ #'call_out, ({ #'this_function }), 60=20
}),<BR> =
=20
})));</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT> </DIV>
<DIV><FONT face=3DArial =
size=3D2> Einen=20
Funktionszeiger irgendwo eintragen, der sich automatisch=20
nach<BR> einmaligem Aufruf =
wieder=20
austraegt:</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT> </DIV>
<DIV><FONT face=3DArial=20
size=3D2> &nbs=
p;=20
add_closure((:<BR> &=
nbsp; =20
tue_irgendwas();<BR>  =
; =20
delete_closure(this_function());<BR> &=
nbsp; =20
:));</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT> </DIV>
<DIV><FONT face=3DArial size=3D2>SIEHE=20
AUCH<BR> =
closures(LPC)<BR></FONT><FONT=20
face=3DArial=20
size=3D2>----------------------------------------------------------------=
---------------</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT><FONT face=3DArial =
size=3D2></FONT> </DIV>
<DIV><FONT face=3DArial size=3D2>Ich wuerde mich ueber ein =
this_function()=20
freuen.</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT> </DIV>
<DIV><FONT face=3DArial size=3D2>Schoene Ostern!</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT> </DIV>
<DIV><FONT face=3DArial size=3D2>Gruss</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT> </DIV>
<DIV><FONT face=3DArial size=3D2><A=20
href=3D"mailto:Pulami@UNItopia">Pulami@UNItopia</A></DIV>
<DIV><BR>Wolf Dieter Dallinger<BR>Eckartshaldenweg 11 - D-70191=20
Stuttgart<BR>Tel. (07 11) 25 67 55-0 - Fax (07 11) 25 67 55-5<BR>Email =
<A=20
href=3D"mailto:wolf.dieter@dallinger.de">wolf.dieter@dallinger.de</A><BR>=
WWW <A=20
href=3D"http://www.dallinger.de/wolf.dieter/">http://www.dallinger.de/wol=
f.dieter/</A></FONT></DIV></BODY></HTML>
------=_NextPart_000_0005_01C1D8BC.0D668B80--