Skip to content

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

Merged
merged 3 commits into from
Jul 14, 2020

Conversation

Trashtalk217
Copy link
Contributor

I'm very proud of this one. I took some time to clean it up right away and I'm happy with the result.

@berquist berquist added the Implementation This provides an implementation for an algorithm. (Code and maybe md files are edited.) label Jul 4, 2020
@@ -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))
Copy link
Member

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.

Copy link
Member

@berquist berquist left a 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))
Copy link
Member

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?

Copy link
Contributor Author

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.

Copy link
Member

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.

@berquist berquist merged commit c6b76e1 into algorithm-archivists:master Jul 14, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Implementation This provides an implementation for an algorithm. (Code and maybe md files are edited.)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants