Re: Unexpected behavior of 'if' with Boolean objects

2009-05-03 Thread Nick Vogel
In Java, you're supposed to use Boolean.valueOf whenever converting a string to a Boolean. The constructors are useless unless you for some reason need separate identities for Boolean objects. On Sun, May 3, 2009 at 11:56 AM, Janico Greifenberg j...@jgre.org wrote: Hi, I encountered

Re: Any way we can get this in clojure-contrib?

2009-01-22 Thread Nick Vogel
That sounds interesting; you might take a look at Joda Timehttp://joda-time.sourceforge.net/. Although I've never used it myself, from what I've heard it's the Java library that people actually use for dates/times (I do know that Google uses it). Doing a quick search, it looks like Mark

Re: why (into [] [1 2 3]) works, but not (into [] (1 2 3))?

2009-01-18 Thread Nick Vogel
You need to do (into [] '(1 2 3)) otherwise it will be read as calling the function 1 with arguments 2 and 3. On Sun, Jan 18, 2009 at 3:56 PM, wubbie sunj...@gmail.com wrote: Hi, Why into does not work for second argument of list? user= (into [] (1 2 3)) java.lang.ClassCastException:

Re: Utilities for clojure.contrib?

2009-01-13 Thread Nick Vogel
seq returns nil when a collection has no items. According to the documentation for empty?, empty? is the same as (not (seq coll)) so you should use seq for expressing the opposite of empty? On Tue, Jan 13, 2009 at 3:12 AM, GS gsincl...@gmail.com wrote: On Jan 13, 2:59 pm, Chouser

Re: By Example - another Clojure introduction wiki page

2009-01-13 Thread Nick Vogel
it. Consider this feedback and opinion. You are getting a data point on how one person thinks (or fails to think). On Tue, Jan 13, 2009 at 11:42 PM, Nick Vogel voge...@gmail.com wrote: It is, that article is part of the wiki linked to directly from clojure.org. On Tue, Jan 13, 2009 at 11

Re: non recursive impl in presence of persistence?

2009-01-10 Thread Nick Vogel
Ok, first of all, here's how I translated that python code: (defn msort [myList] (if ( (count myList) 1) (let [l1 (first myList) l2 (second myList)] (recur (concat (drop 2 myList) (my-merge l1 l2 (first myList))) The main thing that might need explaining is the recur, which

Re: non recursive impl in presence of persistence?

2009-01-10 Thread Nick Vogel
By the way just to clarify, the use of recur is iterative, it's just written in clojure in its recursive form. On Jan 11, 1:32 am, Nick Vogel voge...@gmail.com wrote: Ok, first of all, here's how I translated that python code: (defn msort [myList]   (if ( (count myList) 1)     (let [l1

Re: REPL prints a ISeq as a list

2009-01-09 Thread Nick Vogel
I guess I'm having trouble understanding what you're getting it, the way I'm interpreting it is that you want to have seqs represented differently from lists when outputted at the REPL. Also, I'm not sure if this is a point of confusion, but lazy sequences are different from sequence.