
Learn Clojure and ClojureScript through small examples.
Earth
Joined March 2010
- Tweets199
- Following1
- Followers1.3K
- Likes0
Learn Clojure! retweeted
(for [[n v] (ns-publics 'clojure.core) :let [since (:added (meta v))] :when (= since "1.4")] n) ;; vars since 1.4 in core / cc @learnclojure
proxy is for interop, and it can extend Java classes and even invoke parent constructor with proxy-super http://t.co/nSls1ngR #clojure
2
#clojure maps are functions of their keys, and can also take a not-found value like the get function does: ({:x 1} :y 2) ;=> 2
Learn Clojure! retweeted
Replying to @learnclojure
@learnclojure On top of it being an obtuse and inefficient way to solve the problem, it doesn't work for the common case of same guesses.
keep, a handy combination of map and filter gist.github.com/1631183 #clojure
&env and &form, available in macros, are tools for compile-time introspection http://t.co/LjZAmY8e (magick spell: http://t.co/oDdm611k)
#clojure 1.4 introduces mapv and filterv for working with vectors - handy when IO resources are involved and laziness gets in the way
play a c-major scale, using #clojure and java midi, from your REPL! gist.github.com/350253. see also: vimeo.com/22798433
in #clojurescript, anything can be made invocable because IFn is a protocol gist.github.com/2346460
When defining namespace-local thingies, prefer ^:private over defn- (for example) #clojure
2
Formatting a number as a string with commas in the right place: gist.github.com/1761143 #clojure (via @unclebob and @holy_chao)
Be careful! The (loop) form in #Clojure will happily work without a recur. It'll silently do whatever its body says once.

