CrossClj

0.3.0 docs

SourceDocs



RECENT
    VARS
    *code-table*
    *current-length*
    *current-level*
    *default-page-width*
    *format-str*
    *print-base*
    *print-circle*
    *print-lines*
    *print-miser-width*
    *print-pprint-dispatch*
    *print-pretty*
    *print-radix*
    *print-right-margin*
    *print-shared*
    *print-suppress-namespaces*
    *symbol-map*
    ->arg-navigator
    ->buffer-blob
    ->compiled-directive
    ->end-block-t
    ->indent-t
    ->logical-block
    ->nl-t
    ->start-block-t
    abort?
    absolute-reposition
    absolute-tabulation
    add-core-ns
    add-english-scales
    add-padding
    add-to-buffer
    ancestor?
    arg-navigator
    base-str
    boolean-conditional
    brackets
    buffer-blob
    buffer-blob?
    buffer-length
    c-write-char
    cached-compile
    capitalize-string
    capitalize-word-writer
    char-code
    check-arg-conditional
    check-enumerated-arg
    check-flags
    choice-conditional
    cl-format
    code-dispatch
    collect-clauses
    column-writer
    compile-directive
    compile-format
    compile-raw-string
    compiled-directive
    conditional-newline
    consume
    consume-while
    convert-ratio
    directive-table
    dollar-float
    downcase-writer
    else-separator?
    emit-nl
    emit-nl?
    end-block
    end-block-t
    end-block-t?
    english-cardinal-tens
    english-cardinal-units
    english-ordinal-tens
    english-ordinal-units
    english-scale-numbers
    execute-format
    execute-sub-format
    expand-fixed
    exponential-float
    extract-flags
    extract-param
    extract-params
    fixed-float
    flag-defs
    float-parts
    float-parts-base
    float?
    format-ascii
    format-cardinal-english
    format-error
    format-integer
    format-logical-block
    format-new-roman
    format-old-roman
    format-ordinal-english
    format-roman
    format-simple-cardinal
    format-simple-number
    format-simple-ordinal
    fresh-line
    general-float
    get-column
    get-field
    get-fixed
    get-format-arg
    get-line
    get-max-column
    get-miser-width
    get-pretty-writer
    get-section
    get-sub-section
    get-writer
    group-by*
    inc-s
    indent
    indent-t
    indent-t?
    init-cap-writer
    init-navigator
    insert-decimal
    insert-scaled-decimal
    integral?
    IPrettyFlush
    iterate-list-of-sublists
    iterate-main-list
    iterate-main-sublists
    iterate-sublist
    javascript-base-formats
    justify-clauses
    level-exceeded
    linear-nl?
    logical-block
    logical-block-or-justify
    ltrim
    make-buffer-blob
    make-end-block-t
    make-indent-t
    make-nl-t
    make-pretty-writer
    make-start-block-t
    map->arg-navigator
    map->buffer-blob
    map->compiled-directive
    map->end-block-t
    map->indent-t
    map->logical-block
    map->nl-t
    map->start-block-t
    map-params
    map-passing-context
    map-ref-type
    miser-nl?
    modify-case
    multi-defn
    needs-pretty
    new-roman-table
    next-arg
    next-arg-or-nil
    nl
    nl-t
    nl-t?
    old-roman-table
    opt-base-str
    p-write-char
    param-pattern
    plain-character
    pp-newline
    pprint
    pprint-anon-func
    pprint-array
    pprint-binding-form
    pprint-code-list
    pprint-code-symbol
    pprint-cond
    pprint-condp
    pprint-defn
    pprint-hold-first
    pprint-ideref
    pprint-if
    pprint-indent
    pprint-let
    pprint-list
    pprint-map
    pprint-newline
    pprint-ns
    pprint-ns-reference
    pprint-pqueue
    pprint-reader-macro
    pprint-set
    pprint-simple-code-list
    pprint-simple-default
    pprint-simple-list
    pprint-tab
    pprint-vector
    pr
    prefix-count
    pretty-character
    pretty-writer
    pretty-writer?
    print
    print-char
    print-table
    println
    prn
    process-bracket
    process-clause
    process-nesting
    readable-character
    reader-macros
    realize-parameter
    realize-parameter-list
    relative-reposition
    relative-tabulation
    remainders
    render-clauses
    right-bracket
    round-str
    rtrim
    separator?
    set-field
    set-indent
    set-max-column
    set-pprint-dispatch
    simple-dispatch
    single-defn
    special-chars
    special-params
    special-radix-markers
    split-at-newline
    start-block
    start-block-t
    start-block-t?
    table-ize
    tokens-fit?
    translate-param
    tuple-map
    two-forms
    type-dispatcher
    type-map
    unzip-map
    upcase-writer
    update-nl-state
    use-method
    write
    write-buffered-output
    write-initial-lines
    write-line
    write-option-table
    write-out
    write-token
    write-token-string
    write-tokens
    write-white-space

    « Index of all namespaces of this project

    Dynamic
    The base to use for printing integers and rationals.
    
    PrivateDynamic
    Mark circular structures (N.B. This is not yet used)
    
    PrivateDynamic
    Maximum number of lines to print in a pretty print instance (N.B. This is not yet used)
    
    Dynamic
    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.
    Dynamic
    The pretty print dispatch function. Use with-pprint-dispatch or
    set-pprint-dispatch to modify.
    Dynamic
    Bind to true if you want write to use pretty printing
    
    Dynamic
    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* 
    Dynamic
    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.
    PrivateDynamic
    Mark repeated structures rather than repeat them (N.B. This is not yet used)
    
    Dynamic
    Don't print namespaces with symbols. This is particularly useful when
    pretty printing the results of macro expansions
    Private
    (->arg-navigator seq rest pos)
    (->buffer-blob type-tag data trailing-white-space start-pos end-pos)
    Private
    (->compiled-directive func def params offset)
    (->end-block-t type-tag logical-block start-pos end-pos)
    (->indent-t type-tag logical-block relative-to offset start-pos end-pos)
    Private
    (->logical-block parent section start-col indent done-nl intra-block-nl prefix per-line-prefix suffix logical-block-callback)
    (->nl-t type-tag type logical-block start-pos end-pos)
    (->start-block-t type-tag logical-block start-pos end-pos)
    Private
    (abort? context)
    Private
    (absolute-reposition navigator position)
    Private
    (absolute-tabulation params navigator offsets)
    Private
    (add-core-ns amap)
    Private
    (add-english-scales parts offset)
    Take a sequence of parts, add scale numbers (e.g., million) and combine into a string
    offset is a factor of 10^3 to multiply by
    Private
    (add-padding width s)
    Private
    (add-to-buffer this token)
    Private
    (ancestor? parent child)
    Private
    (base-str base val)
    Return val as a string in the given base
    
    Private
    (boolean-conditional params arg-navigator offsets)
    Private
    (brackets form)
    Figure out which kind of brackets to use
    
    Private
    (buffer-blob? x__46480__auto__)
    Private
    (buffer-length l)
    Private
    (c-write-char this c)
    Private
    (capitalize-string s first?)
    Capitalizes the words in a string. If first? is false, don't capitalize the
    first character of the string even if it's a letter.
    Private
    (capitalize-word-writer writer)
    Returns a proxy that wraps writer, capitalizing all words
    
    (char-code c)
    Convert char to int
    
    Private
    (check-arg-conditional params arg-navigator offsets)
    Private
    (check-enumerated-arg arg choices)
    Private
    (check-flags def flags)
    Private
    (choice-conditional params arg-navigator offsets)
    (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
    (code-dispatch object)
    The pretty print dispatch function for pretty printing Clojure code.
    
    Private
    (collect-clauses bracket-info offset remainder)
    Private
    (column-writer ???)(column-writer ???)
    Private
    (compile-directive s offset)
    Private
    (compile-format format-str)
    Compiles format-str into a compiled format which can be used as an argument
    to cl-format just like a plain format string. Use this function for improved
    performance when you're using the same format string repeatedly
    Private
    (compile-raw-string s offset)
    Private
    (conditional-newline params navigator offsets)
    Private
    (consume func initial-context)
    Private
    (consume-while func initial-context)
    Private
    (convert-ratio x)
    Private
    (dollar-float params navigator offsets)
    Private
    (downcase-writer writer)
    Returns a proxy that wraps writer, converting all characters to lower case
    
    Private
    (else-separator? this)
    Private
    (emit-nl this nl)
    Private
    (end-block this)
    Private
    (end-block-t? x__46480__auto__)
    Private
    (execute-format ???)(execute-format ???)
    Executes the format with the arguments.
    
    Private
    (execute-sub-format format args base-args)
    Private
    (expand-fixed m e d)
    Private
    (exponential-float params navigator offset)
    Private
    (extract-flags s offset)
    Private
    (extract-param [s offset saw-comma])
    Private
    (extract-params s offset)
    Private
    (fixed-float params navigator offsets)
    Private
    (float-parts f)
    Take care of leading and trailing zeros in decomposed floats
    
    Private
    (float-parts-base f)
    Produce string parts for the mantissa (normalize 1-9) and exponent
    
    (float? n)
    Returns true if n is an float.
    
    Private
    (format-ascii print-func params arg-navigator offsets)
    Private
    (format-cardinal-english params navigator offsets)
    Private
    (format-error message offset)
    Private
    (format-integer base params arg-navigator offsets)
    Private
    (format-logical-block params navigator offsets)
    Private
    (format-new-roman params navigator offsets)
    Private
    (format-old-roman params navigator offsets)
    Private
    (format-ordinal-english params navigator offsets)
    Private
    (format-roman table params navigator offsets)
    Format a roman numeral using the specified look-up table
    
    Private
    (format-simple-cardinal num)
    Convert a number less than 1000 to a cardinal english string
    
    Private
    (format-simple-number n)
    Private
    (format-simple-ordinal num)
    Convert a number less than 1000 to a ordinal english string
    Note this should only be used for the last one in the sequence
    (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.
    Private
    (general-float params navigator offsets)
    Private
    (get-column this)
    Private
    (get-field this sym)
    Private
    (get-fixed m e d)
    Private
    (get-format-arg navigator)
    Private
    (get-line this)
    Private
    (get-max-column this)
    Private
    (get-miser-width this)
    (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
    Private
    (get-section buffer)
    Private
    (get-sub-section buffer)
    Private
    (get-writer this)
    Private
    (group-by* unit lis)
    Private
    (inc-s s)
    Assumption: The input string consists of one or more decimal digits,
    and no other characters. Return a string containing one or more
    decimal digits containing a decimal number one larger than the input
    string. The output string will always be the same length as the input
    string, or one character longer.
    Private
    (indent this relative-to offset)
    Private
    (indent-t? x__46480__auto__)
    Private
    (init-cap-writer writer)
    Returns a proxy that wraps writer, capitalizing the first word
    
    Private
    (init-navigator s)
    Create a new arg-navigator from the sequence with the position set to 0
    
    Private
    (insert-decimal m e)
    Insert the decimal point at the right spot in the number to match an exponent
    
    Private
    (insert-scaled-decimal m k)
    Insert the decimal point at the right spot in the number to match an exponent
    
    Private
    (integral? x)
    returns true if a number is actually an integer (that is, has no fractional part)
    
    Private
    (iterate-list-of-sublists params navigator offsets)
    Private
    (iterate-main-list params navigator offsets)
    Private
    (iterate-main-sublists params navigator offsets)
    Private
    (iterate-sublist params navigator offsets)
    Private
    (justify-clauses params navigator offsets)
    Private
    (level-exceeded)
    Private
    (linear-nl? this lb section)
    Private
    (logical-block-or-justify params navigator offsets)
    Private
    (ltrim s c)
    Private
    (make-buffer-blob data trailing-white-space start-pos end-pos)
    Private
    (make-end-block-t logical-block start-pos end-pos)
    Private
    (make-indent-t logical-block relative-to offset start-pos end-pos)
    Private
    (make-nl-t type logical-block start-pos end-pos)
    Private
    (make-pretty-writer base-writer right-margin miser-width)
    Wrap base-writer in a PrettyWriter with the specified right-margin and miser-width
    
    Private
    (make-start-block-t logical-block start-pos end-pos)
    Private
    (map->arg-navigator G__46730)
    (map->buffer-blob G__46627)
    Private
    (map->compiled-directive G__46742)
    (map->end-block-t G__46654)
    (map->indent-t G__46663)
    Private
    (map->logical-block G__46618)
    (map->nl-t G__46636)
    (map->start-block-t G__46645)
    Private
    (map-params def params flags offset)
    Takes a directive definition and the list of actual parameters and
    a map of flags and returns a map of the parameters and flags with defaults
    filled in. We check to make sure that there are the right types and number
    of parameters as well.
    Private
    (map-passing-context func initial-context lis)
    Private
    (map-ref-type name)
    Map ugly type names to something simpler
    
    Private
    (miser-nl? this lb section)
    Private
    (modify-case make-writer params navigator offsets)
    Private
    (multi-defn alis has-doc-str?)
    Private
    (needs-pretty format)
    determine whether a given compiled format has any directives that depend on the
    column number or pretty printing
    Private
    (next-arg navigator)
    Private
    (next-arg-or-nil navigator)
    Private
    (nl this type)
    Private
    (nl-t? x__46480__auto__)
    Private
    (opt-base-str base val)
    Return val as a string in the given base. No cljs format, so no improved performance.
    
    Private
    (p-write-char this c)
    Private
    (plain-character params navigator offsets)
    (pprint ???)(pprint ???)
    Private
    (pprint-anon-func alis)
    Private
    (pprint-binding-form binding-vec)
    Private
    (pprint-code-list alis)
    Private
    (pprint-code-symbol sym)
    Private
    (pprint-cond alis)
    Private
    (pprint-condp alis)
    Private
    (pprint-defn alis)
    Private
    (pprint-ideref o)
    (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.
    Private
    (pprint-let alis)
    Private
    (pprint-list alis)
    Private
    (pprint-map amap)
    (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.
    Private
    (pprint-ns alis)
    The pretty print dispatch chunk for the ns macro
    
    Private
    (pprint-ns-reference reference)
    Pretty print a single reference (import, use, etc.) from a namespace decl
    
    Private
    (pprint-reader-macro alis)
    Private
    (pprint-simple-code-list alis)
    Private
    (pprint-simple-default obj)
    Private
    (pprint-simple-list alis)
    (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.
    Private
    (pprint-vector avec)
    PrivateDynamic
    (pr & more)
    Private
    (prefix-count aseq val)
    Private
    (pretty-character params navigator offsets)
    Private
    (pretty-writer writer max-columns miser-width)
    Private
    (pretty-writer? x)
    Return true iff x is a PrettyWriter
    
    Private
    (print & more)
    Private
    (print-char c)
    (print-table ???)
    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.
    Private
    (println & more)
    Private
    (prn & more)
    Private
    (process-bracket this remainder)
    Private
    (process-clause bracket-info offset remainder)
    Private
    (process-nesting format)
    Take a linearly compiled format and process the bracket directives to give it
    the appropriate tree structure
    Private
    (readable-character params navigator offsets)
    Private
    (realize-parameter [param [raw-val offset]] navigator)
    Private
    (realize-parameter-list parameter-map navigator)
    Private
    (relative-reposition navigator position)
    Private
    (relative-tabulation params navigator offsets)
    Private
    (remainders base val)
    Return the list of remainders (essentially the 'digits') of val in the given base
    
    Private
    (render-clauses clauses navigator base-navigator)
    Private
    (right-bracket this)
    Private
    (round-str m e d w)
    Private
    (rtrim s c)
    Private
    (separator? this)
    Private
    (set-field this sym new-val)
    Private
    (set-indent params navigator offsets)
    Private
    (set-max-column this new-max)
    (set-pprint-dispatch function)
    The pretty print dispatch function for simple data structure format.
    
    Private
    (single-defn alis has-doc-str?)
    Private
    (split-at-newline tokens)
    Private
    (start-block this prefix per-line-prefix suffix)
    Private
    (start-block-t? x__46480__auto__)
    Private
    (table-ize t m)
    Private
    (tokens-fit? this tokens)
    Private
    (translate-param [p offset])
    Translate the string representation of a param to the internalized
    representation
    Private
    (tuple-map m v1)
    Private
    (two-forms amap)
    Private
    (type-dispatcher obj)
    Private
    (unzip-map m)
    Private
    (upcase-writer writer)
    Returns a proxy that wraps writer, converting all characters to upper case
    
    Private
    (update-nl-state lb)
    Private
    (use-method multifn dispatch-val func)
    Installs a function as a new method of multimethod associated with dispatch-value. 
    
    (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
    Private
    (write-buffered-output this)
    Private
    (write-initial-lines this s)
    Private
    (write-line this)
    (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. 
    Private
    (write-token-string this tokens)
    Private
    (write-tokens this tokens force-trailing-whitespace)
    Private
    (write-white-space this)