Algosim documentation: CreateFunction

CreateFunction

Creates a function.

Syntax

Description

The CreateFunction function implements the operator used to create functions. Normally, this operator is used instead of the CreateFunction function. See the article for for details and examples.

However, there is one situation when CreateFunction might be useful in itself, and that is when you want to create a function that takes no arguments. To do this, the following syntax can be used:

CreateFunction(exprl(), expr)

Examples

f ≔ CreateFunction(exprl(), RandomInt(0, 100))
custom function
compute(f(), n, 1, 10)
47
15
15
95
29
6
86
6
26
87

See also