[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: [ANN] Lua 5.4.0 (alpha-rc1) now available
- From: Gavin Wraith <gavin@...>
- Date: Fri, 31 May 2019 10:55:15 +0100
In message <[email protected]>
Ryan Ford <[email protected]> wrote:
> But maybe we can agree that the syntax feels "foreign" to the existing syntax.
Surely that is only because we are not used to it. I certainly think
function (myfile)
local <toclose> f = io.open (myfile, "r")
return f:read "*all"
end
is snappier than
function (myfile)
local f = io.open (myfile, "r")
local s = f:read "*all"
f:close ( )
return s
end
The __close event seems to me a logical extension of Lua's reflexive
capabilities.
--
Gavin Wraith ([email protected])
Home page: http://www.wra1th.plus.com/