Skip to content

Change leap to stateless (issue #353) #354

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 1 commit into from
May 6, 2017

Conversation

divagant-martian
Copy link

No description provided.


private def divisibleBy(i: Int) = year % i == 0
private def divisibleBy(year: Int, i: Int) = year % i == 0
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You could consider to have this as a nested function inside isLeap so that you can omit the year parameter again.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nice, done

@@ -0,0 +1,3 @@
object Year {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Now this touches an interesting subject:
Some time ago we decided in issue #137 to have such a file with the expected functions for the first 10 exercises.

leap was originally not among those, but now after the reordering according to difficulty it is.
So I think to add this file is just fine. Am I right, @ricemery @ErikSchierboom ? Maybe we should also review the other affected exercises under this aspect?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@abo64 As far as I can recall: yes, you are right. I think reviewing the other exercises makes sense.

@divagant-martian
Copy link
Author

well I know this is a tiny change, but there is anything else to be done in the pr? does this closses issue #353 ? (I think it suggests new issues but any way)

@abo64
Copy link
Contributor

abo64 commented May 6, 2017

Thank you @zombiefungus

@abo64 abo64 merged commit 08ef3a5 into exercism:master May 6, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants