Skip to content

Conversation

@metafates
Copy link
Member

No description provided.

yuin and others added 30 commits January 3, 2023 00:15
Convert string math params to number instead of failing with error
In the C implementation of the Lua interpreter,
in the io.popen function the second argument can be nil:

Lua 5.1.5 Copyright (C) 1994-2012 Lua.org, PUC-Rio:

> x,y = io.popen("ls", nil)
> assert(x)
> assert(y == nil)
>

Gopher lua throws an exception:
bad argument #2 to popen (string expected, got nil)

Closes #459
popen: support nil in second argument
regstry.Set* were very simple functions at the beginning of the project,
but recently not.

It seems inlining these functions make improvements better.
GopherLua is a relatively old project. Old Go runtime had  slow interface
type assertions, but now Go runtime better its performance.
yuin and others added 14 commits December 6, 2023 04:13
Re-add link to relocated gluasocket library
$ lua
Lua 5.1.5  Copyright (C) 1994-2012 Lua.org, PUC-Rio
> file = "/tmp"
> fd, _, code = io.open(file, "r")
> _, _, ecode = fd:read(1)
> print(ecode)
21
>

gopher-lua throws an exception:
        read /tmp: is a directory
stack traceback:
        [G]: in function 'read'
        extra/wrapper.lua:17: in function 'exec'
        <string>:1: in main chunk
        [G]: ?

This patch results in behavior similar to the vanilla lua
implementation.

Closes #455
iolib: fix different behavior in read function
https://github.com/BixData/gluabit32 is a 404 now,
so implement a fresh bit32 for gopher-lua
fix README format error
fix compiler producing incorrect LOADNIL byte code
Remove io/ioutil usages (deprecated since Go 1.16)
fix: return value error for CompileLua example
Add github.com/PeerDB-io/gluabit32 to README.rst
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.