[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: boolean operators
- From: Glenn Maynard <glenn@...>
- Date: Wed, 27 Sep 2006 14:14:22 -0400
On Wed, Sep 27, 2006 at 10:52:35AM -0500, Rici Lake wrote:
> Clarity of expression, really. I personally could live without bitwise
> operators, or table append syntax.
>
> Now, it's true that you can define a // b as math.floor(a / b), but then
> you could define a % b as a - b * math.floor(a / b), but I'd argue that
> in both cases, the operator is a clearer statement of intent.
I'd define a // b and a % b as math.idiv(a, b) and math.irem(a, b). If
the former are clearer, I think the difference is marginal. It seems
a small difference for the cost of complicating the core language.
(I think one of Lua's virtues is not stuffing too much into its core,
so adding operators feels like a big cost.)
--
Glenn Maynard