mirror of
https://github.com/ProgramSnail/Lama.git
synced 2025-12-06 06:48:48 +00:00
local -> var; scope reformatted; singleton is killed finally
This commit is contained in:
parent
5ae88f820d
commit
216e716251
11067 changed files with 12168 additions and 12173 deletions
|
|
@ -4,13 +4,13 @@
|
|||
-- Deferred computations.
|
||||
|
||||
public fun makeLazy (f) {
|
||||
local value, set = false;
|
||||
var value, set = false;
|
||||
|
||||
fun () {
|
||||
if set
|
||||
then value
|
||||
else
|
||||
local c; -- need this temporary since in value := f () value would
|
||||
var c; -- need this temporary since in value := f () value would
|
||||
-- create an intermediate managed pointer
|
||||
set := true;
|
||||
c := f ();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue