(default-map-key key grammar nsp)emits a default map key
emits a default map key
(emit-coll key form grammar mopts)(emit-coll key form grammar mopts emit-fn)emits a collection
emits a collection
(emit-coll-layout key indent str-array grammar mopts)constructs the collection
constructs the collection
(emit-data key form grammar mopts)main function for data forms
main function for data forms
(emit-data-standard key form grammar mopts)emits either a custom string or default coll
emits either a custom string or default coll
(emit-map-entry [k v] grammar mopts)emits the map entry
emits the map entry
(emit-maybe-multibody [prefix-yes prefix-no] body & [indent])checks that array is all single lines
(emit-maybe-multibody ["1" "2"] "hello") => "2hello"
(emit-maybe-multibody ["1" "2"] "\nhello") => "1 \n hello"
checks that array is all single lines (emit-maybe-multibody ["1" "2"] "hello") => "2hello" (emit-maybe-multibody ["1" "2"] "\nhello") => "1 \n hello"
(emit-quote key props [sym & args :as form] grammar mopts)emit quote structures
(emit-quote nil nil ''(1 2 3) +grammar+ {}) => "(1,2,3)"
emit quote structures
(emit-quote nil nil ''(1 2 3) +grammar+ {})
=> "(1,2,3)"(emit-singleline-array? body-arr)checks that array is all single lines
(emit-singleline-array? ["1" "2" "3"]) => true
(emit-singleline-array? ["1" "\n2" "3"]) => false
checks that array is all single lines (emit-singleline-array? ["1" "2" "3"]) => true (emit-singleline-array? ["1" "\n2" "3"]) => false
(emit-table _ _ [_ & args] grammar mopts)emit quote structures
(emit-table nil nil '(tab :a 1 :b 2) +grammar+ {}) => "{"a":1,"b":2}"
emit quote structures
(emit-table nil nil '(tab :a 1 :b 2) +grammar+ {})
=> "{\"a\":1,\"b\":2}"(emit-table-group args)gets table group
(emit-table-group [:a 1 :b 2 :c :d])
gets table group (emit-table-group [:a 1 :b 2 :c :d])
(test-data-emit form grammar mopts)(test-data-loop form grammar mopts)emit for data structures
(test-data-loop '[(+ 1 2)] +grammar+ {}) => "[(+ 1 2)]"
(test-data-loop '{:a (+ 1 2)} +grammar+ {}) => "{[:a (+ 1 2)]}"
(test-data-loop '#{(+ 1 2)} +grammar+ {}) => throws
[:quote] (test-data-loop ''((+ A B) C) +grammar+ {}) => "((+ A B),C)"
(test-data-loop ''[(+ A B) C] +grammar+ {}) => "(+ A B),C"
[:table] (test-data-loop '(tab :a (+ 1 2) :b 2) +grammar+ {}) => "{"a":(+ 1 2),"b":2}"
(test-data-loop '(tab 1 (+ 1 2) 3 4 5) +grammar+ {}) => "{1,(+ 1 2),3,4,5}"
emit for data structures
(test-data-loop '[(+ 1 2)]
+grammar+
{})
=> "[(+ 1 2)]"
(test-data-loop '{:a (+ 1 2)}
+grammar+
{})
=> "{[:a (+ 1 2)]}"
(test-data-loop '#{(+ 1 2)}
+grammar+
{})
=> throws
[:quote]
(test-data-loop ''((+ A B) C)
+grammar+
{})
=> "((+ A B),C)"
(test-data-loop ''[(+ A B) C]
+grammar+
{})
=> "(+ A B),C"
[:table]
(test-data-loop '(tab :a (+ 1 2) :b 2)
+grammar+
{})
=> "{\"a\":(+ 1 2),\"b\":2}"
(test-data-loop '(tab 1 (+ 1 2) 3 4 5)
+grammar+
{})
=> "{1,(+ 1 2),3,4,5}"cljdoc builds & hosts documentation for Clojure/Script libraries
| Ctrl+k | Jump to recent docs |
| ← | Move to previous article |
| → | Move to next article |
| Ctrl+/ | Jump to the search field |