Re: Blow up

2009-03-28 Thread William D. Lipe
Your analysis is correct. Note that adding a doall fixes the problem user= (def tl (reduce #(doall (concat %1 [%2])) [] (range 4000))) #'user/tl user= (last tl) 3999 efficiency notwithstanding. On Mar 28, 8:59 am, jim jim.d...@gmail.com wrote: Hey Rich, I found an interesting way to blow

Re: oo

2009-03-28 Thread David Nolen
On Sat, Mar 28, 2009 at 4:40 PM, mikel mev...@mac.com wrote: So, at minimum, to make a solid port, you need to add a function that can return a sensible type value for any input Enjoying the thread. Out of curiosity for which Clojure values is the return value of the type function undefined?

Possible Solution for Left-Right Precedence and More when using Multimethods? (was re: oo)

2009-03-28 Thread David Nolen
Having thought a little about multiple inheritance when implementing Spinoza I also ran into this problem. However at the time I wasn't hindered by multifn dispatch as much as the fact that parents cannot be ordered (because calling parents on a tag returns a set) as pointed out by Mark. I

Request for improved error reporting

2009-03-28 Thread Glen Stampoultzis
Hi, I've been really enjoying getting to know clojure. It's an awesome language that has got me very interested in learning more. One thing that hasn't left me impressed is the error reporting. I recently got this one that left me scratching my head: java.lang.NullPointerException (splat.clj:0)

Re: Request for improved error reporting

2009-03-28 Thread Glen Stampoultzis
Sorry I just realized I was a bit ambiguous with this. The exception does show the line number (in the second stack trace). But it's gone missing in the top one. 2009/3/29 Glen Stampoultzis gst...@gmail.com Hi, I've been really enjoying getting to know clojure. It's an awesome language that

Re: Request for improved error reporting

2009-03-28 Thread Glen Stampoultzis
It wasn't really this specific problem that I wanted to point out but more to trigger a rethink of how errors are reported back to the user. Here's an example that gives an error somewhat similar to the one I posted: (defn testing [a b] (print a b)) (testing) java.lang.NoSuchMethodError:

Re: new in contrib.test-is: fixtures

2009-03-28 Thread David Nolen
very cool :) On 3/28/09, Stuart Sierra the.stuart.sie...@gmail.com wrote: Hi folks, I finally came up with fixtures for clojure.contrib.test-is. Now you can do before/after setup for each test case. Here's the documentation, let me know what you think. -Stuart Sierra ;; FIXTURES

new in duck-streams: with-out-writer / with-in-reader

2009-03-28 Thread Stuart Sierra
Following a discussion from a few days ago, I've added two new macros to clojure.contrib.duck-streams: (defmacro with-out-writer Opens a writer on f, binds it to *out*, and evalutes body. [f body] `(with-open [stream# (writer ~f)] (binding [*out* stream#] ~...@body)))

new contrib: with-ns macro

2009-03-28 Thread Stuart Sierra
Hi folks, New lib in contrib: with-ns -- a library to temporarily switch namespaces at run-time. People request this occasionally, and I finally came up with a way to do it. The code is sneaky, and it relies on eval, but it works. Here's the doc: clojure.contrib.with-ns/with-ns ([ns body])

Re: Request for improved error reporting

2009-03-28 Thread Glen Stampoultzis
2009/3/29 Stephen C. Gilardi squee...@mac.com On Mar 28, 2009, at 10:31 PM, Glen Stampoultzis wrote: It wasn't really this specific problem that I wanted to point out but more to trigger a rethink of how errors are reported back to the user. I understand, but without specifying which

Re: new in duck-streams: with-out-writer / with-in-reader

2009-03-28 Thread Parth
On Mar 29, 7:36 am, Stuart Sierra the.stuart.sie...@gmail.com wrote: Following a discussion from a few days ago, I've added two new macros to clojure.contrib.duck-streams: (defmacro with-out-writer   Opens a writer on f, binds it to *out*, and evalutes body.   [f body]   `(with-open

Re: oo

2009-03-28 Thread mikel
On Mar 28, 4:28 pm, David Nolen dnolen.li...@gmail.com wrote: On Sat, Mar 28, 2009 at 4:40 PM, mikel mev...@mac.com wrote: So, at minimum, to make a solid port, you need to add a function that can return a sensible type value for any input Enjoying the thread. Out of curiosity for which