On Oct 6, 2008, at 5:16 AM, ssecorp wrote:
> (defn splitall [str delim]
> (loop [s str acc nil]
> (if (= s nil)
> (reverse acc)
> (let [parts (split s delim)]
> (recur (rest parts) (cons (first parts) acc))))))
As a debugging tool, I recommend inserting:
(prn s acc)
right after the line that contains "loop".
The book at <http://htdp.org> describes a systematic way to design
loops like this.
--Steve
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Clojure" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
-~----------~----~----~----~------~----~------~--~---