Re: [textadept] Textadept 5.0 alpha

From: Nils Nordman <n....at.nordman.org>
Date: Tue, 27 Dec 2011 22:00:36 +0100

Hi,

I've updated my things for 5.0, and everything looks good so far! I'll post
an update if I find anything amiss further down the road. The one
reflection I had so far concerns the option of using both Lua 5.2 and
LuaJIT, more specifically when it comes to modules with exclusive
environments. The wiki describes one way of upgrading modules, i.e. placing
all functions directly into the module table (M) and explicitly referring
functions using M.<func>. Personally I prefer to "sandbox" the modules
without global access, i.e. using:

module('_m.foo')

In lua 5.2, this would be achieved with:

local M = {}
local _ENV = M
[..]
return M

Which doesn't work in LuaJIT since it's not 100% 5.2 compatible even with
the compatibility options enabled. It's easy enough to support both, with
something like the following:

local M = {}
local _ENV = M
if setfenv then setfenv(1, _ENV) end -- LuaJIT support
[..]
return M

Personally I enjoy the option of using LuaJIT. Nonetheless, it's something
to be mindful of when writing modules if both Lua 5.2 and LuaJIT are to be
supported, and it's not unlikely that there are other cases as well where
one has to mind the differences.

Happy New Year!

Nils

On Wed, Dec 21, 2011 at 11:56 PM, mitchell <c....at.caladbolg.net> wrote:

> Hi,
>
> Textadept 5.0 alpha has been released from http://textadept.googlecode.**
> com <http://textadept.googlecode.com>
>
> THIS IS AN ALPHA RELEASE THAT BREAKS COMPATIBILITY WITH TEXTADEPT 4.x! It
> should be regarded as unstable and unsuitable for production environments.
>
> A migration guide from Textadept 4 to Textadept 5 is here:
> http://caladbolg.net/**textadeptwiki/index.php?n=**Main.Migrating5<http://caladbolg.net/textadeptwiki/index.php?n=Main.Migrating5>
>
> The previous list discussion may also be of some help:
> http://groups.google.com/**group/textadept/t/**2d4fe148104cb1be<http://groups.google.com/group/textadept/t/2d4fe148104cb1be>
>
> In the binaries you will find Textadept compiled against vanilla Lua 5.2
> as usual, but I have also included builds against LuaJIT. I don't know if
> this will be done in subsequent releases though. I did it primarily for
> folks wanting to test LuaJIT speed and/or its FFI library. For more
> information on the Lua configurations, please see the Scripting and
> Compiling pages of the manual in the release archive.
>
> Other than Scripting and Compiling manual pages, the Preferences page has
> also changed so please read that too for new info on ~/.textadept/init.lua.
> Please ignore the part about Lua 5.1 modules because I removed the
> compatibility from Lua 5.2.
>
> Lexer syntax has changed due to the removal of 'module' so please see the
> Lexer LuaDoc for updating your custom lexers. The Lua lexer has been
> updated to the 5.2 spec.
>
> There are no Textadept API changes from 4 to 5 so far, just changes to Lua
> itself.
>
> Bugfixes:
> * None.
>
> Changes:
> * Updated to Lua 5.2 (http://www.lua.org/manual/5.**2/<http://www.lua.org/manual/5.2/>
> ).
> * Textadept can be compiled with LuaJIT.
>
> Questions and comments welcome.
>
> Merry Christmas and a Happy New Year!
>
> mitchell
>
> --
> You received this message because you are subscribed to the Google Groups
> "textadept" group.
> To post to this group, send email to textadept.at.googlegroups.com.
> To unsubscribe from this group, send email to textadept+unsubscribe@**
> googlegroups.com <textadept%2Bunsubscribe.at.googlegroups.com>.
> For more options, visit this group at http://groups.google.com/**
> group/textadept?hl=en <http://groups.google.com/group/textadept?hl=en>.
>
>
Received on Tue 27 Dec 2011 - 16:00:36 EST

This archive was generated by hypermail 2.2.0 : Thu 08 Mar 2012 - 12:27:19 EST