Super-dee-duper D features

Sean Kelly sean at f4.ca
Tue Feb 13 19:50:00 PST 2007


Walter Bright wrote:
> X Bunny wrote:
>> (defun ack (x y)
>>   (declare (fixnum x y))
>>   (the fixnum
>>     (if (zerop x)
>>     (1+ y)
>>       (if (zerop y)
>>       (ack (1- x) 1)
>>     (ack (1- x) (ack x (1- y)))))))
>>
>> The structure is no less obvious to me then the C. I can see the input 
>> and output types are clearly fixnums. The branches of the ifs are 
>> obvious.
> 
> I see:
>     1- x
> in the Lisp code, and have to mentally translate it to:
>     x - 1
> and not:
>     1 - x
> 
> This just hurts my brain.

I thought Lisp used prefix notation, but the above syntax looks like 
element composition.


Sean



More information about the Digitalmars-d mailing list