[nem-en] Re: Macro proposal

Kamil Dworakowski kamil.dworakowski at googlemail.com
Thu Jun 21 13:02:44 CEST 2007


Elifant pisze:
> 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.
I think by is ok. Second meaning of by as a preposition according to 
http://www.thefreedictionary.com/dict.asp?Word=by is

With the use or help of; through: We came by the back road.

In my opinion 'with' is better, though. It is hard to say if there will 
be some feature for which 'with' is more appropriate, therefore we 
should not worry now and use 'with'.

-- Kamil Dworakowski



More information about the devel-en mailing list