lua-users home
lua-l archive

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


On 2010-01-14, David Burgess <dabsoft@gmail.com> wrote:
> I happen to agree with all that Mike has presented.
>  especially:
>
>  > There is no cost to have two explicitly named functions and it
>  > makes the intent immediately obvious:
>  >
>  >    bit.lshift(x, 8)  vs.  bit.rshift(x, 8)
>  >
>  > Readibility is important.
>

As someone who did bit-operations for living (chip design) I can
attest that having distinct names for left and right shifts *is*
important. C-language got it exactly right with its << and >>
operators. In Lua lshift and rshift would do just fine.

--Leo--