Re: Different behaviour when using (def ^:macro ...) outside top-level

2013-09-13 Thread André Gustavo Rigon
Yeah, it's the difference in behaviour that I don't understand.

Thanks for the workaround though Gunnar.

On Friday, September 13, 2013 2:35:37 AM UTC-3, Cedric Greevey wrote:
>
> On Fri, Sep 13, 2013 at 1:08 AM, Gunnar Völkel 
> 
> > wrote:
>
>> `def` does not handle `:macro true` metadata on the provided symbol.
>>
>  
> Umm ... according to the OP, it worked perfectly when the def was a 
> top-level form, just not when it was nested in an if. If your claim were 
> correct the OP would have had no joy with either my-defn1 *or* my-defn2, 
> rather than only the latter not working.
>
>

-- 
-- 
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/groups/opt_out.


Re: Different behaviour when using (def ^:macro ...) outside top-level

2013-09-12 Thread Cedric Greevey
On Fri, Sep 13, 2013 at 1:08 AM, Gunnar Völkel <
gunnar.voel...@googlemail.com> wrote:

> `def` does not handle `:macro true` metadata on the provided symbol.
>

Umm ... according to the OP, it worked perfectly when the def was a
top-level form, just not when it was nested in an if. If your claim were
correct the OP would have had no joy with either my-defn1 *or* my-defn2,
rather than only the latter not working.

-- 
-- 
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/groups/opt_out.


Re: Different behaviour when using (def ^:macro ...) outside top-level

2013-09-12 Thread Gunnar Völkel
`def` does not handle `:macro true` metadata on the provided symbol. But 
you can work around that like clojure.core does, e.g. for the macro 
`defmacro` after the `(def ... defmacro ...)` call the following is called: 
`(. (var defmacro) (setMacro))`

-- 
-- 
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/groups/opt_out.