lua-users home
lua-l archive

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

On 27-Sep-06, at 4:15 PM, Wim Couwenberg wrote:

In that context, once the
decision is made to implement %, which I have no problems with, it
seems reasonable to me to implement the other half of that operation,
euclidean division.

Would it be terribly confusing if in fact // was a divmod operator? In pseudo code:

operator //(x, y)
    return math.floor(x/y), x%y

Their computations are often intertwined anyway, I suspect...

That works for me. You could read '//' as "split", making it logically extensible to: "a,b,c" // "," --> "a", "b,c"