diff options
author | Dmitrii Kuznetsov <torgeek@gmail.com> | 2021-02-22 18:42:33 +0300 |
---|---|---|
committer | Dmitrii Kuznetsov <torgeek@gmail.com> | 2021-02-22 18:42:33 +0300 |
commit | e09fefaa3e78c645c720c86391e3f96d257be8a9 (patch) | |
tree | 0ff8b235e3e707125e2b11d5268ad085832355cb /clojure.html.markdown | |
parent | f4c740839d78f797e9cbcfa1eb0483ac0ea45501 (diff) | |
parent | bc8bd2646f068cfb402850f7c0f9b1dbfe81e5a0 (diff) |
Merge branch 'master' of https://github.com/torgeek/learnxinyminutes-docs
Diffstat (limited to 'clojure.html.markdown')
-rw-r--r-- | clojure.html.markdown | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/clojure.html.markdown b/clojure.html.markdown index bfe8d79e..20812a9b 100644 --- a/clojure.html.markdown +++ b/clojure.html.markdown @@ -150,7 +150,7 @@ x ; => 1 ; You can also use this shorthand to create functions: (def hello2 #(str "Hello " %1)) -(hello2 "Fanny") ; => "Hello Fanny" +(hello2 "Julie") ; => "Hello Julie" ; You can have multi-variadic functions, too (defn hello3 @@ -292,14 +292,14 @@ keymap ; => {:a 1, :b 2, :c 3} ; When you are in a situation where you want more freedom as where to ; put the result of previous data transformations in an ; expression, you can use the as-> macro. With it, you can assign a -; specific name to transformations' output ans use it as a +; specific name to transformations' output and use it as a ; placeholder in your chained expressions: (as-> [1 2 3] input (map inc input);=> You can use last transform's output at the last position (nth input 2) ;=> and at the second position, in the same expression - (conj [4 5 6] input [8 9 10])) ;=> or in the middle ! - + (conj [4 5 6] input 8 9 10)) ;=> or in the middle ! + ; Result: [4 5 6 4 8 9 10] ; Modules @@ -416,3 +416,6 @@ Clojuredocs.org has documentation with examples for most core functions: Clojure-doc.org (yes, really) has a number of getting started articles: [http://clojure-doc.org/](http://clojure-doc.org/) + +Clojure for the Brave and True has a great introduction to Clojure and a free online version: +[https://www.braveclojure.com/clojure-for-the-brave-and-true/](https://www.braveclojure.com/clojure-for-the-brave-and-true/) |