lua-users home
lua-l archive

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

On Thu, Jan 06, 2011 at 04:01:57PM +0200, Thomas Harning Jr. wrote:
> Perhaps the best way to work with versions is to do feature detection
> by the presence/non-presence of functions/variables.  The danger in
> this is if a function's "signature" or behavior changes, though it
> seems this has been rare for the core Lua functionality.

That is a good idea.  Why not carry it to its logical conclusion?
Don't even try to identify the Lua version, just check whether the
functions you need are present and behave in the expected way.  
That should not take more than one or two pcalls per function.