Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
|
|
@ -0,0 +1,8 @@
|
|||
fcn evalWithX(text,x) {
|
||||
f:=Compiler.Compiler.compileText(text);
|
||||
f.x = x; // set free var in compiled blob
|
||||
f.__constructor(); // run blob
|
||||
vm.regX // compiler sets the VMs X register for cases like this
|
||||
}
|
||||
const TEXT="var x; x*2"; // variables need to be declared
|
||||
evalWithX(TEXT,5) - evalWithX(TEXT,3) #--> 4
|
||||
|
|
@ -0,0 +1,2 @@
|
|||
var klass=Compiler.Compiler.compileText("var x; returnClass(x*2)");
|
||||
(klass.__constructor(klass.x=5) - klass.__constructor(klass.x=3)).println();
|
||||
Loading…
Add table
Add a link
Reference in a new issue