lua-users home
lua-l archive

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


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/