Call the function.
Call the function.
Create a cached version of this function.
Create a cached version of this function.
Note that the {x: Datum => f(x)} cached
syntax is more human-readable.
Note that this function commutes with named
(they can be applied in either order).
Example:
val f = cache {x: Double => complexFunction(x)} f(3.14) // computes the function f(3.14) // re-uses the old value f(4.56) // computes the function again at a new point
Tracks whether this function has a cache to ensure that a function doesn't get double-cached.
Tracks whether this function has a cache to ensure that a function doesn't get double-cached.
Tracks whether this function has a name to raise an error if it gets named again.
Tracks whether this function has a name to raise an error if it gets named again.
Optional name for the function; added to JSON for bookkeeping if present.
Optional name for the function; added to JSON for bookkeeping if present.
Create a named version of this function.
Create a named version of this function.
Note that the {x: Datum => f(x)} named "something"
syntax is more human-readable.
Note that this function commutes with cached
(they can be applied in either order).