lua-users home
lua-l archive

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


The Power Patch I posted yesterday, bitwise-ops-hex.patch, adds '&', '|', and 
'#' as operators. I'm soliciting ideas for the operators.

There are a handful of reasons not to choose '#'. It's a comment characters in 
some languages (maybe even Lua if '-#' '#-' is adopted!). It's also often 
used for hexadecimal.

I think that those reasons aren't very strong. I like the look of '#' for both 
unary negation and exclusive or. Other options, such as '~' and '!' have 
their own problems. '~' is more associated with logical negation in Lua. '!' 
can often look like like '|' on a computer screen, plus it carries with it 
the logical negation meaning in C/C++.

I may also be adding shift operators, so I'm looking for good operators/tokens 
for each of these. Putting them all in a some sort of system may be 
beneficial, too. Say, '<&>', '<|>', etc. Or double up all the operators to 
make them stand out: '&&', '||', '##', '<<', '>>'.

Another option might be letter-based tokens: 'band', 'bor', 'bxor', 'bnot', 
'bshl', 'bshr'. I'm starting to lean towards that.

Any suggestions are welcome. Please reply here or to me personally with your 
favorites.

Doug

-- 
--__-__-____------_--_-_-_-___-___-____-_--_-___--____
Doug Rogers - ICI - V:703.893.2007x220 www.innocon.com
-_-_--_------____-_-_-___-_--___-_-___-_-_---_--_-__-_