Subject: Re: A tiny lisp without numbers: The Computional Beauty of Nature
From: rpw3@rigden.engr.sgi.com (Rob Warnock)
Date: 2000/08/03
Newsgroups: comp.lang.lisp
Message-ID: <8mbhn6$cbhab$1@fido.engr.sgi.com>
Lieven Marchand  <mal@bewoner.dma.be> wrote:
+---------------
| But then you're not teaching lisp. You're teaching <advanced subject>
| using lisp as a tool, as Chaitin does in one of his recent books on
| Algorithmic Information Theory.
+---------------

Yeah, but I just wish he hadn't mucked up the basic syntax. His "Lisp"
<URL:http://www.cs.umaine.edu/~chaitin/unknowable/ch2.html> is really
not what a casual reader would recognize as such, and he has somehow
picked up some other odd ideas as well, e.g.:

	"Programmers usually write M-expressions, and then the LISP
	interpreter converts them into S-expressions before processing
	them. M-expressions omit some of the parentheses, the ones that
	group the primitive built-in functions together with their
	arguments. M-expression notation works because all built-in
	primitive functions in my LISP have a fixed-number of operands
	or arguments."

So having said that, he chooses to write in his reduced-parentheses
"M-expression" notation (which doesn't look much like the M-expressions
in the Lisp 1.5 manual). So instead of:

	(define (fact N) (if (= N 0) 1 (* N (fact (- N 1))))) 

he writes:

	define (fact N) if = N 0 1 * N (fact - N 1) 

	"This can be interpreted unambiguously if you know that ``define''
	always has two operands, and ``if'' always has three."

Yes, it *can*, but the result is hard for a Lisp programmer to read.
The follow excerpts have the in-line embedded comments stripped out
(because they're mostly noise like "[then]" and "[else]"!!), which,
to be fair, makes the code even less readable, so I've added a little
indenting:

	define (member? e set)
	  if atom set
	    false
	    if = e car set
	      true
	      (member? e cdr set)

	define (subset? set1 set2)
	  if atom set1
	    true
	    if (member? car set1 set2)
	      (subset? cdr set1 set2)
	      false 

O.k., so those aren't so bad, but what about the last line of this one?

	define (union x y)
	  if atom x
	    y
	    if (member? car x y)
	      (union cdr x y)
	      cons car x (union cdr x y)

Isn't the correct parse instantly obvious...?   :-{

I think it's highly unfortunate that he ever (mis)heard about
"M-expressions". His "Lisp" would have been just as useful for
expressing his mathematics if it used S-expressions, and would
be a hell of a lot more readable. As it is, we have yet *another*
weird thing calling itself "Lisp" that students will get exposed to
and come away thinking, "Well, if *that's* Lisp, I don't want any!"
(*sigh*)


-Rob

-----
Rob Warnock, 41L-955		rpw3@sgi.com
Applied Networking		http://reality.sgi.com/rpw3/
Silicon Graphics, Inc.		Phone: 650-933-1673
1600 Amphitheatre Pkwy.		PP-ASEL-IA
Mountain View, CA  94043