lua-users home
lua-l archive

Re: [ANN] Lua 5.2.0 (work1) now available

[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--

AltStyle によって変換されたページ (->オリジナル) /