diff --git a/resources/public/javascript/tryclojure.js b/resources/public/javascript/tryclojure.js index 4e04303..1516618 100644 --- a/resources/public/javascript/tryclojure.js +++ b/resources/public/javascript/tryclojure.js @@ -31,6 +31,9 @@ var pages = [ { verify: function (data) { return data.expr == "(map inc [1 2 3 4])"; } }, + { + verify: function (data) { return data.expr == "(:zar h \"not found\")"; } + }, { verify: function (data) { return false; } } diff --git a/resources/public/tutorial/page11.html b/resources/public/tutorial/page11.html index da67d0a..9cfe5cf 100644 --- a/resources/public/tutorial/page11.html +++ b/resources/public/tutorial/page11.html @@ -1,8 +1,19 @@ -

Excellent work.

-

- Well, that's all there is right now. This tutorial is still a work in progress, and I'm working on more - steps. If anybody wants to contribute, you can find a link to the Github repository on the 'about' page. - Furthermore, if you're just a brand new Clojure developer looking for some learning experiences, check - out the 'links' page. You'll find links to some tutorials and such there. + Let's define a hash-map as we seen earlier:
+ (def h {:foo "buu" :bar "bazz"}) +

+

+ Now try some of this magic:
+ (:bar h "not found") +

+

+ This is actually a convenient version of (get h :bar "not found") and it + says: +

+

+ "Give me the value associated with the key :bar if it exists in the map, + or else the string "not found"". +

+

+ Try (:zar h "not found") to continue.

diff --git a/resources/public/tutorial/page12.html b/resources/public/tutorial/page12.html new file mode 100644 index 0000000..da67d0a --- /dev/null +++ b/resources/public/tutorial/page12.html @@ -0,0 +1,8 @@ +

Excellent work.

+ +

+ Well, that's all there is right now. This tutorial is still a work in progress, and I'm working on more + steps. If anybody wants to contribute, you can find a link to the Github repository on the 'about' page. + Furthermore, if you're just a brand new Clojure developer looking for some learning experiences, check + out the 'links' page. You'll find links to some tutorials and such there. +