A feture adjustment request and a syntax blasphemy

Jarrett Billingsley kb3ctd2 at yahoo.com
Sun Oct 29 05:43:02 PST 2006


"BCS" <BCS at pathlink.com> wrote in message 
news:ehu935$d2p$4 at digitaldaemon.com...

> So why no this?
>
>   void foo(int[] ar){}
>   ...
>   static int[] i = [1,2,3];
>   auto dg = &i.foo;

As David said, this is called partial evaluation, and I believe someone has 
written a template library for D to do just this.. Ah, here it is, Tom S. 
wrote it:

http://158.75.59.9/~h3/code/bind.rar

Maybe that will let you do at least somewhat what you'd like to do :)

> So why no this?
>
>   static int[] i = [1,2,3];
>   i.function void(int[] j){return;}();

How about:

 static int[] i = [1,2,3];
 auto f = function void(int[] j){return;};
 i.f();

? 





More information about the Digitalmars-d-learn mailing list