lua-users home
lua-l archive

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


David Jones wrote:

> > function compile(spec)
> > 	local funcBody = string.format('return function() return %s end', spec)
> > 	return loadstring(funcBody)
> > end
> > Why I this? Did I write compile function wrong?

> Presumably you were using dostring in Lua 4.0 and are now using
> loadstring in Lua 5.0?  Although the manual deprecates dostring in
> favour of loadstring they do not have identical behaviour.

[ explanation skipped ]

> Hope that helps.

Yes, thanks!
That's exactly what I tried to achieve.

Thanks again for your quick and clarifying response.



-- 
Regards, max.