(block-children block)
returns the children in the block
(->> (block-children (parse/parse-string "[1 2]")) (apply str)) => "1␣␣␣2"
returns the children in the block (->> (block-children (parse/parse-string "[1 2]")) (apply str)) => "1␣␣␣2"
(block-height block)
returns the height of a block
(block-height (construct/block ^:list [(construct/newline) (construct/newline)])) => 2
returns the height of a block (block-height (construct/block ^:list [(construct/newline) (construct/newline)])) => 2
(block-info block)
returns the data associated with the block
(block-info (construct/token true)) => {:type :token, :tag :boolean, :string "true", :height 0, :width 4} => {:type :token, :tag :boolean, :string "true"}
(block-info (construct/void \tab)) => {:type :void, :tag :linetab, :string "\t", :height 0, :width 4}
returns the data associated with the block (block-info (construct/token true)) => {:type :token, :tag :boolean, :string "true", :height 0, :width 4} => {:type :token, :tag :boolean, :string "true"} (block-info (construct/void \tab)) => {:type :void, :tag :linetab, :string "\t", :height 0, :width 4}
(block-length block)
return the length of the string
(block-length (construct/void)) => 1
(block-length (construct/block [1 2 3 4])) => 9
return the length of the string (block-length (construct/void)) => 1 (block-length (construct/block [1 2 3 4])) => 9
(block-modify block accumulator input)
allows the block to modify an accumulator
(block-modify (construct/uneval) [1 2] 'ANYTHING) => [1 2]
allows the block to modify an accumulator (block-modify (construct/uneval) [1 2] 'ANYTHING) => [1 2]
(block-prefixed block)
returns the length of the starting characters
(block-prefixed (construct/block #{})) => 2
returns the length of the starting characters (block-prefixed (construct/block #{})) => 2
(block-string block)
returns block string as representated in the file
(block-string (construct/token 3/4)) => "3/4"
(block-string (construct/void \space)) => ""
returns block string as representated in the file (block-string (construct/token 3/4)) => "3/4" (block-string (construct/void \space)) => ""
(block-suffixed block)
returns the length of the ending characters
(block-suffixed (construct/block #{})) => 1
returns the length of the ending characters (block-suffixed (construct/block #{})) => 1
(block-tag block)
returns block tag as keyword
(block-tag (construct/void nil)) => :eof
(block-tag (construct/void \space)) => :linespace
returns block tag as keyword (block-tag (construct/void nil)) => :eof (block-tag (construct/void \space)) => :linespace
(block-type block)
returns block type as keyword
(block-type (construct/void nil)) => :void
(block-type (construct/token "hello")) => :token
returns block type as keyword (block-type (construct/void nil)) => :void (block-type (construct/token "hello")) => :token
(block-value block)
returns the value of the block
(block-value (construct/token 1.2)) => 1.2
returns the value of the block (block-value (construct/token 1.2)) => 1.2
(block-value-string block)
returns the string for which a value will be generated
(block-value-string (parse/parse-string "#(+ 1 ::2)")) => "#(+ 1 (keyword ":2"))"
returns the string for which a value will be generated (block-value-string (parse/parse-string "#(+ 1 ::2)")) => "#(+ 1 (keyword \":2\"))"
(block-verify block)
checks that the block has correct data
checks that the block has correct data
(block-width block)
returns the width of a block
(block-width (construct/token 'hello)) => 5
returns the width of a block (block-width (construct/token 'hello)) => 5
(block? obj)
check whether an object is a block
(block? (construct/void nil)) => true
(block? (construct/token "hello")) => true
check whether an object is a block (block? (construct/void nil)) => true (block? (construct/token "hello")) => true
(container? block)
determines whether a block has children
(container? (parse/parse-string "[1 2 3]")) => true
(container? (parse/parse-string " ")) => false
determines whether a block has children (container? (parse/parse-string "[1 2 3]")) => true (container? (parse/parse-string " ")) => false
(expression? block)
checks if the block has a value associated with it
(expression? (construct/token 1.2)) => true
checks if the block has a value associated with it (expression? (construct/token 1.2)) => true
(modifier? block)
checks if the block is of type INodeModifier
(modifier? (construct/uneval)) => true
checks if the block is of type INodeModifier (modifier? (construct/uneval)) => true
(replace-children block children)
replace childer
(->> (replace-children (construct/block []) (conj (vec (block-children (construct/block [1 2]))) (construct/void \space) (construct/block [3 4]))) str) => "[1 2 [3 4]]"
replace childer (->> (replace-children (construct/block []) (conj (vec (block-children (construct/block [1 2]))) (construct/void \space) (construct/block [3 4]))) str) => "[1 2 [3 4]]"
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close