(block elem)
creates a block
(base/block-info (block 1)) => {:type :token, :tag :long, :string "1", :height 0, :width 1}
(str (block [1 (newline) (void) 2])) => "[1\n 2]"
creates a block (base/block-info (block 1)) => {:type :token, :tag :long, :string "1", :height 0, :width 1} (str (block [1 (newline) (void) 2])) => "[1\n 2]"
(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-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
(comment s)
creates a comment block
(str (comment ";hello")) => ";hello"
creates a comment block (str (comment ";hello")) => ";hello"
(comment-block? block)
checks if the block is a token block
(comment-block? (construct/comment ";;hello")) => true
checks if the block is a token block (comment-block? (construct/comment ";;hello")) => true
(container tag children)
creates a container
(str (container :list [(void) (void)])) => "( )"
creates a container (str (container :list [(void) (void)])) => "( )"
(container-block? block)
checks if block is a container block
(container-block? (construct/block [])) => true
checks if block is a container block (container-block? (construct/block [])) => true
(contents block)
reads out the contents of a container
(contents (block [1 2 3])) => '[1 ␣ 2 ␣ 3]
reads out the contents of a container (contents (block [1 2 3])) => '[1 ␣ 2 ␣ 3]
(cursor)
creates a cursor for the navigator
(str (cursor)) => "|"
creates a cursor for the navigator (str (cursor)) => "|"
(eof-block? block)
checks if input is an eof block
(eof-block? (construct/void nil)) => true
checks if input is an eof block (eof-block? (construct/void nil)) => true
(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
(linebreak-block? block)
checks if block is of type :linebreak
(linebreak-block? (construct/newline)) => true
checks if block is of type :linebreak (linebreak-block? (construct/newline)) => true
(linespace-block? block)
checks if block is of type :linespace
(linespace-block? (construct/space)) => true
checks if block is of type :linespace (linespace-block? (construct/space)) => true
(modifier-block? block)
checks if block is a modifier block
(modifier-block? (construct/uneval)) => true
checks if block is a modifier block (modifier-block? (construct/uneval)) => true
(newline)
creates a newline
(str (newline))
=> "
"
creates a newline (str (newline)) => "\ "
(newlines n)
creates multiple newlines
(apply str (newlines 5))
=> "
"
creates multiple newlines (apply str (newlines 5)) => "\ \ \ \ \ "
(parse-root s)
parses a root
(str (parse-root "a b c")) => "a b c"
parses a root (str (parse-root "a b c")) => "a b c"
(parse-string s)
parses a block from a string input
(-> (parse-string "#(:b {:b 1})") (base/block-value)) => '(fn* [] ((keyword "b") {(keyword "b") 1}))
parses a block from a string input (-> (parse-string "#(:b {:b 1})") (base/block-value)) => '(fn* [] ((keyword "b") {(keyword "b") 1}))
(root children)
constructs a root block
(str (root '[a b])) => "a b"
constructs a root block (str (root '[a b])) => "a b"
(space)
creates a space block
(str (space)) => "␣"
creates a space block (str (space)) => "␣"
(space-block? block)
checks if block is of type \space
(space-block? (construct/space)) => true
checks if block is of type \space (space-block? (construct/space)) => true
(spaces n)
creates multiple space blocks
(apply str (spaces 5)) => "␣␣␣␣␣"
creates multiple space blocks (apply str (spaces 5)) => "␣␣␣␣␣"
(tabs n)
creates multiple tabs
(apply str (tabs 5)) => "\ \ \ \ \ "
creates multiple tabs (apply str (tabs 5)) => "\ \ \ \ \ "
(token-block? block)
checks if the block is a token block
(token-block? (construct/token "hello")) => true
checks if the block is a token block (token-block? (construct/token "hello")) => true
(uneval)
creates a hash-uneval block
(str (uneval)) => "#_"
creates a hash-uneval block (str (uneval)) => "#_"
(void)
(void ch)
creates a void block
(str (void)) => "␣"
creates a void block (str (void)) => "␣"
(void-block? block)
checks if the block is a void block
(void-block? (construct/void)) => true
checks if the block is a void block (void-block? (construct/void)) => true
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close