lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


I've been thinking of extending the meta model too. But I'm not sure I
want to pay the overhead of Lua fallback + stack call for a simple bit
or...

-----Original Message-----
From: lua-bounces@bazar2.conectiva.com.br
[mailto:lua-bounces@bazar2.conectiva.com.br] On Behalf Of Andy Stark
Sent: Monday, June 19, 2006 12:35 PM
To: Lua list
Subject: Re: Bitwsie operators in Lua

>Erik Hougaard wrote:
>> Numbers are floats/doubles ;-)
>
>
>Only in the out of the box configuration - it's an
 
>exceedingly minor 
>
>change to move over to integers.

Perhaps Lua should provide the traditional bitwise operators (~ & | <<
>>,
etc) and metamethods but just leave the metamethods unimplemented in the
core language. (I think in Lua 4.0 the exponentiation operator was
available in the language but was only implemented in the Math library.)
Anyone using integer arithmetic in their project could just provide the
code for these ops.

I think this is a natural extension of Lua's philosophy - provide tools
that let users implement their own language features rather than trying
to
support all use cases out of the box.

&.


########################################################################
#############
This e-mail message has been scanned for Viruses and Content and cleared

by NetIQ MailMarshal.
The Blackpool Sixth Form College.
########################################################################
#############