Skip to content

Commit 3c78754

Browse files
author
EXPORTS-bot
committed
Updated exports
1 parent 7d9ee28 commit 3c78754

File tree

3 files changed

+4
-3
lines changed

3 files changed

+4
-3
lines changed

exports/export.compact.edn

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24313,7 +24313,8 @@
2431324313
";; Nested 'for' example to produce indexes of Two-dimensional array\n(for [i (range 3)]\n (for [j (range 3)]\n [i j]))\n\n;=> (([0 0] [0 1] [0 2]) \n; ([1 0] [1 1] [1 2]) \n; ([2 0] [2 1] [2 2]))"
2431424314
";; Generate the hiccup for a collection of books, each book has unique details defined in each hash-map inside the collection.\n;; Destructure the keys in the hash-map for each book in turn\n\n(def practicalli-book-list\n [{:title \"Practicalli Spacemacs\"\n :url \"https://practical.li/spacemacs\"\n :image \"/practicalli-spacemacs-book-banner.png\"\n :description \"Coding Clojure with Emacs and Vim multi-modal editing\"}\n {:title \"Practicalli Clojure\"\n :url \"https://practical.li/clojure\"\n :image \"/practicalli-clojure-book-banner.png\"\n :description \"Learn the Clojure language through REPL driven development\"}])\n\n(defn books-list\n [books]\n (for [{:keys [title description url image]} books]\n [:div {:class \"column\"}\n [:a {:href url :target \"_blank\"}\n [:img {:src image}]]\n [:p [:a {:href url :target \"_blank\" }\n title]\n description]]))\n\n(book-list practicalli-book-list)\n;; => [:div {:class \"box\"} [:div {:class \"column\"} [:h2 {:class \"title has-text-centered\"} \"Freely available online books\"]] nil ([:div {:class \"column\"} [:div {:class \"columns\"} [:div {:class \"column\"} [:a {:href \"https://practical.li/spacemacs\", :target \"_blank\"} [:figure {:class \"image\"} [:img {:src \"/practicalli-spacemacs-book-banner.png\"}]]]] [:div {:class \"column\"} [:p [:a {:href \"https://practical.li/spacemacs\", :target \"_blank\", :class \"has-text-weight-bold\"} \"Practicalli Spacemacs\"] \"Emacs and Vim multi-modal editing\"]]]] [:div {:class \"column\"} [:div {:class \"columns\"} [:div {:class \"column\"} [:a {:href \"https://practical.li/clojure\", :target \"_blank\"} [:figure {:class \"image\"} [:img {:src \"/practicalli-clojure-book-banner.png\"}]]]] [:div {:class \"column\"} [:p [:a {:href \"https://practical.li/clojure\", :target \"_blank\", :class \"has-text-weight-bold\"} \"Practicalli Clojure\"] \"Learn the Clojure language through REPL driven development\"]]]])]\n"
2431524315
";; Easy iteration through nested vectors\n\n(def matrix \n [[\"a\" \"b\"] [\"c\" \"d\"]])\n\n(for [row matrix letter row] \n letter)\n\n;; (\"a\" \"b\" \"c\" \"d\")"
24316-
";; to map across a hashmap\n(for [[k v] {:a 1 :b 10 :c 100}]\n (list k v))\n\n;; -> ((:a 1) (:b 10) (:c 100))\n"],
24316+
";; to map across a hashmap\n(for [[k v] {:a 1 :b 10 :c 100}]\n (list k v))\n\n;; -> ((:a 1) (:b 10) (:c 100))\n"
24317+
";; all right triangles with integer sides from 1 to 11\n(for [a (range 1 11)\n b (range 1 a)\n c (range 1 b)\n :when (= (* a a) (+ (* b b) (* c c)))]\n [a b c])"],
2431724318
:macro true,
2431824319
:notes
2431924320
["My English parser was choking on the description of this function.\r\n\r\n[This SO question](http://stackoverflow.com/questions/3322552/how-do-i-multiply-all-elements-in-one-collection-with-all-the-elements-in-another) has helped clarify how this function works."

exports/export.compact.min.edn

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.

exports/export.edn

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.

0 commit comments

Comments
 (0)