lua-users home
lua-l archive

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

Hello Doug,

Tuesday, June 22, 2004, 9:37:22 AM, you wrote:

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

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

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

I had this exact sample problem with my BASIC compiler. AND and OR
were both logical, and coming up with solutions for bitwise operations
was a little hairy.

The best solution was to use NAND NOR XOR SL and SR for those simple
operations. For one's compliment I was able to use ~, but I agree,
that shouldn't be used here. Likewise, I don't think C operators
should be used either, as Lua seems to lean more towards BASIC in this
area than C (and IMHO, the language should stay true to itself).

Best regards,