On Wed, Jun 24, 2009 at 6:42 AM, Rich Hickey wrote:
>
> On Tue, Jun 23, 2009 at 8:02 PM, Stephen C. Gilardi
> wrote:
> >
> > On Jun 23, 2009, at 6:22 PM, pupsik wrote:
> >
> >> The following recursive function does not
> >> terminate if I exexute it in my REPL.
> >> What is wrong?
> >> (This exam
On Tue, Jun 23, 2009 at 8:02 PM, Stephen C. Gilardi wrote:
>
> On Jun 23, 2009, at 6:22 PM, pupsik wrote:
>
>> The following recursive function does not
>> terminate if I exexute it in my REPL.
>> What is wrong?
>> (This example is from the official Clojure-website).
>>
>> (defn my-zipmap [keys va
On Jun 23, 2009, at 6:22 PM, pupsik wrote:
The following recursive function does not
terminate if I exexute it in my REPL.
What is wrong?
(This example is from the official Clojure-website).
(defn my-zipmap [keys vals]
(loop [my-map {}
my-keys (seq keys)
my-vals (seq vals)]
On Tue, Jun 23, 2009 at 5:22 PM, pupsik wrote:
> (defn my-zipmap [keys vals]
> (loop [my-map {}
> my-keys (seq keys)
> my-vals (seq vals)]
>(if (and my-keys my-vals)
> (recur (assoc my-map (first my-keys) (first my-vals))
> (rest my-keys)
> (rest
When I execute the following
code snippet in the REPL I get an infinite loop.
(The example is from the official Clojure-website, topic
'Functional Programming')
What is wrong?
(defn my-zipmap [keys vals]
(loop [my-map {}
my-keys (seq keys)
my-vals (seq vals)]
(if (and my-
The following recursive function does not
terminate if I exexute it in my REPL.
What is wrong?
(This example is from the official Clojure-website).
(defn my-zipmap [keys vals]
(loop [my-map {}
my-keys (seq keys)
my-vals (seq vals)]
(if (and my-keys my-vals)
(recur (a