[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: creating and evaluating functions -- Lua 4.0 vs Lua 5.0
- From: Max Ischenko <max@...>
- Date: Wed, 18 Jun 2003 17:59:26 +0300
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.
That's exactly what I tried to achieve.
Thanks again for your quick and clarifying response.