InputFormΒΆ
mkfunc.spad line 1 [edit on github]
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
from SExpressionCategory(String, Symbol, Integer, DoubleFloat)
- *: (%, %) -> %
a * b
returns the input form corresponding toa * b
.
- +: (%, %) -> %
a + b
returns the input form corresponding toa + b
.
- /: (%, %) -> %
a / b
returns the input form corresponding toa / b
.
- ^: (%, Integer) -> %
a ^ b
returns the input form corresponding toa ^ b
.
- ^: (%, NonNegativeInteger) -> %
a ^ b
returns the input form corresponding toa ^ b
.
- atom?: % -> Boolean
from SExpressionCategory(String, Symbol, Integer, DoubleFloat)
- binary: (%, List %) -> %
binary(op, [a1, ..., an])
returns the input form corresponding toa1 op a2 op ... op an
.
- car: % -> %
from SExpressionCategory(String, Symbol, Integer, DoubleFloat)
- cdr: % -> %
from SExpressionCategory(String, Symbol, Integer, DoubleFloat)
- coerce: % -> OutputForm
from CoercibleTo OutputForm
- compile: (Symbol, List %) -> Symbol
compile(f, [t1, ..., tn])
forces the interpreter to compile the functionf
with signature(t1, ..., tn) -> ?
. returns the symbolf
if successful. Error: iff
was not defined beforehand in the interpreter, or if theti
's
are not valid types, or if the compiler fails.
- convert: % -> %
from ConvertibleTo %
- convert: % -> SExpression
from ConvertibleTo SExpression
- convert: DoubleFloat -> %
from SExpressionCategory(String, Symbol, Integer, DoubleFloat)
- convert: Integer -> %
from SExpressionCategory(String, Symbol, Integer, DoubleFloat)
- convert: List % -> %
from SExpressionCategory(String, Symbol, Integer, DoubleFloat)
- convert: SExpression -> %
convert(s)
makess
into an input form.- convert: String -> %
from SExpressionCategory(String, Symbol, Integer, DoubleFloat)
- convert: Symbol -> %
from SExpressionCategory(String, Symbol, Integer, DoubleFloat)
- declare: List % -> Symbol
declare(t)
returns a namef
such thatf
has been declared to the interpreter to be of typet
, but has not been assigned a value yet. Note:t
should be created asdevaluate(T)\$Lisp
whereT
is the actual type off
(this hack is required for the case whereT
is a mapping type).
- destruct: % -> List %
from SExpressionCategory(String, Symbol, Integer, DoubleFloat)
- elt: (%, Integer) -> %
from SExpressionCategory(String, Symbol, Integer, DoubleFloat)
- elt: (%, List Integer) -> %
from SExpressionCategory(String, Symbol, Integer, DoubleFloat)
- eq: (%, %) -> Boolean
from SExpressionCategory(String, Symbol, Integer, DoubleFloat)
- flatten: % -> %
flatten(s)
returns an input form corresponding tos
with all the nested operations flattened to triples using new local variables. Ifs
is a piece of code, this speeds up the compilation tremendously later on.
- float?: % -> Boolean
from SExpressionCategory(String, Symbol, Integer, DoubleFloat)
- float: % -> DoubleFloat
from SExpressionCategory(String, Symbol, Integer, DoubleFloat)
- function: (%, List Symbol, Symbol) -> %
function(code, [x1, ..., xn], f)
returns the input form corresponding tof(x1, ..., xn) == code
.
- hash: % -> SingleInteger
from Hashable
- hashUpdate!: (HashState, %) -> HashState
from Hashable
- integer?: % -> Boolean
from SExpressionCategory(String, Symbol, Integer, DoubleFloat)
- integer: % -> Integer
from SExpressionCategory(String, Symbol, Integer, DoubleFloat)
- interpret: % -> Any
interpret(f)
passesf
to the interpreter.
- interpret_in_new_env: % -> Any
interpret_in_new_env(f)
evaluatesf
in the interpreter using fresh environment which is discarded after evaluation
- lambda: (%, List Symbol) -> %
lambda(code, [x1, ..., xn])
returns the input form corresponding to(x1, ..., xn) +-> code
ifn > 1
, or tox1 +-> code
ifn = 1
.
- latex: % -> String
from SetCategory
- list?: % -> Boolean
from SExpressionCategory(String, Symbol, Integer, DoubleFloat)
- null?: % -> Boolean
from SExpressionCategory(String, Symbol, Integer, DoubleFloat)
- pair?: % -> Boolean
from SExpressionCategory(String, Symbol, Integer, DoubleFloat)
- parse: String -> %
parse(s)
is the inverse of unparse. It parses a string to InputForm
- string?: % -> Boolean
from SExpressionCategory(String, Symbol, Integer, DoubleFloat)
- string: % -> String
from SExpressionCategory(String, Symbol, Integer, DoubleFloat)
- symbol?: % -> Boolean
from SExpressionCategory(String, Symbol, Integer, DoubleFloat)
- symbol: % -> Symbol
from SExpressionCategory(String, Symbol, Integer, DoubleFloat)
- unparse: % -> String
unparse(f)
returns a strings
such that the parser would transforms
tof
. Error: iff
is not the parsed form of a string.