-
Notifications
You must be signed in to change notification settings - Fork 323
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Define Enso epoch start as 15th October 1582. #3804
Conversation
f917a3f
to
854ce25
Compare
distribution/lib/Standard/Base/0.0.0-dev/src/Data/Time/Date.enso
Outdated
Show resolved
Hide resolved
0cd2cd4
to
c356d39
Compare
c356d39
to
3852867
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code looks good to me overall, although the tests need to be amended because currently they do not test stuff.
I also have a few suggestions how to make things a bit clearer (in my subjective opinion), however the current way is also mostly good. The only strong thing is the big workdays functions - I think in the current form it is hard to keep track if all codepaths correctly check for the epoch and I'd like that to be clear to avoid bugs.
One last thing - from the earlier discussions I was not sure if we want to return the dataflow error for these operations. My initial understanding was that we allow to return a result, but attach a dataflow warning to such an operation saying that the result cannot be trusted. This is a bit more permissive as the user can still use the operations, they are just warned that results may be wrong. It is a bit more dangerous as it's easier to remove the warnings though. I have no opinion on this, @jdunkerley what was the idea here? Do we want dataflow errors or warnings?
distribution/lib/Standard/Base/0.0.0-dev/src/Data/Time/Date.enso
Outdated
Show resolved
Hide resolved
distribution/lib/Standard/Base/0.0.0-dev/src/Data/Time/Date.enso
Outdated
Show resolved
Hide resolved
distribution/lib/Standard/Base/0.0.0-dev/src/Data/Time/Date.enso
Outdated
Show resolved
Hide resolved
distribution/lib/Standard/Base/0.0.0-dev/src/Data/Time/Date_Time.enso
Outdated
Show resolved
Hide resolved
distribution/lib/Standard/Base/0.0.0-dev/src/Data/Time/Date_Time.enso
Outdated
Show resolved
Hide resolved
The original idea was to use warnings. I will change the behavior so that the methods that fail with an exception in the underlying java methods will fail with an error, and all the other methods that now fail with error, will just attach a warning instead. So that, e.g., trying to get number of days for a |
Yes the suggestion was to return the values with a warning attached. This would allow the users to perform the computation but warn that the values are possibly wrong. |
d3bcd77
to
0a5500c
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM re engine changes
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good, but I think it would be good to wrap the warnings in some Atom instead of using raw texts. Plus a few very minor nitpicks.
distribution/lib/Standard/Base/0.0.0-dev/src/Data/Time/Date_Time.enso
Outdated
Show resolved
Hide resolved
distribution/lib/Standard/Base/0.0.0-dev/src/Data/Time/Date_Time.enso
Outdated
Show resolved
Hide resolved
distribution/lib/Standard/Base/0.0.0-dev/src/Data/Time/Date_Time.enso
Outdated
Show resolved
Hide resolved
distribution/lib/Standard/Base/0.0.0-dev/src/Data/Time/Date_Time.enso
Outdated
Show resolved
Hide resolved
Used by vscode Metals extension
0a5500c
to
8ba80ca
Compare
Pull Request Description
Define start of Enso epoch as 15th of October 1582 - start of the Gregorian calendar.
Important Notes
Date
andDate_Time
now produces a warning if the receiving Date/Date_Time is before the epoch start, e.g.,week_of_year
,is_leap_year
, etc.Checklist
Please include the following checklist in your PR:
Scala,
Java,
and
Rust
style guides.
./run ide build
and./run ide watch
.