DMD 0.161 release
Derek Parnell
derek at nomail.afraid.org
Tue Jun 20 19:41:47 PDT 2006
On Tue, 20 Jun 2006 21:12:22 -0400, Jarrett Billingsley wrote:
> But hey, check it out:
>
> void foo(void delegate() dg)
> {
> writefln("before");
> dg();
> }
>
> foo =
> {
> writefln("inside!");
> };
>
> A bit of property abuse..
LOL ... Here is an extended test ...
import std.stdio;
void foo(void delegate() dg)
{
writefln("before");
dg();
writefln("after\n");
}
void main(char[][] arg)
{
char[] str;
void bar()
{
writefln(arg[0] ~ ":" ~ str);
}
foo =
{
writefln("inside!");
};
foo =
{
writefln("again!");
};
foo( {writefln("last time");} );
str = "not really";
foo(&bar);
str = "RUBBISH";
foo = &bar;
}
--
Derek
(skype: derek.j.parnell)
Melbourne, Australia
"Down with mediocrity!"
21/06/2006 12:40:50 PM
More information about the Digitalmars-d-announce
mailing list