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

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

## Re: [Gnu-arch-users] Re: Tla spork

 From: John Meinel Subject: Re: [Gnu-arch-users] Re: Tla spork Date: Fri, 27 Aug 2004 11:02:47 -0500 User-agent: Mozilla Thunderbird 0.7 (Windows/20040616)

```-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Robin Farine wrote:

|
| If we want two equivalent expressions, one written in a
| non-ambiguous prefix notation and the other written in an infix
| notation without any implicit rule of precedence, we would write
| something like:
|
|   (+ a b (- c (/ (* d e f) (* g (+ n 1)))))
|
| versus
|
|   a + b + (c - ((d * e * f) / (g * (n + 1))))
|
| I tend to prefer the first version. If now we add rules of
| precedence to the infix notation, then I definitely prefer the
| first version.
|
| Robin
|
|
That makes the assumption that the * or + or whatever supports an
arbitrary number of arguments. I will admit, that helps the first
version a lot, I was writing it under the assumption that + was a binary
operator.

I still think having the operator *next to* the thing it is operating
on, rather than having to parse a lot of parenthesis is easier. But I
will say that if you have a list of things and the + operator becomes
the sum operator instead, you can clean up some things.

I'm not sure what you are saying about not prefering rules of
precedence. Perhaps just because it isn't as explicit.

I will also say, though, Andrew Suffields alternative Fibbonacci
sequence using Haskell looks rather clean.

I'm not sure how the syntax works out when you start having less trivial
alternatives (multiple lines for each "else")

Also, Haskell seems just a little too loose about when does the sequence
end.

John
=:->

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.4 (Cygwin)
Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org

iD8DBQFBL1snJdeBCYSNAAMRAldNAJ9QS9oCksOgBWneo/LnkZIlo8/+OACfaIvS
/zk/FUrgKNroqQcO3p0QDiI=
=Rd2H
-----END PGP SIGNATURE-----

```

reply via email to

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