Super-dee-duper D features
Sean Kelly
sean at f4.ca
Wed Feb 14 09:20:41 PST 2007
cracki wrote:
> Sean Kelly wrote:
>> Walter Bright wrote:
>>> 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
>
>
> nah. reading s-expressions needs some getting used to. you're reading
> serialized tree structure there after all.
>
> the "1-" is the name of a function. instead of writing
>
> (1- x)
>
> you could of couse define a function "subtract-one" that does the same
> and then write
>
> (subtract-one x)
>
> but that's not much more readable. you can of course write
>
> (- x 1)
>
> and any lisp compiler optimizes it.
Oh okay. For some reason I was still thinking in terms of C symbol
names. I'm going to have to remember that position is really all that
matters in Lisp :-)
Sean
More information about the Digitalmars-d
mailing list