Lambda syntax, etc

Robert Fraser fraserofthenight at gmail.com
Thu Feb 5 20:12:45 PST 2009


BCS wrote:
> Reply to Yigal,
> 
>> Personally I prefer to have syntax for "blocks" like Ruby/smalltalk.
>> given the following example function:
>> int func(int a, delegate int(int) dg) { .. }
>> // call func with [something in this spirit is my favorite]:
>> func(someInt) { | int a, int b | return a+b; };
>>
> 
> how about require that the block arg in the called function name the args
> 
>> int func(int a, delegate int(int val, int thing) dg) { .. }
> 
> and then pull in those names implicitly
> 
>> func(someInt) { return val+thing; };
> 
> This would have implication in overloading and what not but it would be 
> syntactically clean.

Ew, no. Aside from the technical issues, this distances the names from 
the use thereof (i.e. they'd likely be in separate files)



More information about the Digitalmars-d mailing list