[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: __tonumber metamethod (was Re: Exposure of nil to end-users)
- From: steve donovan <steve.j.donovan@...>
- Date: Fri, 6 Feb 2009 10:08:12 +0200
On Thu, Feb 5, 2009 at 5:13 PM, Doug Rogers
<doug.rogers@elbitsystems-us.com> wrote:
> Adding support for that kind of thing would have to be done in a way that
> resolves the ambiguities that will arise between them and the operator
> metamethods (perhaps by a precedence rule, reducing further the simplicity
Yes, C++ can do this kind of thing efficiently at compile-time, but
the conversion rules are not simple, and often lead to 'subtleties'
(as Stroustrop says delicately)
tonumber() is a well-defined place for using such a metamethod.
steve d.