|
On 9/28/06, Glenn Maynard <glenn@zewt.org> wrote:
On Wed, Sep 27, 2006 at 10:50:27PM -0500, Rici Lake wrote: > It is sometimes useful to do integer arithemetic; a useful subset of > Lua numbers are integers. A number of interesting algorithms involve > integer arithmetic. Integers are bit masks; bit masks are as much fundamental types in Lua as integers, by this logic.
This argument ignores the fact that Lua does indeed treat integers specially. This even goes beyond implementation details. One user-visible way is that the semantics of operator # are defined based on integers. So we've got operator # that relies on integers, operator % with is particularly well suited to dealing with integers. Certainly it's a reasonable assertion that integers have a role to play in Lua, and I propose it's not wildly out-of-line to request an operator that is the natural compliment to %. Greg F