lua-users home
lua-l archive

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

On 18/07/2019 02.22, Sean Conner wrote:

   I just noticed the following change:

commit 924bed7297d5ea16a78ec07e7acc64afad951aa8
Author: Roberto Ierusalimschy <>
Date:   Mon Jul 1 12:25:00 2019 -0300

     Methods separated from metamethods in 'io'
In the 'io' library, changed the use of the metatable also as its
     own "method table", so that metamethods cannot be accessed as if they
     were methods. (For instance, 'io.stdin.__gc' does not result in
     the finalizer metamethod anymore.)

I'm just curious as to the rational for the change.

   -spc (But you can still get to them via getmetatable())

See and followup by Philipp.

In short: __metatable can(/could) not protect the io metatable, as io.stdin.__index is(/was) a different path to it.

-- nobody