Algosim documentation: image

image

Returns the image of a given sequence of arguments under a specified function.

Syntax

Description

image(f, x1, ...) returns the image of x1, ... under f. That is,

image(f, x1, ...) = f(x1, ...).

Notes

The image function is implicitly used when functions are dynamically invoked via function objects in expressions. For instance, while sin(x) is parsed as sin applied to x, (sin)(x) is parsed as image applied to the function object sin and x. Also, all custom functions are invoked dynamically, so if f ≔ n ↦ n^2 + 1, then f(2) will be parsed as image applied to f and 2.

Examples

F ≔ '(RandomReal, RandomColor)
RandomReal
RandomColor
F @ image
0.215863296064
rgba(0.224, 0.023, 0.178, 1.000)
F @ (f ↦ f())
0.824463125551
rgba(0.035, 0.278, 0.275, 1.000)

See also