
Learn Clojure!
@learnclojure
Learn Clojure and ClojureScript through small examples.
คุณอาจชื่นชอบ
(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 bit.ly/HxUBV0 #clojure
#clojure's map takes many colls: (map vector [:a :b] [1 2]) ;=> ([:a 0] [:b 1]). @cgrand takes this to the next level bit.ly/HzVsoJ
#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
@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.
&env and &form, available in macros, are tools for compile-time introspection bit.ly/fPY9FQ (magick spell: bit.ly/FPTZKF)
#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
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.
Run your browser from #Clojure: (doto (java.awt.Desktop/getDesktop) (.browse (java.net.URI/create "http://clojure.org")))
RT @pjstadig: #clojure isn't a pure functional language, and rich likes it that way, so stop drinking the mutable state is bad kool-aid
Recursion is a low-level operation! http://blog.fogus.me/2011/03/09/recursion-is-a-low-level-operation/ #clojure #fp #hof #pointfree
United States เทรนด์
- 1. #JoyForum 1,643 posts
- 2. #2025MAMAVOTE 434K posts
- 3. Good Thursday 21.3K posts
- 4. Brevis ZK 137K posts
- 5. Mila 17.4K posts
- 6. Friday Eve N/A
- 7. Deport Harry Sisson 13.6K posts
- 8. #ThursdayThoughts 1,322 posts
- 9. #thursdaymotivation 1,862 posts
- 10. #thursdayvibes 2,106 posts
- 11. Ninja Gaiden 13K posts
- 12. Tomonobu Itagaki 8,416 posts
- 13. MC FELIX FRIDGE INTERVIEW 15.3K posts
- 14. Deloitte 9,865 posts
- 15. DuPont 2,148 posts
- 16. Dead or Alive 11.4K posts
- 17. BNB Chain 19.8K posts
- 18. Bernie 37.7K posts
- 19. Jennifer Welch 4,392 posts
- 20. Pelosi 149K posts
Something went wrong.
Something went wrong.