Re: Using method names in macros

2009-03-28 Thread Rich Hickey
On Mar 28, 1:59 pm, "ke...@ksvanhorn.com" wrote: > I'm in the process of learning Clojure, and I ran across something > that other newbies like me may find useful. The question I had was > this: how does one get a method name into a macro? Consider the > following code: > > (defmacro foo [x

Re: Using method names in macros

2009-03-28 Thread William D. Lipe
Another way to handle it would be to use the alternate syntax for static methods: (defmacro foo [x] `(Character/isWhitespace ~x)) which would expand properly. Using the dot form for instance methods, i.e. (.method obj) should also keep syntax quote from expanding it improperly. On Mar 28, 12:5

Re: Using method names in macros

2009-03-28 Thread David Nolen
Your solution is the accepted one ;) On Sat, Mar 28, 2009 at 1:59 PM, ke...@ksvanhorn.com wrote: > > I'm in the process of learning Clojure, and I ran across something > that other newbies like me may find useful. The question I had was > this: how does one get a method name into a macro? Cons

Using method names in macros

2009-03-28 Thread ke...@ksvanhorn.com
I'm in the process of learning Clojure, and I ran across something that other newbies like me may find useful. The question I had was this: how does one get a method name into a macro? Consider the following code: (defmacro foo [x] `(. Character (isWhitespace ~x))) Yes, I know that this woul