On 08/06/2016 05:39 AM, Zoffix Znet via RT wrote:
Then the question remains why the multiplication results in Num if it
multiplies with an integer
It's merely a matter that such things require addition of three extra operators
per operation (e.g. Duration * Duration, Duration * Num, Num * Duration).
Custom operators were added for common operations, such as addition, but rarer
ones were omitted. For example, you can subtract two Instants,
since we commonly do {now - INIT now} but there's no operator to subtract an
Instant from an arbitrary number.
There's *, /, div, and mod just for basic math. If we count Duration and
Instant only that's 24 extra operators to write, debug, maintain, and most
importantly compile and load on program start.
Since in rarer use cases for which there isn't currently an operator the
programmer can simply coerce the value to anything they want, it makes sense to
not create custom operators for every imaginable case.
For those reasons, I'm rejecting this ticket.
Hi Zoffix,
I understand completely, thanks for looking into it.
Marcel