Re: Is this unquote dangerous?

2009-07-08 Thread Nathan Kitchen
On Jul 7, 5:02 am, Mike wrote: > (not sure where my reply to Chouser et al. went, but basically I said > that I was writing a macro and I might be overdoing it.  I was right!) > > Here's what I was trying to accomplish, but in functions, not macros: > > (defn slice >   "Returns a lazy sequence co

Re: Is this unquote dangerous?

2009-07-07 Thread Jonathan Smith
On Jul 6, 6:00 pm, Chouser wrote: > On Mon, Jul 6, 2009 at 4:18 PM, Meikel Brandmeyer wrote: > > Hi, > > > Am 06.07.2009 um 22:00 schrieb Chouser: > > >> Or if you really do need a list: > > >>  (for [x [1 2 3]] (cons 'some-symbol (list x))) > > > o.O > > > *cough*(list 'some-symbol x)*cough* ;

Re: Is this unquote dangerous?

2009-07-07 Thread Mike
(not sure where my reply to Chouser et al. went, but basically I said that I was writing a macro and I might be overdoing it. I was right!) Here's what I was trying to accomplish, but in functions, not macros: (defn slice "Returns a lazy sequence composed of every nth item of coll, starti

Re: Is this unquote dangerous?

2009-07-07 Thread Mike
On Jul 6, 4:00 pm, Chouser wrote: > On Mon, Jul 6, 2009 at 3:47 PM, Sean Devlin wrote: > > > I think your unquote is okay.  ClojureQL does something similar. > > > However, my gut says this should be in a doseq, not a for statement. > > Could be totally wrong, tough. > > I think the OP is trying

Re: Is this unquote dangerous?

2009-07-06 Thread John Harrop
> > Or if you really do need a list: > > (for [x [1 2 3]] (cons 'some-symbol (list x))) > Why not (for [x [1 2 3]] (list 'some-symbol x)) ? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Clojure" group. To post t

Re: Is this unquote dangerous?

2009-07-06 Thread Chouser
On Mon, Jul 6, 2009 at 4:18 PM, Meikel Brandmeyer wrote: > Hi, > > Am 06.07.2009 um 22:00 schrieb Chouser: > >> Or if you really do need a list: >> >>  (for [x [1 2 3]] (cons 'some-symbol (list x))) > > o.O > > *cough*(list 'some-symbol x)*cough* ;) Oh. Right. What he said. --Chouser --~--~--

Re: Is this unquote dangerous?

2009-07-06 Thread Meikel Brandmeyer
Hi, Am 06.07.2009 um 22:00 schrieb Chouser: Or if you really do need a list: (for [x [1 2 3]] (cons 'some-symbol (list x))) o.O *cough*(list 'some-symbol x)*cough* ;) Sincerely Meikel smime.p7s Description: S/MIME cryptographic signature

Re: Is this unquote dangerous?

2009-07-06 Thread Chouser
On Mon, Jul 6, 2009 at 3:47 PM, Sean Devlin wrote: > > I think your unquote is okay.  ClojureQL does something similar. > > However, my gut says this should be in a doseq, not a for statement. > Could be totally wrong, tough. I think the OP is trying to build and return a list, not trying to exec

Re: Is this unquote dangerous?

2009-07-06 Thread Sean Devlin
I think your unquote is okay. ClojureQL does something similar. However, my gut says this should be in a doseq, not a for statement. Could be totally wrong, tough. My $.02 Sean On Jul 6, 2:39 pm, Mike wrote: > Newbie question here.  Probably answered in Stu's book, but I forgot > it at home

Is this unquote dangerous?

2009-07-06 Thread Mike
Newbie question here. Probably answered in Stu's book, but I forgot it at home today. is: (for [x [1 2 3]] `(some-symbol ~x)) dangerous? I mean, assuming that some-symbol is bound and all. At the REPL I get ((user/some-symbol 1) (user/some-symbol 2) (user/some-symbol 3)) which is what I'm