Updated syntax for toclose

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Updated syntax for toclose

Dibyendu Majumdar
Reply | Threaded
Open this post in threaded view
|

Re: Updated syntax for toclose

Hisham
On Fri, 2 Aug 2019 at 16:41, Dibyendu Majumdar <[hidden email]> wrote:
>
> https://github.com/lua/lua/commit/0d529138042563baf260366e19a7aa2c60a07174

First impressions: I like it!

local function read_file_contents(filename)
   local f <close>, err = io.open(filename)
   if err then
      return nil, err
   end
   return f:read("*a")
end

(I know this email doesn't add much value, but all too often we as
users only ever give negative feeback to open source projects, so it's
good to also give positive feedback every now and then!)

Cheers,

-- Hisham