HyperdocUtilities¶
hypertex.spad line 1637 [edit on github]
This package provides functions converting constructors and predicates to strings for Hyperdoc use. Constructors and and arguments to constructors may be passed in two forms, either as actual value or formal value which may be not evaluable.
- con_arg_to_strings: (Boolean, Symbol, List SExpression, SExpression, SExpression, Integer, Boolean, List String) -> List String
con_arg_to_strings(k?, op, lef, f, ef, k, do_link, acc)produces string representation in Hyperdoc format of argument numberkto constructor with nameop, appending result in reverse order to acc. Ifdo_linkistruethen constructor names produce Hyperdoc links. Whenk?istruethen the argument is a type andfshould be its constructor form, otherwise the argument is not a type. For non-type arguments eitherforefshould give argument value.efwhen not a Lisp NIL should be possibly quoted evaluated argument value and in such caselefshould be list of all possibly quoted evaluated arguments to the constructor.
- con_args_to_strings: (Symbol, List SExpression, List SExpression, Boolean, List String) -> List String
con_args_to_strings(op, lf, lef, do_link, acc)produces string representation in Hyperdoc format of arguments to constructor with nameop, appending result in reverse order to acc. Ifdo_linkistruethen constructor names produce Hyperdoc links.lfandlefare argument lists, elements oflf(lefrespectively) will be passed asf(ef respectively) tocon_arg_to_strings.
- con_to_strings: (SExpression, Boolean, List String) -> List String
con_to_strings(c, do_link, acc)is equivalent to con_to_strings(c, ef,true,do_link, acc) with empty ef.
- con_to_strings: (SExpression, SExpression, Boolean, Boolean, List String) -> List String
con_to_strings(c, ef, do_args, do_link, acc)produces string representation in Hyperdoc format for constructor of formc, with evaluated formef. Result is prepended in reverse order to acc. Ifdo_argsisfalsethen constructor arguments are omited. Ifdo_linkistruethen constructor names produce Hyperdoc links.
- con_to_strings: (String, SExpression, SExpression, Boolean, Boolean, List String) -> List String
con_to_strings(n, c, ef, do_args, do_link, acc)is like con_to_strings(c,ef,do_args,do_link, acc), but usesnas name of the toplevel constructor.
- con_to_strings: (Symbol, List SExpression) -> List String
con_to_strings(n, c)produces string representation in Hyperdoc format of constructor of formcwith namen, producing links to arguments. Output is in normal order.
- condition_to_string: SExpression -> String
condition_to_string(p)produces printable string representation of predicatep.
- constructor_to_string: SExpression -> String
constructor_to_string(c)produces printable string representation of constructor with formc.