[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: Finding the version
- From: Edgar Toernig <froese@...>
- Date: Sat, 11 Aug 2001 17:14:27 +0200
Reuben Thomas wrote:
> Is there a way of finding the version of Lua one is running? The obvious way
> to overcome the bug (if that's what it is) in tinsert that I just pointed
> out is to write a wrapper:
> i.e. I could surround it with
> if _VERSION < 4.1 then
lua -e "print(_VERSION)"
--> Lua 4.0
So _VERSION is already there; it's set in the baselib.
> BTW, the tinsert bug appears to be present in 4.1alpha too.
IMHO the bug is the calling convetion on tinsert itself. The
does completely different this when foo returns 1 or 2 results.
I think, these collection of functions would be better:
tinsertat(table, pos, elements...) -- insert at pos
tinsert(table, elements...) -- insert at 1
tappend(table, elements...) -- append at -1