True!  But from what I understand of the way symbol-macrolet works, it's
not possible to do one without the other.  symbol-macrolet actually looks
for only symbols in the forms you pass it after the let bindings; it won't
traverse inside any quoted forms.  It also takes care not to override the
symbols that are shadowed by contained let statements, etc.

But I could be wrong - this was just after a quick look to see how it
worked.

Cheers,

H

On 7 December 2015 at 19:14, gianluca torta <giato...@gmail.com> wrote:

> Hi Hunter,
>
> however, in this way you are expanding the application of the macro
> "symbol-macrolet" (which is itself a macro), not just the symbol macro "b":
>
> (pprint (mexpand-1 '(symbol-macrolet [b (+ 1 2)] b ["something" "else"])))
> ;; (do (+ 1 2) ["something" "else"])
> ;; nil
>
> cheers,
> Gianluca
>
>
> On Monday, December 7, 2015 at 5:09:44 PM UTC+1, retnuH wrote:
>>
>> This worked for me (after some experimentation):
>>
>> (pprint (mexpand-1 '(symbol-macrolet [b (+ 1 2)] b)))
>>
>> ;; (do (+ 1 2))
>> ;; nil
>>
>>
>> Cheers,
>>
>> H
>>
>> On Saturday, 5 December 2015 07:45:38 UTC, Ritchie Cai wrote:
>>>
>>> I'm not sure how to print a macroexpand on macros that defined in
>>> macrolet or symbol-macrolet.
>>>
>>> with normal macros, I can do:
>>>
>>> (defmacro test-macro [] '(+ 1 2))
>>> (pprint (macroexpand-1 '(test-macro)))
>>>
>>> ;; (+ 1 2)
>>> ;; nil
>>>
>>> but with macrolet or symbol-macrolet:
>>>
>>> (symbol-macrolet [(b [] '(+ 1 2))]
>>>                                (pprint (mexpand-1 '(b))))
>>>
>>> ;; (b)
>>> ;; nil
>>>
>>> (symbol-macrolet [(b [] '(+ 1 2))]
>>>                                (pprint (mexpand-1 (b))))
>>>
>>> ;; 3
>>> ;; nil
>>>
>>> what am I doing wrong?
>>>
>>> Thanks
>>> Ritchie
>>>
>>> --
> 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
> ---
> You received this message because you are subscribed to a topic in the
> Google Groups "Clojure" group.
> To unsubscribe from this topic, visit
> https://groups.google.com/d/topic/clojure/TbDrw-YuQQc/unsubscribe.
> To unsubscribe from this group and all its topics, send an email to
> clojure+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
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
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to