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 wrote: > > Hi, > > I encountered unexpected behavi

Re: Clojure articles and blogs

2009-01-28 Thread Nick Vogel
Personally I search for clojure on google blogsearch and then subscribe to that feed to see whenever someone posts something about clojure. On Wed, Jan 28, 2009 at 12:38 PM, Mark Volkmann wrote: > > Are there web pages that provide links to articles and blogs about Clojure? > It would be nice if

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 Time. 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 McGranag

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 wrote: > > Hi, > > Why into does not work for second argument of list? > > user=> (into [] (1 2 3)) > java.lang.ClassCastException: java.lang.Inte

Re: By Example - another Clojure introduction wiki page

2009-01-13 Thread Nick Vogel
uot;getting started", then "wiki" . . .and then . . >>> . hm no link so search what? . .. I dunno, go back to this thread . . >>> .read read . . .ah yes, here it is, "By Example". So I can search on By >>> Example, or I can find this thre

Re: By Example - another Clojure introduction wiki page

2009-01-13 Thread Nick Vogel
It is, that article is part of the wiki linked to directly from clojure.org. On Tue, Jan 13, 2009 at 11:12 PM, e wrote: > i know that will be awesome for me. I just wish clojure.org was the only > place I had to go to get stuff like that. Why not wikify it all there? > > > On Tue, Jan 13, 2009

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 wrote: > > On Jan 13, 2:59 pm, Chouser wrote: > > > > It raises a qu

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" wrote: > Ok, first of all, here's how I translated that python code: > > (defn msort [myList] >   (if (> (count myLi

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 b

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. Basically,