InputFormΒΆ

Domain of parsed forms which can be passed to the interpreter. This is also the interface between algebra code and facilities in the interpreter.

0: %

0 returns the input form corresponding to 0.

1: %

1 returns the input form corresponding to 1.

#: % -> Integer
*: (%, %) -> %

a * b returns the input form corresponding to a * b.

+: (%, %) -> %

a + b returns the input form corresponding to a + b.

/: (%, %) -> %

a / b returns the input form corresponding to a / b.

=: (%, %) -> Boolean

from BasicType

^: (%, Integer) -> %

a ^ b returns the input form corresponding to a ^ b.

^: (%, NonNegativeInteger) -> %

a ^ b returns the input form corresponding to a ^ b.

~=: (%, %) -> Boolean

from BasicType

atom?: % -> Boolean
binary: (%, List %) -> %

binary(op, [a1, ..., an]) returns the input form corresponding to a1 op a2 op ... op an.

car: % -> %
cdr: % -> %
coerce: % -> OutputForm
compile: (Symbol, List %) -> Symbol

compile(f, [t1, ..., tn]) forces the interpreter to compile the function f with signature (t1, ..., tn) -> ?. returns the symbol f if successful. Error: if f was not defined beforehand in the interpreter, or if the ti's are not valid types, or if the compiler fails.

convert: % -> SExpression
convert: DoubleFloat -> %
convert: Integer -> %
convert: List % -> %
convert: SExpression -> %

convert(s) makes s into an input form.

convert: String -> %
convert: Symbol -> %
declare: List % -> Symbol

declare(t) returns a name f such that f has been declared to the interpreter to be of type t, but has not been assigned a value yet. Note: t should be created as devaluate(T)\\$Lisp where T is the actual type of f (this hack is required for the case where T is a mapping type).

destruct: % -> List %
elt: (%, Integer) -> %
elt: (%, List Integer) -> %
eq: (%, %) -> Boolean
flatten: % -> %

flatten(s) returns an input form corresponding to s with all the nested operations flattened to triples using new local variables. If s is a piece of code, this speeds up the compilation tremendously later on.

float?: % -> Boolean
float: % -> DoubleFloat
function: (%, List Symbol, Symbol) -> %

function(code, [x1, ..., xn], f) returns the input form corresponding to f(x1, ..., xn) == code.

hash: % -> SingleInteger

from SetCategory

hashUpdate!: (HashState, %) -> HashState

from SetCategory

integer?: % -> Boolean
integer: % -> Integer
interpret: % -> Any

interpret(f) passes f to the interpreter.

lambda: (%, List Symbol) -> %

lambda(code, [x1, ..., xn]) returns the input form corresponding to (x1, ..., xn) +-> code if n > 1, or to x1 +-> code if n = 1.

latex: % -> String

from SetCategory

list?: % -> Boolean
null?: % -> Boolean
pair?: % -> Boolean
parse: String -> %

parse(s) is the inverse of unparse. It parses a string to InputForm

string?: % -> Boolean
string: % -> String
symbol?: % -> Boolean
symbol: % -> Symbol
unparse: % -> String

unparse(f) returns a string s such that the parser would transform s to f. Error: if f is not the parsed form of a string.

BasicType

SetCategory