-
Notifications
You must be signed in to change notification settings - Fork 84
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
Y2K problems in TIME breaking Macsyma build #1096
Comments
I'm seeing this as well - it's fallout from #1092, I think. The message is from TIME:VERIFY-DATE, called from TIME:PRINT-DATE which takes a time represented as a list including a date and weekday. It means that TIME:ON-WHAT-DAY-OF-THE-WEEK? thinks it's Friday, but the weekday passed in was (correctly) Thursday. We used to have this check disabled because the weekday calculation was wrong (#716). The idea behind #1092 was to fix the calculation and reinstate the check... |
I tried also with SIMS, but I got the same error... so it seems not emulator dependent. |
Ah, I think I see what's wrong - there's another Y2K problem in that bit of code!
It's returned the year as 22 = 18. Which STANDARDIZE-YEAR will convert to 1918, not 2018, and indeed 26th July 1918 was a Friday...
TIME:GET-TIME-LIST uses (STATUS DATE), which uses .RDATE (see SDATE in L; STATUS). Maybe we need a (STATUS YEAR) for this kind of thing? |
So doesn't this mean we had two bugs here -- and we were depending on both of them for "successful" builds? And when we fixed one (but not the other), we get the build failure? So what is the right thing to do here? There is little we can do with the return value of .RDATE, since it is limited to a sixbit word in YYMMDD format, preventing us from returning a 4-digit year. I assume callers of (STATUS DATE) are probably expecting a two-digit year and assuming a base of 1900. We could either add a new (STATUS NDATE) (or some other name) that returns a 4-digit year using a base of 2000 when calling .RDATE -- and then change all lisp callers of (STATUS DATE) to use (STATUS NDATE) with suitable changes to handle the 4-digit year. Or we could change (STATUS DATE) to do this -- an incompatible change (and change all callers to handle the 4-digit year). Or we could (maybe?) add a new ITS UUO (similar to .RDATE, but returning an integer time (epoch or similar) and then change (STATUS DATE) to call it. Of course, in any case, we'd have to change (STATUS DATE) to return a 4-digit year or add a new STATUS option (NDATE) if we were worried about unknown callers that couldn't deal with a 4-digit year. Thoughts? |
Actually, maybe if we update ITS to support returning 4-digit years, we should not add a new UUO, but add a new-style system call. |
Ahhh, the .RYEAR UUO returns the full year. So no need to change/update ITS. We just have to decide whether to change (STATUS DATE) to return a 4-digit year (by calling .RDATE and .RYEAR) or whether to add a new STATUS that returns the 4-digit year.
Where 3742o = 2018. |
I quite like the idea of making (STATUS DATE) return a 4-digit year, based on .RYEAR or .CALL /RQDATE/. A grep shows there are various places that use it, some of which add 1900 to get the year, some of which string-prepend "19", and some which assume it's year % 100 and print it directly. So we'd need to do trivial fixes to much of the code that uses it whatever we do, and returning the 4-digit date directly looks like it would simplify many of the users. |
I agree. I’ll update (status date) to return 4-digit year and fix callers. |
Something to keep in mind when importing Lisp programs in the future. |
@eswenson1 - I've had a quick try at this on the ats/lispyear branch. I'm doing a full build at the moment to see if it's broken anything else in the process... |
Gee, it looks a lot like my implementation! Looks good. Does it work? |
Hello,
I did in the morning a git pull, and I got a build timeout using KLH10:
What does it mean "Today is a Friday, not a Thursday." ? :-)
regards,
Fausto
The text was updated successfully, but these errors were encountered: