Re: strint and macro expansion

2011-03-17 Thread Chas Emerick
On Mar 17, 2011, at 2:04 PM, Alan wrote: > On Mar 17, 11:00 am, Meikel Brandmeyer wrote: >> Hi, >> >> Am 17.03.2011 um 18:11 schrieb Alan: >> >>> From my uninformed position, strint looks like it should have been >>> written as a function, not a macro, but probably there are reasons it >>> was

Re: strint and macro expansion

2011-03-17 Thread Alan
On Mar 17, 11:00 am, Meikel Brandmeyer wrote: > Hi, > > Am 17.03.2011 um 18:11 schrieb Alan: > > > From my uninformed position, strint looks like it should have been > > written as a function, not a macro, but probably there are reasons it > > was not. > > It can't be „simply“ a function, because

Re: strint and macro expansion

2011-03-17 Thread Meikel Brandmeyer
Hi, Am 17.03.2011 um 18:11 schrieb Alan: > From my uninformed position, strint looks like it should have been > written as a function, not a macro, but probably there are reasons it > was not. It can't be „simply“ a function, because then it has no access to the local environment. (let [x 99]

RE: strint and macro expansion

2011-03-17 Thread Bhinderwala, Shoeb
need tuning and optimization. Can clojureql help with this? -Original Message- From: clojure@googlegroups.com [mailto:clojure@googlegroups.com] On Behalf Of Alan Sent: Thursday, March 17, 2011 1:12 PM To: Clojure Subject: Re: strint and macro expansion On Mar 17, 8:34 am, "Bhinderw

Re: strint and macro expansion

2011-03-17 Thread Alan
On Mar 17, 8:34 am, "Bhinderwala, Shoeb" wrote: ...use the strint *MACRO*... ...works when I specify my string [as a literal]... ...but doesn't work when I pass the string through a variable. Macros are not functions. << is receiving as arguments a list with the two elements 'str and 'q. It must

strint and macro expansion

2011-03-17 Thread Bhinderwala, Shoeb
I have the following definitions and am trying to use the strint macro (<<) to perform string substitutions. test1=>(use 'clojure.contrib.strint) test1=> (def m {:XYZ 1, :ABC 2}) test1=> (def q "select ~(:XYZ m) from ~(:ABC m)") The following works when I specify my string directly: test1=> (<<