- AskButtons
AskButtons (query, button1, ...) |
Asks a question and presents a list of buttons to the user (or
a menu of options in text mode). Returns the 1-based index of the button
pressed. That is, returns 1 if the first button was pressed, 2 if the second
button was pressed, and so on. If the user closes the window (or simply hits
enter in text mode), then null
is returned. The execution
of the program is blocked until the user responds.
- AskString
AskString (query, default) |
Asks a question and lets the user enter a string which
it then returns. If the user cancels or closes the window, then
null
is returned. The execution of the program
is blocked until the user responds. If default
is given, then it is pre-typed in for the user to just press enter on.
- Compose
Compose two functions and return a function that is the composition of f and g.
- ComposePower
Compose and execute a function with itself n
times, passing x
as argument. Returning x
if
n
equals 0.
Example:
genius> function f(x) = x^2 ;
genius> ComposePower (f,3,7)
= 5764801
genius> f(f(f(7)))
= 5764801
|
- Evaluate
Parses and evaluates a string.
- GetCurrentModulo
Get current modulo from the context outside the function. That is, if outside of
the function was executed in modulo (using mod) then this returns what
this modulo was. Normally the body of the function called is not executed in modular arithmetic,
and this builtin function makes it possible to make GEL functions aware of modular arithmetic.
- Identity
Identity function, returns its argument.
- IntegerFromBoolean
IntegerFromBoolean (bval) |
Make integer (0 for false
or 1 for
true
) from a boolean value.
bval
can also be a number in which case a
non-zero value will be interpreted as true
and
zero will be interpreted as false
.
- IsBoolean
Check if argument is a boolean (and not a number).
- IsDefined
Check if an id is defined. You should pass a string or
and identifier. If you pass a matrix, each entry will be
evaluated separately and the matrix should contain strings
or identifiers.
- IsFunction
Check if argument is a function.
- IsFunctionOrIdentifier
IsFunctionOrIdentifier (arg) |
Check if argument is a function or an identifier.
- IsFunctionRef
Check if argument is a function reference. This includes variable
references.
- IsMatrix
Check if argument is a matrix. Even though null
is
sometimes considered an empty matrix, the function IsMatrix does
not consider null
a matrix.
- IsNull
Check if argument is a null
.
- IsString
Check if argument is a text string.
- IsValue
Check if argument is a number.
- Parse
Parses but does not evaluate a string. Note that certain
pre-computation is done during the parsing stage.
- SetFunctionFlags
SetFunctionFlags (id,flags...) |
Set flags for a function, currently "PropagateMod" and "NoModuloArguments".
If "PropagateMod" is set, then the body of the function is evaluated in modular arithmetic when the function
is called inside a block that was evaluated using modular arithmetic (using mod). If
"NoModuloArguments", then the arguments of the function are never evaluated using modular arithmetic.
- SetHelp
SetHelp (id,category,desc) |
Set the category and help description line for a function.
- SetHelpAlias
Sets up a help alias.
- chdir
Changes current directory, same as the cd.
- CurrentTime
Returns the current UNIX time with microsecond precision as a floating point number. That is, returns the number of seconds since January 1st 1970.
- display
Display a string and an expression with a colon to separate them.
- error
Prints a string to the error stream (onto the console).
- exit
Aliases: quit
Exits the program.
- false
Aliases: False FALSE
The false
boolean value.
- manual
Displays the user manual.
- print
Prints an expression and then print a newline. The argument str
can be any expression. It is
made into a string before being printed.
- printn
Prints an expression without a trailing newline. The argument str
can be any expression. It is
made into a string before being printed.
- protect
Protect a variable from being modified. This is used on the internal GEL functions to
avoid them being accidentally overridden.
- ProtectAll
Protect all currently defined variables, parameters and
functions from being modified. This is used on the internal GEL functions to
avoid them being accidentally overridden. Normally Genius Mathematics Tool considers
unprotected variables as user defined.
- set
Set a global variable. The id
can be either a string or a quoted identifier as follows.
For example:
will set the global variable x
to the value 1.
- string
Make a string. This will make a string out of any argument.
- true
Aliases: True TRUE
The true
boolean value.
- undefine
Alias: Undefine
Undefine a variable. This includes locals and globals,
every value on all context levels is wiped. This function
should really not be used on local variables. A vector of
identifiers can also be passed to undefine several variables.
- UndefineAll
Undefine all unprotected global variables
(including functions and parameters). Normally Genius Mathematics Tool
considers protected variables as system defined functions
and variables. Note that UndefineAll
only removes the global definition of symbols not local ones,
so that it may be run from inside other functions safely.
- unprotect
Unprotect a variable from being modified.
- UserVariables
Return a vector of identifiers of
user defined (unprotected) global variables.
- wait
Waits a specified number of seconds. secs
must be non-negative. Zero is accepted and nothing happens in this case,
except possibly user interface events are processed.
- version
Returns the version of Genius as a horizontal 3-vector with
major version first, then minor version and finally the patch level.
- warranty
Gives the warranty information.