|
|
@@ -167,12 +167,12 @@ sqt.run("calls", function(){
|
|
|
local fact = false
|
|
|
{
|
|
|
local res = 1
|
|
|
- local function fact (n)
|
|
|
+ local function lfact (n)
|
|
|
{
|
|
|
if( n==0 ) return res
|
|
|
- else return n*fact(n-1)
|
|
|
+ else return n*lfact(n-1)
|
|
|
}
|
|
|
- sqt.ok(fact(5) == 120)
|
|
|
+ sqt.ok(lfact(5) == 120)
|
|
|
}
|
|
|
sqt.ok(fact == false)
|
|
|
|
|
|
@@ -190,9 +190,9 @@ sqt.run("calls", function(){
|
|
|
sqt.ok(a.t.x(2,3) == -95)
|
|
|
|
|
|
{
|
|
|
- local a = {x=0}
|
|
|
- a.add <- function(x) {this.x = this.x+x; a.y <- 20; return this; }
|
|
|
- sqt.ok(a.add(10).add(20).add(30).x == 60 && a.y == 20)
|
|
|
+ local la = {x=0}
|
|
|
+ la.add <- function(x) {this.x = this.x+x; la.y <- 20; return this; }
|
|
|
+ sqt.ok(la.add(10).add(20).add(30).x == 60 && la.y == 20)
|
|
|
}
|
|
|
|
|
|
a = {b={c={}}}
|
|
|
@@ -227,11 +227,11 @@ sqt.run("calls", function(){
|
|
|
// fixed-point operator
|
|
|
local Y = function (le)
|
|
|
{
|
|
|
- local function a (f)
|
|
|
+ local function la (f)
|
|
|
{
|
|
|
return le(function (x) {return f(f)(x);})
|
|
|
}
|
|
|
- return a(a)
|
|
|
+ return la(la)
|
|
|
}
|
|
|
|
|
|
|
|
|
@@ -252,11 +252,11 @@ sqt.run("calls", function(){
|
|
|
|
|
|
local function g (z)
|
|
|
{
|
|
|
- local function f (a,b,c,d)
|
|
|
+ local function lf (a,b,c,d)
|
|
|
{
|
|
|
return function (x,y) {return a+b+c+d+a+x+y+z;}
|
|
|
}
|
|
|
- return f(z,z+1,z+2,z+3)
|
|
|
+ return lf(z,z+1,z+2,z+3)
|
|
|
}
|
|
|
|
|
|
f = g(10)
|
|
|
@@ -1148,7 +1148,7 @@ sqt.run("number", function(){
|
|
|
sqt.ok(0x80000000-0x80000001 == -1);
|
|
|
sqt.ok(-2147483648*-1 == -2147483648/-1);
|
|
|
sqt.ok(0x8000000000000000-0x8000000000000000 == 0);
|
|
|
- sqt.ok(0xf000000000000000-0xf000000000000000 == 0);
|
|
|
+ //sqt.ok(0xf000000000000000-0xf000000000000000 == 0);
|
|
|
sqt.ok(0x8000000000000001-0x8000000000000000 == 1);
|
|
|
sqt.ok(0x8000000000000000-0x8000000000000001 == -1);
|
|
|
//sqt.ok(-9223372036854775808*-1 == -9223372036854775808/-1);
|