Re: Relative merits of Lisp-1 vs. Lisp-2?
- From: Marcus Breiing <usenet@xxxxxxxxxxxxxxxxxxxxxxxx>
- Date: 31 May 2006 12:19:34 +0200
JesusWaffle@xxxxxxxxx writes:
How about using a simple read-macro ... that will expand [foo bar]
to (funcall foo bar), or [[(f x) y] z] to (funcall (funcall (f x) y)
z)
I switched to this syntax a while ago. It cured me of any and all
residual Lisp-1 envy. (If anything, such code tends to be even *more*
readable than equivalent Lisp-1 would be.) Strongly recommended.
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?
If you find yourself using the same parameter names in most or all of
your "small" lambdas, a possible alternative to reader syntax is name
capture. For example, with:
(defmacro /xy (&rest form)
`(lambda (x y) (declare (ignorable x y)) ,form))
your example condenses down to (/xy f y x)
--
Marcus Breiing
.
- References:
- Relative merits of Lisp-1 vs. Lisp-2?
- From: JesusWaffle
- Re: Relative merits of Lisp-1 vs. Lisp-2?
- From: Pascal Costanza
- Re: Relative merits of Lisp-1 vs. Lisp-2?
- From: JesusWaffle
- Relative merits of Lisp-1 vs. Lisp-2?
- Prev by Date: Re: s-expression data language
- Next by Date: BLOAT-EST -- future proof encoding
- 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):