Juliusz Chroboczek <jch@pps.jussieu.fr> wrote:
+---------------
| (defmacro \\ (args &body body)
| (let ((args (if (listp args) args (list args))))
| `#'(lambda ,args ,@body)))
+---------------
I tend to prefer the Scheme-style default for the non-list arg case:
> (defmacro \\ (args &body body)
`(lambda ,(if (listp args) args (list '&rest args)) ,@body))
|\\|
> (mapcar (\\ x (+ (third x) (* 2 (second x))))
'(1 2 3) '(4 5 6) '(7 8 9))
(15 18 21)
>
But that's just me... ;-}
-Rob
-----
Rob Warnock <rpw3@rpw3.org>
627 26th Avenue <URL:http://rpw3.org/>
San Mateo, CA 94403 (650)572-2607