fuzion-lang.dev — The Fuzion Language Portal
JavaScript seems to be disabled. Functionality is limited.

const

memoize.const

For memoization of constant values that do not depend on any input, this
uses the global constant memoization effect to keep that value

Use this as follows: Say you have an expensive function like this that
approximates pi:


You can memoize the result as follows


Then, repeated calls to `pi` will result in returning the pre-calculated value.

Effects analysis of this code will show that it uses

memoized_constant_effect pi f64

Type Parameters

V:Any[src]

Arguments

f Function V[src]
the function to calculate the result
0.099dev (GIT hash e2d5298d8107bb5fe79600fdb06a49bc75756344)
last changed: 2026-11-23