Given a statement v, results in the symbol t if v is true, otherwise the symbol f.
Definition:
REPL.define! 'toBool (\v if v 't else 'f)
Given a String s, results in a Symbol of that name.
Example:
symbolFromStr "x" => x
Given v, results in whether it's a Keyword or not.
Example:
if (keyword? @mode:) 'yes else 'no => yes
Given a String s, results in a Keyword of that name.
Example:
keywordFromStr "mode:" => @mode:
Given a Keyword k, results in a Str with its name.
Example:
keywordStr @mode: => "mode:"
Most of the following functions in this section are a bad idea to use. Therefore, they are striked out.
The value 0 as an Int.
Given a Int value v, get its successor on the natural numerical axis. Not necessarily Int any longer (the range of Int is limited by machine register size).
Given v, results in whether v is a number or not.
Given v, results in whether v is a Str or not.
Given v, results in whether v is a Symbol or not.
Given v, results in whether v is a Float or not.
Given v, results in whether v is an Int or not.
Given inputFile, results in the Abstract Syntax Tree for all input until the first occurence of the Symbol specified after @terminator: and a world.
position and name are used in error messages.
operatorPrecedenceList is the operator precedence list to use. This is not optional. If in doubt, just pass operatorPrecedenceList from a REPL.
Given inputStr, results in the Abstract Syntax Tree for all input until the first occurence of the Symbol specified after @terminator:.
position and name are used in error messages.
operatorPrecedenceList is the operator precedence list to use. This is not optional. If in doubt, just pass operatorPrecedenceList from a REPL.
Note that this function otherwise does no I/O.
Example:
REPL.getOperatorPrecedenceList! ;\OPL let Reflection = requireModule "Reflection" in REPL.execute! (Reflection.makeApp return! (Reflection.parseMathStr OPL "1 + 2⋅3\n"))