lama_byterun/stdlib/Lazy.lama
Dmitry Boulytchev 61296c51e7 Massive renaming
2020-02-16 00:21:15 +03:00

14 lines
No EOL
183 B
Text

public fun makeLazy (f) {
local value, set = false;
fun () {
if set
then value
else set := true; value := f (); value
fi
}
}
public fun force (f) {
f ()
}