C++ vs Lisp
Simen Kjaeraas
simen.kjaras at gmail.com
Sun May 18 07:31:58 PDT 2008
On Sat, 17 May 2008 23:45:40 +0200, Nick Sabalausky <a at a.a> wrote:
> "Neal Alexander" <WQEQWEUQY at HOTMAIL.COM> wrote in message
> news:g0nha0$1s9l$1 at digitalmars.com...
>> - Function composition: (process . reverse . sort) list
>> vs
>> process(reverse(sort(list)))
>>
>
> Did you mean:
>
> (sort . reverse . process) list
> vs
> process(reverse(sort(list)))
>
> Or does Haskell put them in order of (last . first)? FWIW, I really like
> the style I've seen in some languages that's basically:
>
> list.sort().reverse().process()
> vs
> process(reverse(sort(list)))
>
> Which, I'm assuming is what you're talking about, but not certain.
In D, you can* use list.sort.reverse.process or
list.sort().reverse().process(), if you like parentheses.
* "If the first parameter to a function is an array, the function can be
called as if it were a property of the array"
(http://www.digitalmars.com/d/2.0/arrays.html)
-- Simen
More information about the Digitalmars-d
mailing list