elena-lang icon indicating copy to clipboard operation
elena-lang copied to clipboard

unboxing duplicate object

Open arakov opened this issue 8 years ago • 3 comments

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

arakov avatar Jan 24 '17 08:01 arakov

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)
}

arakov avatar Sep 27 '17 10:09 arakov

done

arakov avatar May 01 '19 16:05 arakov

reopening

arakov avatar Aug 30 '19 18:08 arakov