Liking cljdoc? Tell your friends :D

cljs.pprint


*print-base*cljs

The base to use for printing integers and rationals.

The base to use for printing integers and rationals.
sourceraw docstring

*print-miser-width*cljs

The column at which to enter miser style. Depending on the dispatch table, miser style add newlines in more places to try to keep lines short allowing for further levels of nesting.

The column at which to enter miser style. Depending on the dispatch table,
miser style add newlines in more places to try to keep lines short allowing for further
levels of nesting.
sourceraw docstring

*print-pprint-dispatch*cljs

The pretty print dispatch function. Use with-pprint-dispatch or set-pprint-dispatch to modify.

The pretty print dispatch function. Use with-pprint-dispatch or
set-pprint-dispatch to modify.
sourceraw docstring

*print-pretty*cljs

Bind to true if you want write to use pretty printing

Bind to true if you want write to use pretty printing
sourceraw docstring

*print-radix*cljs

Print a radix specifier in front of integers and rationals. If print-base is 2, 8, or 16, then the radix specifier used is #b, #o, or #x, respectively. Otherwise the radix specifier is in the form #XXr where XX is the decimal value of print-base

Print a radix specifier in front of integers and rationals. If *print-base* is 2, 8,
or 16, then the radix specifier used is #b, #o, or #x, respectively. Otherwise the
radix specifier is in the form #XXr where XX is the decimal value of *print-base* 
sourceraw docstring

*print-right-margin*cljs

Pretty printing will try to avoid anything going beyond this column. Set it to nil to have pprint let the line be arbitrarily long. This will ignore all non-mandatory newlines.

Pretty printing will try to avoid anything going beyond this column.
Set it to nil to have pprint let the line be arbitrarily long. This will ignore all
non-mandatory newlines.
sourceraw docstring

*print-suppress-namespaces*cljs

Don't print namespaces with symbols. This is particularly useful when pretty printing the results of macro expansions

Don't print namespaces with symbols. This is particularly useful when
pretty printing the results of macro expansions
sourceraw docstring

->buffer-blobcljs

(->buffer-blob type-tag data trailing-white-space start-pos end-pos)

Positional factory function for cljs.pprint/buffer-blob.

Positional factory function for cljs.pprint/buffer-blob.
sourceraw docstring

->end-block-tcljs

(->end-block-t type-tag logical-block start-pos end-pos)

Positional factory function for cljs.pprint/end-block-t.

Positional factory function for cljs.pprint/end-block-t.
sourceraw docstring

->indent-tcljs

(->indent-t type-tag logical-block relative-to offset start-pos end-pos)

Positional factory function for cljs.pprint/indent-t.

Positional factory function for cljs.pprint/indent-t.
sourceraw docstring

->nl-tcljs

(->nl-t type-tag type logical-block start-pos end-pos)

Positional factory function for cljs.pprint/nl-t.

Positional factory function for cljs.pprint/nl-t.
sourceraw docstring

->start-block-tcljs

(->start-block-t type-tag logical-block start-pos end-pos)

Positional factory function for cljs.pprint/start-block-t.

Positional factory function for cljs.pprint/start-block-t.
sourceraw docstring

buffer-blobcljs

source

char-codecljs

(char-code c)

Convert char to int

Convert char to int
sourceraw docstring

cl-formatcljs

(cl-format writer format-in & args)

An implementation of a Common Lisp compatible format function. cl-format formats its arguments to an output stream or string based on the format control string given. It supports sophisticated formatting of structured data.

Writer satisfies IWriter, true to output via print-fn or nil to output to a string, format-in is the format control string and the remaining arguments are the data to be formatted.

The format control string is a string to be output with embedded 'format directives' describing how to format the various arguments passed in.

If writer is nil, cl-format returns the formatted result string. Otherwise, cl-format returns nil.

For example: (let [results [46 38 22]] (cl-format true "There ~[are~;is~:;are~]~:* ~d result~:p: ~{~d~^, ~}~%" (count results) results))

Prints via print-fn: There are 3 results: 46, 38, 22

Detailed documentation on format control strings is available in the "Common Lisp the Language, 2nd edition", Chapter 22 (available online at: http://www.cs.cmu.edu/afs/cs.cmu.edu/project/ai-repository/ai/html/cltl/clm/node200.html#SECTION002633000000000000000) and in the Common Lisp HyperSpec at http://www.lispworks.com/documentation/HyperSpec/Body/22_c.htm

An implementation of a Common Lisp compatible format function. cl-format formats its
arguments to an output stream or string based on the format control string given. It
supports sophisticated formatting of structured data.

Writer satisfies IWriter, true to output via *print-fn* or nil to output
to a string, format-in is the format control string and the remaining arguments
are the data to be formatted.

The format control string is a string to be output with embedded 'format directives'
describing how to format the various arguments passed in.

If writer is nil, cl-format returns the formatted result string. Otherwise, cl-format
returns nil.

For example:
 (let [results [46 38 22]]
        (cl-format true "There ~[are~;is~:;are~]~:* ~d result~:p: ~{~d~^, ~}~%"
                   (count results) results))

Prints via *print-fn*:
 There are 3 results: 46, 38, 22

Detailed documentation on format control strings is available in the "Common Lisp the
Language, 2nd edition", Chapter 22 (available online at:
http://www.cs.cmu.edu/afs/cs.cmu.edu/project/ai-repository/ai/html/cltl/clm/node200.html#SECTION002633000000000000000)
and in the Common Lisp HyperSpec at
http://www.lispworks.com/documentation/HyperSpec/Body/22_c.htm
sourceraw docstring

code-dispatchcljsmultimethod

(code-dispatch object)

The pretty print dispatch function for pretty printing Clojure code.

The pretty print dispatch function for pretty printing Clojure code.
sourceraw docstring

deftypecljsmacro

(deftype type-name & fields)
source

directive-tablecljs

source

end-block-tcljs

source

float?cljs

(float? n)

Returns true if n is an float.

Returns true if n is an float.
sourceraw docstring

formattercljsmacro

(formatter format-in)

Makes a function which can directly run format-in. The function is fn [stream & args] ... and returns nil unless the stream is nil (meaning output to a string) in which case it returns the resulting string.

format-in can be either a control string or a previously compiled format.

Makes a function which can directly run format-in. The function is
fn [stream & args] ... and returns nil unless the stream is nil (meaning
output to a string) in which case it returns the resulting string.

format-in can be either a control string or a previously compiled format.
sourceraw docstring

formatter-outcljsmacro

(formatter-out format-in)

Makes a function which can directly run format-in. The function is fn [& args] ... and returns nil. This version of the formatter macro is designed to be used with out set to an appropriate Writer. In particular, this is meant to be used as part of a pretty printer dispatch method.

format-in can be either a control string or a previously compiled format.

Makes a function which can directly run format-in. The function is
fn [& args] ... and returns nil. This version of the formatter macro is
designed to be used with *out* set to an appropriate Writer. In particular,
this is meant to be used as part of a pretty printer dispatch method.

format-in can be either a control string or a previously compiled format.
sourceraw docstring

fresh-linecljs

(fresh-line)

Make a newline if out is not already at the beginning of the line. If out is not a pretty writer (which keeps track of columns), this function always outputs a newline.

Make a newline if *out* is not already at the beginning of the line. If *out* is
not a pretty writer (which keeps track of columns), this function always outputs a newline.
sourceraw docstring

get-pretty-writercljs

(get-pretty-writer writer)

Returns the IWriter passed in wrapped in a pretty writer proxy, unless it's already a pretty writer. Generally, it is unnecessary to call this function, since pprint, write, and cl-format all call it if they need to. However if you want the state to be preserved across calls, you will want to wrap them with this.

For example, when you want to generate column-aware output with multiple calls to cl-format, do it like in this example:

(defn print-table [aseq column-width]
  (binding [*out* (get-pretty-writer *out*)]
    (doseq [row aseq]
      (doseq [col row]
        (cl-format true "~4D~7,vT" col column-width))
      (prn))))

Now when you run:

user> (print-table (map #(vector % (* % %) (* % % %)) (range 1 11)) 8)

It prints a table of squares and cubes for the numbers from 1 to 10:

   1      1       1
   2      4       8
   3      9      27
   4     16      64
   5     25     125
   6     36     216
   7     49     343
   8     64     512
   9     81     729
  10    100    1000
Returns the IWriter passed in wrapped in a pretty writer proxy, unless it's
already a pretty writer. Generally, it is unnecessary to call this function, since pprint,
write, and cl-format all call it if they need to. However if you want the state to be
preserved across calls, you will want to wrap them with this.

For example, when you want to generate column-aware output with multiple calls to cl-format,
do it like in this example:

    (defn print-table [aseq column-width]
      (binding [*out* (get-pretty-writer *out*)]
        (doseq [row aseq]
          (doseq [col row]
            (cl-format true "~4D~7,vT" col column-width))
          (prn))))

Now when you run:

    user> (print-table (map #(vector % (* % %) (* % % %)) (range 1 11)) 8)

It prints a table of squares and cubes for the numbers from 1 to 10:

       1      1       1
       2      4       8
       3      9      27
       4     16      64
       5     25     125
       6     36     216
       7     49     343
       8     64     512
       9     81     729
      10    100    1000
sourceraw docstring

getfcljsmacro

(getf sym)

Get the value of the field a named by the argument (which should be a keyword).

Get the value of the field a named by the argument (which should be a keyword).
sourceraw docstring

indent-tcljs

source

IPrettyFlushcljsprotocol

-ppflushcljs

(-ppflush pp)
source

map->buffer-blobcljs

(map->buffer-blob G__78989)

Factory function for cljs.pprint/buffer-blob, taking a map of keywords to field values.

Factory function for cljs.pprint/buffer-blob, taking a map of keywords to field values.
sourceraw docstring

map->end-block-tcljs

(map->end-block-t G__79019)

Factory function for cljs.pprint/end-block-t, taking a map of keywords to field values.

Factory function for cljs.pprint/end-block-t, taking a map of keywords to field values.
sourceraw docstring

map->indent-tcljs

(map->indent-t G__79029)

Factory function for cljs.pprint/indent-t, taking a map of keywords to field values.

Factory function for cljs.pprint/indent-t, taking a map of keywords to field values.
sourceraw docstring

map->nl-tcljs

(map->nl-t G__78999)

Factory function for cljs.pprint/nl-t, taking a map of keywords to field values.

Factory function for cljs.pprint/nl-t, taking a map of keywords to field values.
sourceraw docstring

map->start-block-tcljs

(map->start-block-t G__79009)

Factory function for cljs.pprint/start-block-t, taking a map of keywords to field values.

Factory function for cljs.pprint/start-block-t, taking a map of keywords to field values.
sourceraw docstring

nl-tcljs

source

ppcljsmacro

(pp)

A convenience macro that pretty prints the last thing output. This is exactly equivalent to (pprint *1).

A convenience macro that pretty prints the last thing output. This is
exactly equivalent to (pprint *1).
sourceraw docstring

pprintcljs

(pprint object)
(pprint object writer)
source

pprint-indentcljs

(pprint-indent relative-to n)

Create an indent at this point in the pretty printing stream. This defines how following lines are indented. relative-to can be either :block or :current depending whether the indent should be computed relative to the start of the logical block or the current column position. n is an offset.

This function is intended for use when writing custom dispatch functions.

Output is sent to out which must be a pretty printing writer.

Create an indent at this point in the pretty printing stream. This defines how
following lines are indented. relative-to can be either :block or :current depending
whether the indent should be computed relative to the start of the logical block or
the current column position. n is an offset.

This function is intended for use when writing custom dispatch functions.

Output is sent to *out* which must be a pretty printing writer.
sourceraw docstring

pprint-logical-blockcljsmacro

(pprint-logical-block & args)

Execute the body as a pretty printing logical block with output to out which must be a pretty printing writer. When used from pprint or cl-format, this can be assumed.

This function is intended for use when writing custom dispatch functions.

Before the body, the caller can optionally specify options: :prefix, :per-line-prefix and :suffix.

Execute the body as a pretty printing logical block with output to *out* which
must be a pretty printing writer. When used from pprint or cl-format, this can be
assumed.

This function is intended for use when writing custom dispatch functions.

Before the body, the caller can optionally specify options: :prefix, :per-line-prefix
and :suffix.
sourceraw docstring

pprint-newlinecljs

(pprint-newline kind)

Print a conditional newline to a pretty printing stream. kind specifies if the newline is :linear, :miser, :fill, or :mandatory.

This function is intended for use when writing custom dispatch functions.

Output is sent to out which must be a pretty printing writer.

Print a conditional newline to a pretty printing stream. kind specifies if the
newline is :linear, :miser, :fill, or :mandatory.

This function is intended for use when writing custom dispatch functions.

Output is sent to *out* which must be a pretty printing writer.
sourceraw docstring

pprint-setcljs

source

pprint-tabcljs

(pprint-tab kind colnum colinc)

Tab at this point in the pretty printing stream. kind specifies whether the tab is :line, :section, :line-relative, or :section-relative.

Colnum and colinc specify the target column and the increment to move the target forward if the output is already past the original target.

This function is intended for use when writing custom dispatch functions.

Output is sent to out which must be a pretty printing writer.

THIS FUNCTION IS NOT YET IMPLEMENTED.

Tab at this point in the pretty printing stream. kind specifies whether the tab
is :line, :section, :line-relative, or :section-relative.

Colnum and colinc specify the target column and the increment to move the target
forward if the output is already past the original target.

This function is intended for use when writing custom dispatch functions.

Output is sent to *out* which must be a pretty printing writer.

THIS FUNCTION IS NOT YET IMPLEMENTED.
sourceraw docstring

(print-length-loop bindings & body)

A version of loop that iterates at most print-length times. This is designed for use in pretty-printer dispatch functions.

A version of loop that iterates at most *print-length* times. This is designed
for use in pretty-printer dispatch functions.
sourceraw docstring

(print-table rows)
(print-table ks rows)

Prints a collection of maps in a textual table. Prints table headings ks, and then a line of output for each row, corresponding to the keys in ks. If ks are not specified, use the keys of the first item in rows.

Prints a collection of maps in a textual table. Prints table headings
ks, and then a line of output for each row, corresponding to the keys
in ks. If ks are not specified, use the keys of the first item in rows.
sourceraw docstring

set-pprint-dispatchcljs

(set-pprint-dispatch function)
source

setfcljsmacro

(setf sym new-val)

Set the value of the field SYM to NEW-VAL

Set the value of the field SYM to NEW-VAL
sourceraw docstring

simple-dispatchcljsmultimethod

The pretty print dispatch function for simple data structure format.

The pretty print dispatch function for simple data structure format.
sourceraw docstring

start-block-tcljs

source

with-pprint-dispatchcljsmacro

(with-pprint-dispatch function & body)

Execute body with the pretty print dispatch function bound to function.

Execute body with the pretty print dispatch function bound to function.
sourceraw docstring

with-pretty-writercljsmacro

(with-pretty-writer base-writer & body)
source

writecljs

(write object & kw-args)

Write an object subject to the current bindings of the printer control variables. Use the kw-args argument to override individual variables for this call (and any recursive calls). Returns the string result if :stream is nil or nil otherwise.

The following keyword arguments can be passed with values: Keyword Meaning Default value :stream Writer for output or nil true (indicates out) :base Base to use for writing rationals Current value of print-base :circle* If true, mark circular structures Current value of print-circle :length Maximum elements to show in sublists Current value of print-length :level Maximum depth Current value of print-level :lines* Maximum lines of output Current value of print-lines :miser-width Width to enter miser mode Current value of print-miser-width :dispatch The pretty print dispatch function Current value of print-pprint-dispatch :pretty If true, do pretty printing Current value of print-pretty :radix If true, prepend a radix specifier Current value of print-radix :readably* If true, print readably Current value of print-readably :right-margin The column for the right margin Current value of print-right-margin :suppress-namespaces If true, no namespaces in symbols Current value of print-suppress-namespaces

  • = not yet supported
Write an object subject to the current bindings of the printer control variables.
Use the kw-args argument to override individual variables for this call (and any
recursive calls). Returns the string result if :stream is nil or nil otherwise.

The following keyword arguments can be passed with values:
  Keyword              Meaning                              Default value
  :stream              Writer for output or nil             true (indicates *out*)
  :base                Base to use for writing rationals    Current value of *print-base*
  :circle*             If true, mark circular structures    Current value of *print-circle*
  :length              Maximum elements to show in sublists Current value of *print-length*
  :level               Maximum depth                        Current value of *print-level*
  :lines*              Maximum lines of output              Current value of *print-lines*
  :miser-width         Width to enter miser mode            Current value of *print-miser-width*
  :dispatch            The pretty print dispatch function   Current value of *print-pprint-dispatch*
  :pretty              If true, do pretty printing          Current value of *print-pretty*
  :radix               If true, prepend a radix specifier   Current value of *print-radix*
  :readably*           If true, print readably              Current value of *print-readably*
  :right-margin        The column for the right margin      Current value of *print-right-margin*
  :suppress-namespaces If true, no namespaces in symbols    Current value of *print-suppress-namespaces*

  * = not yet supported
sourceraw docstring

write-outcljs

(write-out object)

Write an object to out subject to the current bindings of the printer control variables. Use the kw-args argument to override individual variables for this call (and any recursive calls).

out must be a PrettyWriter if pretty printing is enabled. This is the responsibility of the caller.

This method is primarily intended for use by pretty print dispatch functions that already know that the pretty printer will have set up their environment appropriately. Normal library clients should use the standard "write" interface.

Write an object to *out* subject to the current bindings of the printer control
variables. Use the kw-args argument to override individual variables for this call (and
any recursive calls).

*out* must be a PrettyWriter if pretty printing is enabled. This is the responsibility
of the caller.

This method is primarily intended for use by pretty print dispatch functions that
already know that the pretty printer will have set up their environment appropriately.
Normal library clients should use the standard "write" interface. 
sourceraw docstring

cljdoc is a website building & hosting documentation for Clojure/Script libraries

× close