C++ vs Lisp

Robert Fraser fraserofthenight at gmail.com
Mon May 19 16:09:05 PDT 2008


Simen Kjaeraas wrote:
> On Mon, 19 May 2008 17:01:28 +0200, Bill Baxter 
> <dnewsgroup at billbaxter.com> wrote:
> 
>> Simen Kjaeraas wrote:
>>> bearophile Wrote:
>>>
>>>> Simen Kjaeraas:
>>>>> In D, you can* use list.sort.reverse.process or  
>>>>> list.sort().reverse().process(), if you like parentheses.
>>>> You must use parentheses there :-)
>>>  Not according to my programs. Well, for process, maybe. I just 
>>> tested with sort and reverse, which works without parentheses.
>>
>> And if list is a built-in array, you must *not* use parentheses on 
>> sort and reverse.
>>
>> --bb
> 
> And if the moon is in senit, and it's cloudy and tuesday?

Indeed, it's indeed a bit confusing. Sort and reverse are built-in array 
properties (so cannot have parentheses), while user or library-defined 
array functions can be called as members only with trailing parentheses.

In my onion, sort and reverse should not be built-ins, since libraries 
(other than the runtime) can devise better algorithms for these things.



More information about the Digitalmars-d mailing list