Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upGitHub is where the world builds software
Millions of developers and companies build, ship, and maintain their software on GitHub — the largest and most advanced development platform in the world.
`plus` is not commutative #31
Comments
p-himik
commented
Apr 6, 2019
|
Should Currently the API follows the Java object model where the date/time always comes first when a period/duration is added/subtracted. In Java this happens naturally due to the placement of methods. In Clojure we can do as we like. However, date-times and durations are different types - it's not obvious that operations including both should be commutative. Maybe the |
To be honest, I didn't really give it much thought so I cannot answer your questions properly. It's very well possible that the current state of affairs is the best one. It was just not really intuitive for me (at first, I even started searching in a completely different direction), and I didn't find any previous discussions on the matter. |