[ZeroBrane Studio] Re: Using Lua 5.2 (on Windows 7)

  • From: "Chris Liles" <chris.liles@xxxxxxxxxxxxxxxxxx>
  • To: <zerobrane@xxxxxxxxxxxxx>
  • Date: Tue, 8 Jan 2013 19:46:33 +1100

Many thanks Paul

I'll check all that out as soon as I get a chance.

Thanks again
Chris

-----Original Message-----
From: zerobrane-bounce@xxxxxxxxxxxxx [mailto:zerobrane-bounce@xxxxxxxxxxxxx]
On Behalf Of Paul K
Sent: Tuesday, 8 January 2013 5:09 AM
To: zerobrane@xxxxxxxxxxxxx
Subject: [ZeroBrane Studio] Re: Using Lua 5.2 (on Windows 7)

Hi Chris,

> I'd like to use Zbs with Lua 5.2 - I see there is a small note about 
> this in the FAQ, but  Zbs doesn't compile 5.2 constructs like bit32... 
> (even though it does recognise them in the source), Zbs has Lua 5.1 in 
> its \bin directory etc, so is there some procedure required to make it use
5.2?

You are right; there is more to be than is described in the FAQ. The answer
was meant for the case when you run your Lua 5.2 scripts outside of ZBS, but
want to debug them using MobDebug and ZBS.

It is now possible to debug these scripts in ZBS too (although you'd need to
get the latest code from the git repository until 0.35 version is out). All
you need to do is to specify that you want to use some other lua interpreter
by using `path.lua` configuration setting as in
"path.lua=[[D:\lua-5.2.1\lua.exe]]"; you can add this to your cfg/user.lua
file. Note that this also requires luasocket library compiled for Lua 5.2
and available in the same location where your Lua
5.2 interpreter is (as it won't work with the luasocket version that ships
with ZBS). I'll update the FAQ to reflect the changes; you don't need to do
anything with getfenv and setfenv as this has been incorporated into the
debugger.

As to bit32 support, I don't expect it to generate a compilation error (can
you provide an example?), but if it does, you can disable compilation before
running your project. Create a copy of interpreters/luadeb.lua (for example,
copy it to luadeb52.lua and change the "name" inside to "Lua 5.2". Then add
"skipcompile = true,"
as one of the parameters (look at gsl-shell.lua for example). This will
disable implicit compilation before running/debugging your project.

Paul.

On Sun, Jan 6, 2013 at 12:58 AM, Chris Liles
<chris.liles@xxxxxxxxxxxxxxxxxx> wrote:
> I'm a newcomer to both Lua and Zerobrane studio, so pardon me if this 
> is an obvious question.
>
> I'd like to use Zbs with Lua 5.2 - I see there is a small note about 
> this in the FAQ, but  Zbs doesn't compile 5.2 constructs like bit32... 
> (even though it does recognise them in the source), Zbs has Lua 5.1 in 
> its \bin directory etc, so is there some procedure required to make it use
5.2?
>
> Regards
> Chris Liles
> Canberra, Australia
>
>


Other related posts: