Nice little example of the usage of the Hare stdlib's date/time support, wrote up to answer a question on IRC

@drewdevault TIL date::reckon makes me wish more languages would have something like this.

@lanodan
The name was my idea, to "reckon through a chronology" as opposed to just a univariable timescale (date::add()). You "reckon" since sometimes you don't know where you'll land if at all, due to a timezone discrepancy or field overflow (something we're still working on).

In my research, most stdlibs unify it all into one "Add()" function, a verb which doesn't sufficiently hint at what is essentially a complex vector operation (<Y,M,D...> + <Y,M,D...>). Time will tell (heh) if we made a good design choice.

Also, nods to @vladh for helping with the implementation.

docs.harelang.org/time/date#re

Sign in to participate in the conversation
CleverLibre Social

CleverLibre Social is an inclusive social instance for open discussion, learning, and community.
All cultures welcome.
Hate speech and harassment strictly forbidden.