4 ms·
It really depends on how you expect '+' to behave. When seeing '+', I immediately think of a semigroup operation. I would expect it to be associative but not n
by wz1000 11y ago
It really depends on how you expect '+' to behave.
When seeing '+', I immediately think of a semigroup operation. I would expect it to be associative but not necessarily commutative.
- monochromatic 11y agoIs it even associative? I don't use Ruby, but it seems like this might not even be defined: 5.days + 1.month
- IceyEC 11y ago> 5.days + 1.month => 1 month and 5 days
- monochromatic 11y agoWell, right... but "1 month and 5 days" isn't particularly well-defined on its own, unless you have some starting date that you're measuring from.
- IceyEC 11y agoAgreed, but technically it is defined.