From d5c73f5ee4a5b769c691b56adf80bb1c3c10f5ee Mon Sep 17 00:00:00 2001 From: Andrey Listopadov Date: Mon, 31 Oct 2022 14:24:33 +0300 Subject: update loop doc --- doc/core.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'doc/core.md') diff --git a/doc/core.md b/doc/core.md index 74bd2c3..014be20 100644 --- a/doc/core.md +++ b/doc/core.md @@ -1474,13 +1474,13 @@ Returns a new coll consisting of `to` with all of the items of Thransofmr a hash-map into a sequence of key-value pairs: -```fennel +``` fennel (assert-eq [[:a 1]] (into (vector) {:a 1})) ``` Construct a hash-map from a sequence of key-value pairs: -```fennel +``` fennel (assert-eq {:a 1 :b 2 :c 3} (into (hash-map) [[:a 1] [:b 2] [:c 3]])) ``` @@ -1548,7 +1548,7 @@ iterator style with the `doseq` macro. Bear in mind, that since the sequence is lazy it should be realized or truncated before the file is closed: -```fennel +``` fennel (let [lines (with-open [f (io.open "init.fnl" :r)] (line-seq f))] ;; this will error because only first line was realized, but the @@ -1622,7 +1622,7 @@ no collection is provided. ### Examples -```fennel +``` fennel (map #(+ $ 1) [1 2 3]) ;; => @seq(2 3 4) (map #(+ $1 $2) [1 2 3] [4 5 6]) ;; => @seq(5 7 9) (def :private res (map #(+ $ 1) [:a :b :c])) ;; will raise an error only when realized -- cgit v1.2.3