Custom Blocks

Lutger lutger.blijdestijn at gmail.com
Tue Aug 10 04:31:12 PDT 2010


Andrei Alexandrescu wrote:

> Chris Williams wrote:
>> I'm not sure whether the design of D 2.0 has stabilized as yet, but if not,
>> I would like to suggest the ability to create custom block types.
> [snip]
> 
> FWIW we've been talking a long time ago about a simple lowering - if the
> last argument to a function is a delegate, allow moving the delegate's
> body outside of the function:
> 
> fun(a, b, c) { body }
> 
>   |
>   V
> 
> fun((a, b, c) { body });
> 
> As far as Walter and I could tell, there are no syntactical issues
> created by such a lowering. But we've been wrong about that in the past
> (me 10x more often than him).
> 
> 
> Andrei

Nevertheless, it would be fantastic!   

This is exactly what can enables Ruby code to be so pleasant, though it is not 
the same construct. And extensions methods of course :) 


More information about the Digitalmars-d mailing list