We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Execution: OK
function fact(n) if n <= 1 then return 1 else return n * fact(n-1) end end print(fact(5)) -- 120
Execution: KO! (The only difference is that function is local) Error message: Interpretation error: Typing error: attempt to call a non function value
local
Interpretation error: Typing error: attempt to call a non function value
local function fact(n) if n <= 1 then return 1 else return n * fact(n-1) end end print(fact(5))
The problem seems to come from the scope analysis
local v2 = function (v0) if v0<=1 then return 1 else return v0*v1(v0-1) end end
local v2 instead of local v1
local v2
local v1
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Execution: OK
Execution: KO! (The only difference is that function is
local
)Error message:
Interpretation error: Typing error: attempt to call a non function value
The problem seems to come from the scope analysis
local v2
instead oflocal v1
The text was updated successfully, but these errors were encountered: