lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


Apologies, but I don't think all screen-grabs are showing up

The code in lecture 7, for my 2nd question, reads:

function add(...)
local sum = 0
for _, n in ipairs ({ ... }) do
sum = sum + n
end
return sum
end
df = derivative(function (x) return x * x * x end)
print(df(5))

and gives the output

input:8: attempt to call a nil value (global 'derivative')

The 3rd question I asked just quotes that

Lua is an extensible extension language, focusing on multi-language development

Cheers,
Luke