Re: Socket library?

  • From: Mike Pall <mike-1210@xxxxxxxxxx>
  • To: luajit@xxxxxxxxxxxxx
  • Date: Thu, 4 Oct 2012 13:48:50 +0200

Enrico Tassi wrote:
> The Debian package does not activate 5.2 compatibility mode, but
> according to the comments in src/Makefile activating it should not break
> existing 5.1 code. It this not the case?

Maybe I should reword that, now that I've added so many Lua 5.2
features in the last days:

* The 5.2 features that are always enabled are pretty unlikely to
  break existing code. E.g. goto and labels are always enabled,
  since you can still use a variable named "goto" in Lua 5.1 mode.

* The features you enable with -DLUAJIT_ENABLE_LUA52COMPAT may
  break some existing code. E.g. os.execute() returns three
  results instead of a single number. And the first one is a
  boolean, so Lua 5.1 code like this will break with that build
  option turned on:
    if os.execute(cmd) == 0 then print("ok") end

Distros should certainly *not* enable the 5.2-compatibility mode
by default.

Note that the 5.2-compatibility features are independent of the
API/ABI. I've previously extended the API, but the ABI is still
upwards-compatible from Lua 5.1 even if you enable this option.
I.e. the LuaJIT shared library is still a drop-in replacement for
Lua 5.1.

[I have no plans to offer a 5.2-compatible API/ABI right now,
since there's little demand.]

--Mike

Other related posts: