[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: A metatable for nil?
- From: Gavin Wraith <gavin@...>
- Date: Fri, 13 Nov 2015 04:01:16 GMT
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 (firstname.lastname@example.org)
Home page: http://www.wra1th.plus.com/