Open Entze opened 2 weeks ago
Hi Lukas,
thanks for the suggestion. I like your idea and I can see use cases for your suggestions. However, dateutils operates in a very limited range of dates (starting 1601-01-01 and ending 4095-12-31). If I were to implement your idea of being allowed to skip LAST, it would still cut off at the maximum date. There's only so much you can pack in a 64bit integer.
Reading beyond what you said, it appears you want some tool to do date algebra. dateseq
is just a quick way of getting the set of all dates. I've been thinking about this, too. But I'm too incompetent to figure out the language design. I usually end up using Prolog to "solve" date algebra problems.
Proposal: Extend
dateseq
to also generate a sequence of infinite dates, similar to theyes
program which outputs a given string until interrupted.For example:
This would output all weekdays in 1970 that are not the first of November. Which is already supported.
Additionally, the program should support more complex date filtering, where the
LAST
date is not known in advance. In this case, the program should continue outputting dates until a filtering condition is met, without requiring the user to know the final date in advance. For example:This would output the first date that passes the filter condition (or loop indefinitely), without needing to specify a
LAST
date.Please let me know if you have any other questions or need further clarification.