Hi, all

It seems Lisp macro expander will not evalute the argument prefixed by
unquote. The following code, written in Common Lisp, is an excerpt
from `On Lisp'. This macro implemented `let'.

1. (defmacro our-let (binds &body body)
2.   ‘((lambda ,(mapcar #’(lambda (x)
3.                          (if (consp x) (car x) x))
4.                      binds)
5.             ,@body)
6.     ,@(mapcar #’(lambda (x)
7.                   (if (consp x) (cadr x) nil))
8.               binds)))

`body' on the 5th line is not evaluted when the macro got expanded,
but the `mapcar' on the 2nd line is evaluated.

I think the problem/characteristic would be the same no matter which
Lisp dialect you use. I've tried to debug into the Clojure Compiler,
but the key code was generated on the fly. So I failed to figure it
out how Clojure did it. And I'm not a Common Lisp geek either, can't
go deep into the interrepter. So, would someone please tell me if the
arguments are really treated specially?

Or, am I just wrong at all these?

Helps will be appreciated.

-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en

Reply via email to