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 number k to constructor with name op, appending result in reverse order to acc. If do_link is true then constructor names produce Hyperdoc links. When k? is true then the argument is a type and f should be its constructor form, otherwise the argument is not a type. For non-type arguments either f or ef should give argument value. ef when not a Lisp NIL should be possibly quoted evaluated argument value and in such case lef should 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 name op, appending result in reverse order to acc. If do_link is true then constructor names produce Hyperdoc links. lf and lef are argument lists, elements of lf (lef respectively) will be passed as f (ef respectively) to con_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 form c, with evaluated form ef. Result is prepended in reverse order to acc. If do_args is false then constructor arguments are omited. If do_link is true then 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 uses n as 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 form c with name n, producing links to arguments. Output is in normal order.

condition_to_string: SExpression -> String

condition_to_string(p) produces printable string representation of predicate p.

constructor_to_string: SExpression -> String

constructor_to_string(c) produces printable string representation of constructor with form c.

predicate_to_strings: (SExpression, Boolean, List String) -> List String

predicate_to_strings(p, do_link, acc) produces string representation in Hyperdoc format of predicate p, appending result in reverse order to acc. If do_link is true then constructor names produce Hyperdoc links.