A little thing about function templates / Ruby

mike vertex at gmx.at
Mon Feb 12 12:36:16 PST 2007


> Actually, this is possible ;)
> This is an undocumented feature, being able to call functions which take
> arrays as their first argument as if they were member functions.

Great news! This makes some things possible.

> You can already do delegate return type inference:
>
> [1, 2, 3].each((int x) { writefln(x); });

Now that's the 3rd feature I wasn't aware of ... and I thought I had some  
experience with D already :)

' channelStrip.activeDevices((Device e) { e.processAudio(inBuffer,  
outBuffer); });

That's quite a nice one-liner. I'm planning to rewrite a lot of code, and  
this is exactly what I was hoping I could do in D 2.0. Now I find out it  
is possible in D 1.0! :)

Thanks a lot!

-Mike
-- 
Erstellt mit Operas revolutionärem E-Mail-Modul: http://www.opera.com/mail/



More information about the Digitalmars-d mailing list