Re: A few suggestions and useful things

2009-06-13 Thread Wrexsoul
On Jun 13, 6:20 pm, Michael Wood wrote: > On Sat, Jun 13, 2009 at 10:11 PM, Jarkko Oranen wrote: > > [...] > > > I think something like this is in clojure-contrib as well. It's a semi- > > official add-on library for Clojure (You need a CA to contribute), so > > you should take a look at it :) >

Re: A few suggestions and useful things

2009-06-13 Thread Michael Wood
On Sat, Jun 13, 2009 at 11:27 PM, Wrexsoul wrote: > > On Jun 13, 4:11 pm, Jarkko Oranen wrote: [...] >> I also personally dislike functions that take a boolean parameter; if >> you must, at least make it optional, with default to false > > The -raw ending is one I use on functions that tend to ha

Re: A few suggestions and useful things

2009-06-13 Thread Michael Wood
On Sat, Jun 13, 2009 at 10:11 PM, Jarkko Oranen wrote: [...] > I think something like this is in clojure-contrib as well. It's a semi- > official add-on library for Clojure (You need a CA to contribute), so > you should take a look at it :) Wrexsoul: Since you don't seem to have stumbled across

Re: A few suggestions and useful things

2009-06-13 Thread Wrexsoul
On Jun 13, 4:11 pm, Jarkko Oranen wrote: > Also, try using (find-doc "foo") and (doc foo) in a repl for > documentation searches. For this function, you might want to check out > if-let. Find-doc seems to give about the same results as searching through the API page, only also cluttering up the

Re: A few suggestions and useful things

2009-06-13 Thread Jarkko Oranen
On Jun 13, 6:38 am, Wrexsoul wrote: > Here's a bit more, public domain as usual: > > (defn get-ultimate-cause [exception] >   (loop [e exception] >     (let [e2 (. e getCause)] >       (if-not e2 >         e >         (recur e2) I think something like this is in clojure-contrib as well. It'

Re: A few suggestions and useful things

2009-06-13 Thread Meikel Brandmeyer
Hi, Am 13.06.2009 um 02:45 schrieb Wrexsoul: I think this exists already somewhere in clojure.contrib.java-utils or so. Don't have that third-party library. Maybe clojure.contrib.duck-streams? Don't have that third-party library. Then you should check it out, no? Let's see. http://

Re: A few suggestions and useful things

2009-06-12 Thread Wrexsoul
Here's a bit more, public domain as usual: (defn get-ultimate-cause [exception] (loop [e exception] (let [e2 (. e getCause)] (if-not e2 e (recur e2) (defmacro with-stack-trace [& body] `(try (eval (quote (do ~...@body))) (catch Throwable ex# (. (get-

Re: A few suggestions and useful things

2009-06-12 Thread Wrexsoul
On Jun 12, 5:58 pm, Meikel Brandmeyer wrote: > > (defn eager-seq >    [s] >    (into [] s)) I guess that'd work. > > (with-files-line-seq (file1 file2 file3) lines > >  (take 10 lines)) > > The more idiomatic form would be [file1 file2 file3] > for the file arguments. Using (file1 file2 file3)

Re: A few suggestions and useful things

2009-06-12 Thread Meikel Brandmeyer
Hi, Am 12.06.2009 um 23:29 schrieb Wrexsoul: (defn eager-seq [seqq] (loop [v [] s seqq] (if (empty? s) v (recur (conj v (first s)) (rest s) (defn eager-seq [s] (into [] s)) (with-files-line-seq (file1 file2 file3) lines (take 10 lines)) The more idiomatic form would

A few suggestions and useful things

2009-06-12 Thread Wrexsoul
Suggestion 1: In the undefined-symbol error message, special-case # by adding a note in the specific cases of clojure.core/unquote and clojure.core/unquote-splicing saying "The most common cause of this is forgetting a backtick in a macro." Var clojure.core/anything is unbound will otherwise ten