diff options
author | Zachary Ferguson <zfergus2@users.noreply.github.com> | 2015-10-07 23:53:53 -0400 |
---|---|---|
committer | Zachary Ferguson <zfergus2@users.noreply.github.com> | 2015-10-07 23:53:53 -0400 |
commit | 342488f6a8de5ab91f555a6463f5d9dc85a3079a (patch) | |
tree | 1afa96957269a218ef2a84d9c9a2d4ab462e8fef /clojure.html.markdown | |
parent | 4e4072f2528bdbc69cbcee72951e4c3c7644a745 (diff) | |
parent | abd7444f9e5343f597b561a69297122142881fc8 (diff) |
Merge remote-tracking branch 'adambard/master' into adambard/master-cn
Diffstat (limited to 'clojure.html.markdown')
-rw-r--r-- | clojure.html.markdown | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/clojure.html.markdown b/clojure.html.markdown index 6baae0ce..a125d18f 100644 --- a/clojure.html.markdown +++ b/clojure.html.markdown @@ -22,7 +22,7 @@ and often automatically. ; Clojure is written in "forms", which are just ; lists of things inside parentheses, separated by whitespace. ; -; The clojure reader assumes that the first thing is a +; The clojure reader assumes that the first thing is a ; function or macro to call, and the rest are arguments. ; The first call in a file should be ns, to set the namespace @@ -63,7 +63,7 @@ and often automatically. ; If you want to create a literal list of data, use ' to stop it from ; being evaluated '(+ 1 2) ; => (+ 1 2) -; (shorthand for (quote (+ 1 2)) +; (shorthand for (quote (+ 1 2))) ; You can eval a quoted list (eval '(+ 1 2)) ; => 3 @@ -205,7 +205,7 @@ keymap ; => {:a 1, :c 3, :b 2} ;("a" stringmap) ; => Exception: java.lang.String cannot be cast to clojure.lang.IFn -; Retrieving a non-present value returns nil +; Retrieving a non-present key returns nil (stringmap "d") ; => nil ; Use assoc to add new keys to hash-maps @@ -341,7 +341,7 @@ keymap ; => {:a 1, :b 2, :c 3} (swap! my-atom assoc :a 1) ; Sets my-atom to the result of (assoc {} :a 1) (swap! my-atom assoc :b 2) ; Sets my-atom to the result of (assoc {:a 1} :b 2) - ; Use '@' to dereference the atom and get the value +; Use '@' to dereference the atom and get the value my-atom ;=> Atom<#...> (Returns the Atom object) @my-atom ; => {:a 1 :b 2} @@ -365,7 +365,7 @@ my-atom ;=> Atom<#...> (Returns the Atom object) ### Further Reading -This is far from exhaustive, but hopefully it's enought o get you on your feet. +This is far from exhaustive, but hopefully it's enough to get you on your feet. Clojure.org has lots of articles: [http://clojure.org/](http://clojure.org/) @@ -376,5 +376,5 @@ Clojuredocs.org has documentation with examples for most core functions: 4Clojure is a great way to build your clojure/FP skills: [http://www.4clojure.com/](http://www.4clojure.com/) -Clojure-doc.org (yeah, really) has a number of getting started articles: +Clojure-doc.org (yes, really) has a number of getting started articles: [http://clojure-doc.org/](http://clojure-doc.org/) |