with-out-str assumes Unix line ends

2009-08-07 Thread Nathan Kitchen
Anne's recent attempt to start a new thread for this question seems not to have worked. I'd hate for her and ataggart to be frustrated by further back-and-forth over the identity of the thread he started, so I'm starting a new thread for her question. === begin content from Anne === Sorry for

Re: Is this unquote dangerous?

2009-07-08 Thread Nathan Kitchen
On Jul 7, 5:02 am, Mike cki...@gmail.com 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

Re: A syntax feature request: splitting literal strings

2009-04-06 Thread Nathan Kitchen
On Apr 4, 4:16 pm, Stuart Sierra the.stuart.sie...@gmail.com wrote: This can be macro-ized: (defmacro bigstr [ strings] Concatenates strings at compile time. (apply str strings)) user (macroexpand-1 '(bigstr This is a really long string that I just felt

Re: how can i do this in clojure

2009-02-19 Thread Nathan Kitchen
On Feb 19, 2:39 pm, Phil Hagelberg p...@hagelb.org wrote: linh nguyenlinh.m...@gmail.com writes: # ruby code def foo(x, y) x + y end def bar [1, 2] end foo(*bar) # this is fine, the result will be 3 foo(bar) # this is not ok, will raise exception bar returns an array

Re: map-method

2009-02-05 Thread Nathan Kitchen
Or anonymous function literals? user= (map #(.length %) [mary had a little lamb]) (4 3 1 6 4) user= (map #(.indexOf % (int \a)) [mary had a little lamb]) (1 1 0 -1 1) On Feb 5, 5:05 pm, Jeffrey Straszheim straszheimjeff...@gmail.com wrote: Would memfn not work for you?

Re: A nil puzzle

2009-01-24 Thread Nathan Kitchen
On Jan 24, 7:31 am, e evier...@gmail.com wrote: Then again, I already chimed in.  a list isn't a set.  You said so in the introduction.  Maybe set's need there own print representation, like . uh oh, starting to look like C++ Like this?: user= (hash-set 1 2 3) #{1 2 3} On Sat, Jan

Re: Binding values in a list of symbols and evaluating as code

2009-01-23 Thread Nathan Kitchen
On Jan 23, 1:47 pm, Zak Wilson zak.wil...@gmail.com wrote: And it's now working perfectly, producing a new generation every second. Now I actually have to tweak it to produce good results. It's great that this is working for you. I tried the same approach in a genetic programming project of

Re: how to know which version of clojure?

2009-01-19 Thread Nathan Kitchen
On Jan 18, 11:48 am, wubbie sunj...@gmail.com wrote: Hi, Just tried a piece of code from here... (defn my-deref [x]   (if (or (isa? clojure.lang.Ref (class x))           (isa? clojure.lang.Agent (class x))           (isa? clojure.lang.Atom (class x)))     @x     x))

Re: Eval with local bindings

2009-01-17 Thread Nathan Kitchen
On Sat, Jan 17, 2009 at 11:06 AM, Greg Harman ghar...@gmail.com wrote: Meta: This thread is a revival and continuation of last month's discussion at: http://groups.google.com/group/clojure/browse_thread/thread/e1226810b6ac7bfc/8e0f53c141c26fcc?lnk=gstq=eval+binding#8e0f53c141c26fcc ---

Re: yet another Clojure snake

2009-01-07 Thread Nathan Kitchen
On Jan 7, 7:01 am, Mark Volkmann r.mark.volkm...@gmail.com wrote: On Wed, Jan 7, 2009 at 3:13 AM, Tom Ayerst tom.aye...@gmail.com wrote: Hi Mark, I'm afraid I don't like the big let style and I found it hard to follow some of your code, that may just be a personal thing but a lot of the