Super-dee-duper D features
X Bunny
xbunny at eidosnet.co.uk
Tue Feb 13 18:01:43 PST 2007
X Bunny wrote:
> Kevin Bealer wrote:
>> X Bunny wrote:
>>> Kevin Bealer wrote:
>>>>
>>>> 2. The syntax doesn't provide visual hints that let you read a program.
>> What I mean, is this (from the Computer Language Shootout):
>>
>> (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)))))))
>>
> My editor indents the Lisp like this:
>
> (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)))))))
>
hmm that looks exactly the same in my news reader that means (a) my
formatting is screwed up by the newsreader or server somewhere and (b)
the original was probably indented correctly also before it was posted
or when I read it. Therefore I guess you wouldnt agree that correct
indenting made it as easily readable as the C, oh well then. It should
have the true expression of the if offset four characters from the
logical expression and the else expression two characters.
More information about the Digitalmars-d
mailing list