diff --git a/experiments/fact/foo2.html b/experiments/gauss/foo2.html similarity index 100% rename from experiments/fact/foo2.html rename to experiments/gauss/foo2.html diff --git a/experiments/fact/foo2.js b/experiments/gauss/foo2.js similarity index 100% rename from experiments/fact/foo2.js rename to experiments/gauss/foo2.js diff --git a/experiments/fact/gauss.c b/experiments/gauss/gauss.c similarity index 100% rename from experiments/fact/gauss.c rename to experiments/gauss/gauss.c diff --git a/experiments/fact/foo.html b/experiments/gauss/gauss.html similarity index 67% rename from experiments/fact/foo.html rename to experiments/gauss/gauss.html index d8ebb69..70dc583 100644 --- a/experiments/fact/foo.html +++ b/experiments/gauss/gauss.html @@ -1,10 +1,10 @@ - diff --git a/experiments/fact/foo.js b/experiments/gauss/gauss.js similarity index 90% rename from experiments/fact/foo.js rename to experiments/gauss/gauss.js index a65c7bc..732ac77 100644 --- a/experiments/fact/foo.js +++ b/experiments/gauss/gauss.js @@ -130,9 +130,9 @@ var entry1=function(){ if(--MACHINE.callsBeforeTrampoline < 0) { throw entry1; } MACHINE.env=(MACHINE.proc.env); MACHINE.env=new ExtendedEnvironment(MACHINE.env, MACHINE.argl); -if (! (MACHINE.env).globalBindings.hasOwnProperty("fact-iter")) { throw new Error("Not bound: " + "fact-iter"); } -MACHINE.proc=((MACHINE.env).globalBindings["fact-iter"]); -MACHINE.val=1; +if (! (MACHINE.env).globalBindings.hasOwnProperty("gauss-iter")) { throw new Error("Not bound: " + "gauss-iter"); } +MACHINE.proc=((MACHINE.env).globalBindings["gauss-iter"]); +MACHINE.val=0; MACHINE.argl=[MACHINE.val, undefined]; MACHINE.val=(MACHINE.env).valss[0][0]; MACHINE.argl=[MACHINE.val,MACHINE.argl]; @@ -145,7 +145,7 @@ return MACHINE.val();}; var afterLambda2=function(){ if(--MACHINE.callsBeforeTrampoline < 0) { throw afterLambda2; } -(MACHINE.env).globalBindings["factorial"] = MACHINE.val; +(MACHINE.env).globalBindings["gauss"] = MACHINE.val; MACHINE.val="ok"; MACHINE.val=(new Closure(MACHINE.env, entry6)); return afterLambda7();}; @@ -181,13 +181,13 @@ return MACHINE.cont();}; var falseBranch9=function(){ if(--MACHINE.callsBeforeTrampoline < 0) { throw falseBranch9; } -if (! (MACHINE.env).globalBindings.hasOwnProperty("fact-iter")) { throw new Error("Not bound: " + "fact-iter"); } -MACHINE.proc=((MACHINE.env).globalBindings["fact-iter"]); +if (! (MACHINE.env).globalBindings.hasOwnProperty("gauss-iter")) { throw new Error("Not bound: " + "gauss-iter"); } +MACHINE.proc=((MACHINE.env).globalBindings["gauss-iter"]); MACHINE.stack.push(MACHINE.cont); MACHINE.stack.push(MACHINE.proc); MACHINE.stack.push(MACHINE.env); -if (! (MACHINE.env).globalBindings.hasOwnProperty("*")) { throw new Error("Not bound: " + "*"); } -MACHINE.proc=((MACHINE.env).globalBindings["*"]); +if (! (MACHINE.env).globalBindings.hasOwnProperty("+")) { throw new Error("Not bound: " + "+"); } +MACHINE.proc=((MACHINE.env).globalBindings["+"]); MACHINE.val=(MACHINE.env).valss[0][0]; MACHINE.argl=[MACHINE.val, undefined]; MACHINE.val=(MACHINE.env).valss[0][1]; @@ -235,7 +235,7 @@ return MACHINE.val();}; var afterLambda7=function(){ if(--MACHINE.callsBeforeTrampoline < 0) { throw afterLambda7; } -(MACHINE.env).globalBindings["fact-iter"] = MACHINE.val; +(MACHINE.env).globalBindings["gauss-iter"] = MACHINE.val; MACHINE.val="ok"; return MACHINE.cont();}; diff --git a/experiments/fact/gauss.rkt b/experiments/gauss/gauss.rkt similarity index 100% rename from experiments/fact/gauss.rkt rename to experiments/gauss/gauss.rkt