[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: A metatable for nil?
- From: Paul K <paul@...>
- Date: Fri, 13 Nov 2015 04:14:01 +0000
> There are no doubt good reasons, but why no metatable for nil?
There is, just need to use debug.setmetatable:
On Thu, Nov 12, 2015 at 8:01 PM, Gavin Wraith <firstname.lastname@example.org> wrote:
> There are no doubt good reasons, but why no metatable for
> nil? If you forget to require a library you will have
> lots of nil values being applied as functions or being indexed
> as tables. It would be nice to handle the resulting
> errors in a controlled way by assigning to
> (getmetatable ( )).__call and (getmetatable ( )).__index.
> I woke up in the middle of the night to send this query,
> so apologies if the brain is not firing on all cylinders.
> Gavin Wraith (email@example.com)
> Home page: http://www.wra1th.plus.com/