lua-users home
lua-l archive

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



On Nov 19, 2010, at 16:28, Petite Abeille <petite_abeille@mac.com> wrote:

> 
> On Nov 19, 2010, at 10:22 PM, Patrick Rapin wrote:
> 
>> Maybe bit32._and, bit32._or would be better looking ?
> 
> well, at that point you could as well call then 'and' and 'or' :P
> 
> bit32['and']
> bit32['or']
> 
> If the brackets are a bother, make bit32 a function, so you can use a bit of sugar:
> 
> bit32'or'
> 
> But anyway, in practice, are you not going to alias these functions in the first place?

Exactly. I don't see a problem with providing 'and' and 'or' with some possible aliases in the bit32 library to support dot syntax. Beyond that, it's trivial to wrap the library up to provide something else ... even simple DSLs for bit operations that would never belong in bit32.