This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2015-09-09
Channels
- # admin-announcements (23)
- # beginners (7)
- # boot (6)
- # clara (1)
- # cljs-dev (2)
- # clojure (89)
- # clojure-argentina (1)
- # clojure-australia (5)
- # clojure-brasil (4)
- # clojure-denmark (2)
- # clojure-france (1)
- # clojure-italy (1)
- # clojure-japan (9)
- # clojure-nl (13)
- # clojure-russia (1)
- # clojurescript (248)
- # clojurex (3)
- # clojutre (3)
- # core-async (2)
- # datomic (6)
- # devcards (19)
- # devops (1)
- # events (1)
- # funcool (9)
- # hoplon (74)
- # ldnclj (53)
- # melbourne (3)
- # off-topic (25)
- # onyx (36)
- # reagent (8)
Hi, I'm doing 4clojure problem 118, and have this so far:
(fn mm [f coll]
(lazy-seq
(when (not= [] coll)
(cons (f (first coll))
(mm f (rest coll))))))
i understand if you are returning a collection, you need to hold onto the head. I'm not sure why this would be so slow, though.
@escherize: you might want to look at how to do tail calls with clojure. Have a look at loop
& recur
.
@escherize if you change (not= [] coll)
to (not (empty? coll))
it works. I am not sure why this is.