[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: A change in io metatable
- From: nobody <nobody+lua-list@...>
- Date: Thu, 18 Jul 2019 04:51:01 +0200
On 18/07/2019 02.22, Sean Conner wrote:
I just noticed the following change:
Author: Roberto Ierusalimschy <firstname.lastname@example.org>
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 http://lua-users.org/lists/lua-l/2019-06/msg00605.html and followup
In short: __metatable can(/could) not protect the io metatable, as
io.stdin.__index is(/was) a different path to it.