diff options
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/) |