elena-lang
elena-lang copied to clipboard
unboxing duplicate object
If the same object boxed two times in the calling expression - the only one copy should be used.
This will allow to eliminate the race conditions between two copies of the same variable / field
Here the example:
import extensions;
import system'math;
public extension lazyOp
{
whileFalse(Func action)
{
until(self)
{
action()
}
}
}
public program()
{
var n := 1;
(lazy:n.sqr().mod:100 == 64).whileFalse({ n := n + 1 });
console.printLine(n)
}
done
reopening