Re: Relative merits of Lisp-1 vs. Lisp-2?
- From: JesusWaffle@xxxxxxxxx
- Date: 30 May 2006 16:18:09 -0700
I mostly agree with your assessment. But note that a functional
programming style is somewhat more convenient with a Lisp-1. It's easier
to express things like (((f x) y) z) whereas in a Lisp-2 you would have
to say (funcall (funcall (f x) y) z). So if you have a strong preference
for functional programming (or would like to explore it more deeply) you
might want to try out a Lisp-1 (i.e., Scheme).
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).
On one project which involved a lot of functional programming, I used a
macro like this. The version I used was slightly fancier, in that it
would also expand [f x y . z] to (apply f x y z), and I had an
additional reader macro that would expand {x y : (f y x)} to #'(lambda
(x y) (f y x)). What do you think?
A standard reference is
http://www.nhplace.com/kent/Papers/Technical-Issues.html
Thanks! This is good stuff.
.
- Follow-Ups:
- Re: Relative merits of Lisp-1 vs. Lisp-2?
- From: Marcus Breiing
- Re: Relative merits of Lisp-1 vs. Lisp-2?
- From: Pascal Costanza
- Re: Relative merits of Lisp-1 vs. Lisp-2?
- From: Marco Baringer
- Re: Relative merits of Lisp-1 vs. Lisp-2?
- References:
- Relative merits of Lisp-1 vs. Lisp-2?
- From: JesusWaffle
- Re: Relative merits of Lisp-1 vs. Lisp-2?
- From: Pascal Costanza
- Relative merits of Lisp-1 vs. Lisp-2?
- Prev by Date: Re: Easy migration of SBCL/SLIME from Linux to OS X Intel?
- Next by Date: Re: Just can't hear enough about Cells?
- Previous by thread: Re: Relative merits of Lisp-1 vs. Lisp-2?
- Next by thread: Re: Relative merits of Lisp-1 vs. Lisp-2?
- Index(es):
Relevant Pages
|