-
-
Notifications
You must be signed in to change notification settings - Fork 360
Computus Common Lisp Implementation #724
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
Computus Common Lisp Implementation #724
Conversation
contents/computus/computus.md
Outdated
@@ -285,6 +285,18 @@ For now, we have the code outputting a tuple of $$d$$ and $$e$$, so users can us | |||
[import, lang:"python"](code/python/gauss_easter.py) | |||
{% sample lang="crystal" %} | |||
[import, lang:"crystal"](code/crystal/gauss_easter.cr) | |||
(defun computus (year &optional (servois nil)) |
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.
I think this was a copy and paste error.
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, question about whether or not you can do something in CL that I think would make this even better.
(e (mod (+ (* 2 b) (* 4 c) (* 6 d) n) 7))) | ||
;; historical corrections for April 26 and 25 | ||
(when (or (and (eql d 29) (eql e 6)) (and (eql d 28) (eql e 6) (> a 10))) | ||
(setf e -1)) |
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.
Is it possible to do the same thing as in the Rust implementation where you can use a conditional as an expression?
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.
It's a bit tricky to do that, because the value of e is necessary for the conditional. I could definitely do it, but I feel it wouldn't help much. The Rust implementation also has to calculate a temp_e to make it work out.
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.
Yep, not worth it then.
I'm very proud of this one. I took some time to clean it up right away and I'm happy with the result.