-
-
Notifications
You must be signed in to change notification settings - Fork 360
Add Euclidean GCD in Factor #425
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
Add Euclidean GCD in Factor #425
Conversation
Oh, nice. Looks like you got everything. We'll review the code soon. Thanks a bunch! |
@leios Not yet. I've still got a few more algorithms to implement! (In separate PRs, of course, I read the contributing guide) |
Oh, I meant that this PR seemed to update everything for the inclusion of Factor into the AAA. Good job! |
I call dibs on reviewing this one (and #426) if no one else wants it. Although I want to take my time and read a bit more about the language first. |
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.
Very cool! I'm glad I got to know this language a bit! I hope my review is relevant.
[ 2dup = ] | ||
[ | ||
! make sure the lower number is deeper | ||
2dup >= [ swap ] when ! a b -> G(reater) L(ess) |
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.
This line confused me so much until I remembered !
is the comment marker ^^
Could you align all the !
together to the right so that the comments are easier to parse?
Like this
! doing this
dup ! doing that
book.json
Outdated
}, | ||
{ | ||
"lang": "factor", | ||
"name": "Factor" |
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.
Things are misaligned here.
You could also change .editorconfig
to set the format for factor files.
@@ -41,6 +41,8 @@ The algorithm is a simple way to find the *greatest common divisor* (GCD) of two | |||
[import:13-24, lang="nim"](code/nim/euclid_algorithm.nim) | |||
{% sample lang="f90" %} | |||
[import:1-19, lang="fortran"](code/fortran/euclidean.f90) | |||
{% sample lang="factor" %} | |||
[import:1-10, lang="factor"](code/factor/euclid.factor) |
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.
Don't forget to update the lines if you modify the code.
The syntax is probably a little funky. Luckily, Factor has some pretty nice learning resources. Specifically, I'd recommend looking at Your First Program, and having a decent grounding in functional programming; a lot of the concepts are similar.
And of course, if you have questions, comment on the lines. I'll do my best to answer.