lua-users home
lua-l archive

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


On 14.11.2012, at 8.54, Petri Häkkinen wrote:

>> This definition screams for the symbol `/%`.
>> 
>>> q, r = 42 /% 10  --> 4,2
>> 
>> Dirk
>> 
> 
> Indeed. But /% looks like some sort of escape sequence, I would perhaps go with %%.

Oh, I think I got Dirk's idea the wrong way. I thought you were suggesting /% to be the modulo operator.

What I meant was: I would prefer separate operators // and %% (integer division and modulo) over /%. The reason: there are no combined operators +-, */, <> etc. either…. you get the idea  ;-)

On 14.11.2012, at 15.37, Roberto Ierusalimschy wrote:

>> May I ask what is the opinion of Roberto regarding these new operators?
> 
> I think we always stated that the main problem with bitwise operators
> in Lua was that they do not have a "natural" interpretation over Lua
> numbers. If Lua gets integers, this problem is gone.

That's what I thought. Thanks!

Petri