[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: problems with setfallback
- From: jz@... (Jacob Zielinski)
- Date: Mon, 27 Sep 1999 19:43:55 -0700
Hello all,
This is a quiet list. I seem to be the only one having problems.
I have tried to implement a fallback in lua. Unfortunately it produces a
strange error: "lua error: call expression not a function" when calling the
setfallback function. So I assumed something was wrong with my code, but
when I use the example supplied in the lua manual (included below) I get the
same error message. This happens even if I use the precompiled lua.exe.
What is wrong here?
n=0 -- counter of temporary variables
T={} -- table of temporary variables
function arithfb(a,b,op)
local i=op .. "(" .. a.name .. "," .. b.name .. ")"
if T[i]==nil then -- expression not seen yet
n=n+1
T[i]=create("t"..n) -- save result in cache
print(T[i].name ..'='..i)
end
return T[i]
end
setfallback("arith", arithfb) -- *** set arithmetic fallback produces
error ***