Re: Relative merits of Lisp-1 vs. Lisp-2?



JesusWaffle@xxxxxxxxx writes:

How about using a simple read-macro for this? Something along the lines
of:

(defun square-brace-reader (stream char)
(declare (ignore char))
`(funcall ,@(read-delimited-list #\] stream t)))

(set-macro-character #\[ #'square-brace-reader)

That will expand [foo bar] to (funcall foo bar), or [[(f x) y] z] to
(funcall (funcall (f x) y) z).

Hoan Ton-That has written a with-lisp1 macro which allows stuff like
this:

(with-lisp1
(let ((a +))
(a 2 3))) ==> 5

(with-lisp1
(let ((a (lambda (x)
(lambda (y)
(+ x y)))))
((a 2) 3))) ==> 5

see
http://groups.google.com/group/comp.lang.lisp/browse_thread/thread/82994055009163e9
and the a recent version of arnesi
(http://common-lisp.net/project/bese/repos/arnesi_dev/) for the code.

--
-Marco
Ring the bells that still can ring.
Forget the perfect offering.
There is a crack in everything.
That's how the light gets in.
-Leonard Cohen
.