Re: force evaluation of macro parameter

2011-02-05 Thread Ken Wesson
On Sun, Feb 6, 2011 at 12:57 AM, Eugen Dück wrote: > I'm talking about '~name on > https://github.com/clojure/clojure-contrib/blob/master/modules/dataflow/src/main/clojure/clojure/contrib/dataflow.clj#L338 > and below. > > I want to be able to generate names, i.e. I don't have them as > literals.

Re: force evaluation of macro parameter

2011-02-05 Thread Eugen Dück
I'm talking about '~name on https://github.com/clojure/clojure-contrib/blob/master/modules/dataflow/src/main/clojure/clojure/contrib/dataflow.clj#L338 and below. I want to be able to generate names, i.e. I don't have them as literals. On Feb 5, 2:29 pm, Ken Wesson wrote: > On Sat, Feb 5, 2011 at

Re: force evaluation of macro parameter

2011-02-04 Thread Ken Wesson
On Sat, Feb 5, 2011 at 12:08 AM, Eugen Dück wrote: > yes, the code is more complex and it is in contrib. Changing contrib > requires you to send an intercontinental mail first, as mentioned in > my other post today... :) Reason enough to first checkout the other > options and dig deeper into macro

Re: force evaluation of macro parameter

2011-02-04 Thread Eugen Dück
On Feb 5, 1:52 pm, Eric Lavigne wrote: > This makes me think that the original macro needs some refactoring. > There should be a function that handles most of the work, and a macro > to make your code shorter in the common case. > > (defn unquoted-param [x] (println x)) > > (defmacro quoted-param

Re: force evaluation of macro parameter

2011-02-04 Thread Eric Lavigne
>> Which is of course what the quote is supposed to do. But is there any >> way to get that macro to expand to using the value of asdf, rather >> than the symbol itself? Or can only changing the macro fix this? I >> fear the latter, which would imply that using quotes like that in a >> macro should

Re: force evaluation of macro parameter

2011-02-04 Thread Ken Wesson
On Fri, Feb 4, 2011 at 11:24 PM, Eugen Dück wrote: > I'm using a macro that, stripped down to just expose my problem, looks > like this: > > (defmacro quoted-param >  [x] >  `(println '~x)) > > It's all nice if I call it like > > (quoted-param 23) > > It will print the number 23. The following, ho

force evaluation of macro parameter

2011-02-04 Thread Eugen Dück
I'm using a macro that, stripped down to just expose my problem, looks like this: (defmacro quoted-param [x] `(println '~x)) It's all nice if I call it like (quoted-param 23) It will print the number 23. The following, however, will print "asdf", rather than 23: (def asdf 23) (quoted-param