gnu-arch-users
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Gnu-arch-users] Re: Tla spork


From: Miles Bader
Subject: [Gnu-arch-users] Re: Tla spork
Date: Fri, 27 Aug 2004 12:53:43 +0900

Mikhael Goikhman <address@hidden> writes:
> Nope, this would be:
>
>   if (a1 + a2 - a3 > 0) { b1 = b2(b3 + b4) } else { c1 = c2(c3 + c4) }
> versus:
>   (if (> (- (+ a1 a2) a3) 0) (set b1 (b2 (+ b2 b3))) (set c1 (c2 (+ c3 c4))))
>
> And which one is more readable?

They both look about the same to me. In this case where both expressions
are quite short, the use of a keyword `else' doesn't make much
difference; with somewhat longer expressions it might.  Of course with
longer expressions you'd use additional syntactic cues to aid
comprehension anyway, which tends to lessen the advantage of having
keywords.

E.g.

  if (a1 + a2 - a3 > 0)
    b1 = b2(b3 + b4)
  else
    c1 = c2(c3 + c4)

versus:

   (if (> (- (+ a1 a2) a3) 0)
       (set b1 (b2 (+ b2 b3)))
       (set c1 (c2 (+ c3 c4))))

There's little difference in readability.

Of course someone who simply _doesn't know_ about prefix expressions,
but is familiar with traditional mathematical notation, might prefer the
former.  The question is whether the burden of learning something new is
outweighed by the vast potential for abstraction offered by a very
regular syntax -- or not.  I guess it depends on the users...

-miles
-- 
Suburbia: where they tear out the trees and then name streets after them.




reply via email to

[Prev in Thread] Current Thread [Next in Thread]