Does this clarify the point I was making?
When writing macros, you cannot dynamically build one of the syntactic
sugar forms. For example, you cannot write a macro that expands cls
and member into (cls/member):
(defmacro call-static [cls member] `(~cls/~member))
-
Thanks Mark, Chouser,
I will update that section of the book with a corrected example in
Beta 7.
Cheers,
Stuart
On Tue, Feb 3, 2009 at 11:26 AM, Mark Volkmann
r.mark.volkm...@gmail.com wrote:
Now I remember what I was thinking about. This isn't so much a
difference between macros and
Marde, Feb 3, 2009 at 14:24, Konrad Hinsen konrad.hin...@laposte.net skribis:
[...]
I can't think of anything that would be forbidden in a macro but
allowed in a plain function. There are many things that don't make
sense in a macro, of course: launching agents, opening windows, ...
Well, for
Personally I find that the clearest way to think about macros, is to
treat them like a *very* advanced search-and-replace feature.
Just keep in mind that macros expand into code, and check to make sure
that your generated code is indeed valid code.
I just wanted to point out that ' is syntactic sugar for (quote) not (list).
(list) will evaluate your arguments, where as '() will not. So if you try to
use them interchangeable you'll run into trouble.
user (list 1 2 (+ 1 2))
(1 2 3)
user '(1 2 (+ 1 2))
(1 2 (+ 1 2))
Its a pretty common lisp
On Feb 3, 2009, at 14:49, Mark Volkmann wrote:
I see from the feedback so far that my statements are wrong. However,
I think it's true that there are *some* things you can do in a
function that you cannot do in a macro, and perhaps vice-versa. Are
those clearly documented anywhere? If not,
On Feb 4, 12:01 am, Mark Volkmann r.mark.volkm...@gmail.com wrote:
Are the following statements true? They aren't discussed
athttp://clojure.org/macros, but I think they are true.
Macros cannot call other macros during their evaluation, but they can
expand to code that calls macros.
I
Are the following statements true? They aren't discussed at
http://clojure.org/macros, but I think they are true.
Macros cannot call other macros during their evaluation, but they can
expand to code that calls macros.
Macros cannot use syntactic sugar such as '(items) to create a list
and
On Tue, Feb 3, 2009 at 8:24 AM, Konrad Hinsen konrad.hin...@laposte.net wrote:
On Feb 3, 2009, at 14:49, Mark Volkmann wrote:
I see from the feedback so far that my statements are wrong. However,
I think it's true that there are *some* things you can do in a
function that you cannot do in a
On Tue, Feb 3, 2009 at 11:26 AM, Mark Volkmann
r.mark.volkm...@gmail.com wrote:
Now I remember what I was thinking about. This isn't so much a
difference between macros and functions as it is a rule about
something you cannot do in a macro. Quoting from Programming Clojure
...
You cannot
Hi!
Am 03.02.2009 um 17:26 schrieb Mark Volkmann:
On Tue, Feb 3, 2009 at 8:24 AM, Konrad Hinsen konrad.hin...@laposte.net
wrote:
On Feb 3, 2009, at 14:49, Mark Volkmann wrote:
I see from the feedback so far that my statements are wrong.
However,
I think it's true that there are
Mark Volkmann wrote:
I see from the feedback so far that my statements are wrong. However,
I think it's true that there are *some* things you can do in a
function that you cannot do in a macro, and perhaps vice-versa. Are
those clearly documented anywhere? If not, what are some?
You might
On Feb 3, 2009, at 14:01, Mark Volkmann wrote:
Are the following statements true? They aren't discussed at
http://clojure.org/macros, but I think they are true.
Macros cannot call other macros during their evaluation, but they can
expand to code that calls macros.
Macros can certainly
13 matches
Mail list logo