11.2. Basic

Compose
Compose (f,g)

Compose two functions and return a function that is the composition of f and g.

ComposePower
ComposePower (f,n,x)

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

GetCurrentModulo
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 (x)

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 interpretted as false.

IsBoolean
IsBoolean (arg)

Check if argument is a boolean (and not a number).

IsFunction
IsFunction (arg)

Check if argument is a function.

IsFunctionOrIdentifier
IsFunctionOrIdentifier (arg)

Check if argument is a function or an identifier.

IsFunctionRef
IsFunctionRef (arg)

Check if argument is a function reference. This includes variable references.

IsMatrix
IsMatrix (arg)

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
IsNull (arg)

Check if argument is a null.

IsString
IsString (arg)

Check if argument is a text string.

IsValue
IsValue (arg)

Check if argument is a number.

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
SetHelpAlias (id,alias)

Sets up a help alias.

chdir
chdir (dir)

Changes current directory, same as the cd.

display
display (str,expr)

Display a string and an expression with a colon to separate them.

error
error (str)

Prints a string to the error stream (onto the console).

exit
exit

Aliases: quit

Exits the program.

false
false

Aliases: False FALSE

The false boolean value.

manual
manual

Displays the user manual.

print
print (str)

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
printn (str)

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 (id)

Protect a variable from being modified. This is used on the internal GEL functions to avoid them being accidentally overridden.

set
set (id,val)

Set a global variable. The id can be either a string or a quoted identifier as follows. For example:

set(`x,1)
	    
will set the global variable x to the value 1.

string
string (s)

Make a string. This will make a string out of any argument.

true
true

Aliases: True TRUE

The true boolean value.

unprotect
unprotect (id)

Unprotect a variable from being modified.

wait
wait (secs)

Waits a specified number of seconds.

version
version

Returns the version of Genius as a horizontal 3-vector with major version first, then minor version and finally patchlevel.

warranty
warranty

Gives the warranty information.