lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]



Gé Weijers <ge@weijers.org>

Attachments11:29 AM (1 hour ago)
to lua-l
Repeat post (the first one did not go through...)
The following program generates this error message:

lua: bug.lua:19: attempt to close non-closable variable 'database'
stack traceback:
        bug.lua:19: in main chunk
        [C]: in ?

The only variable that gets closed is a FILE* object, so that should be OK.

I've cut everything out of the program that I could.

The code (also attached to the email):

#!/usr/bin/env lua

local fn <const> = "test"


local MAJOR <const> = 1
local MINOR <const> = 1


local init = false
do
    --  determine file size
    local file <close> = assert(io.open(fn, "a+"))
    local size = assert(file:seek("end", 0))
    init = (size == 0)
end


local database = { MAJOR = MAJOR, MINOR = MINOR }


--  vim:ts=4 sts=4 sw=4 et:



--



On Fri, May 22, 2020 at 1:00 PM Jonathan Goble <jcgoble3@gmail.com> wrote:
On Fri, May 22, 2020, 3:28 PM Gé Weijers <ge@weijers.org> wrote:
Look at my first email in this thread. It has a sample Lua 5.4 program.

It seems to be missing. The first email begins with "BTW" on my end. 


--

Attachment: bug.lua
Description: Binary data