[nem-en] Re: Macro proposal

Elifant elifantu at mail.ru
Thu Jun 21 10:10:30 CEST 2007


Kamil Dworakowski пишет:

> Kamil Skalski pisze:
>> That is right, we will not have Ruby blocks this way, but I like their
>> syntactic form. Maybe we could use 'do' keyword-operator for your
>> macro?
>>
>> def sum = function_with_callback(1, 2) do (l, r) =>
>>       l + r
>>

As a Rubyist, the first thing I wanted to use was 'do', but it is 
already used for 'do-while' loop. :)

> Could we use with instead of do?
> 
> List.Map(lst) with (x) =>
>    some
>    code
> 
> feels better.

'with' in Delphi and VB is used to bring object properties to current 
scope. In Python it is used like 'using' macro in Nemerle. Very
popular keyword.
I think, 'with' keyword must be reserved for future more appropriate 
use... But I like how code with 'with' sounds: "map list with this 
function".

How about:

lst.Map() by (x)
     x + 1

lst.Filter() by (x)
     x == 2

Isn't these sound: "filter by this function"? :) I may be wrong, since I 
   am not a native english speaker.




More information about the devel-en mailing list