[Top][All Lists]

[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 10:02:40 -0500
User-agent: Mozilla Thunderbird 0.7 (Windows/20040616)

Hash: SHA1

Excellent presentation by the way. Thanks for writing it up.

Another small item of note is chaining. One of the reasons I think
mathematicians use the notation they do, is so you can do

a + b + c, not (+ a (+ b c))

One of the biggest problems with the lisp syntax is that if I want to
add a new term without changing priority I have to add a character at
both the beginning and end of the statement (+ ..... d), and mentally it
separates the operation from the thing it is operating on. For instance

(+ (+ a b) (- (c (/ (*d (* e f)) (* g (+ n 1)))
a + b + c - (d * e * f) / (g * (n + 1))

I think the second one is much more readable, because when you have an
operator, the things it operates on are right next to it (on the left
and right).

Now, this probably matters less for functions because once you have more
than 2 arguments, you can't put them next to each other, and I don't
know of any languages that do:

a function b instead of function(a,b)

So for non mathematical programming, with lots of function calls,
probably lisp vs C/C++ doesn't matter.

But for heavy math, lisp looks pretty bad. (to me.)

I would also *like* to have more than just parenthesis for separation.
So that you can do:

(define (fib n)
~  (if (or (= n 0) (= n 1))
~     1
~     (+ (fib (- n 1))
~        (fib (- n 2)))))


{define (fib n)
~  [if (or (= n 0) (= n 1))
~     1
~     {+ (fib (- n 1))
~        (fib (- n 2))}]}

I do think the first version *looks* prettier. But it's hard for me to
count the final number of parenthesis, and I certainly have no idea
which one goes with what, without doing a lot of parenthesis counting.


Tobias C. Rittweiler wrote:
| I'll teach you in 10 minutes! (the syntax, that's it)
| Let's start with a procedural language like C, but for sake of
| simplicity let's remove types alltogether in our mental model (their
| (non-)existence will not matter in any way other than possible
| distraction for our so strong concentration we need in order to
| grok that mystical Lisp syntax!)
| So we have a language of canonical syntax with infix operatos, lots of
| keywords and all that stuff. Let's write a small fibonacci program in
| it, and let's afterwards morph that incrimentally into the corresponding
| fibonnaci program in lisp syntax.
Version: GnuPG v1.2.4 (Cygwin)
Comment: Using GnuPG with Thunderbird -


reply via email to

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