[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: LFM + LFSP = LFE?
Grzegorz Chrupała wrote:
>On Thu 12 Jun 2003 18:42, Bruce Lewis wrote:
>
>
>>Grzegorz Chrupała <grzegorz@pithekos.net> writes:
>>
>>
>>>On Thu 12 Jun 2003 03:40, Michael Vanier wrote:
>>>
>>>
>>>>Note that one of the common features of many of these languages is
>>>>that they provide lisp-like power with a friendlier syntax.
>>>>
>>>>
>>>True of Ruby, too. Instead of:
>>>(map (lambda (n) (* n 2)) '(0 1 2 3 4))
>>>You write:
>>>[0,1,2,3,4].map{|n| n*2}
>>>
>>>
>>Great! Now people afraid of "()'" can use "[],.{}|" instead!
>>
>>
>
>First of all let me clarify that *I*, too, happen to prefer Scheme syntax
>to Ruby's. But we are the minority, for some reason.
>
I think Scheme's syntax is handy from a technical point of view, but I
hate reading Scheme code. I can get used to it, but I don't prefer it.
>>Hopefully quick question that will help us Scheme afficianados
>>understand this friendliness better:
>>
>>What's the Ruby equivalent of this?
>>
>>(map * '(1 2 3) '(4 5 6))
>>
>>
>
>No easy way of doing this that I know of (is there in Smalltalk?).
>
Python:
map(mul, [1,2,3], [1,2,3])
Mind you, I think this example shows more about the flexibility of
Scheme's map function (which Python's happens to share) than about syntax.
Bryn