Skip to content
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

strain: Add parameters to exercise placeholder #642 #698

Merged
merged 2 commits into from
Nov 7, 2017

Conversation

jnaulty
Copy link
Contributor

@jnaulty jnaulty commented Oct 4, 2017

Fixes #642

@jnaulty jnaulty force-pushed the strain-param branch 2 times, most recently from f7ab5d0 to bec8005 Compare October 4, 2017 06:48
@@ -1,6 +1,6 @@
def keep():
def keep(sequence, predicate):
Copy link
Contributor

@ilya-khadykin ilya-khadykin Oct 4, 2017

Choose a reason for hiding this comment

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

I like your variant, it's a good one.
But I think not everyone knows a concept of predicate. Maybe it's better to change it to lambda_expression?

The other option is to add hint for the exercise explaining a concept of predicate (preferable)

What are your thoughts on this?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Well, It seems from the problem statement that a predicate is requried. I don't really think it's necessary for the predicate to be a lambda function, it just has to be any function that takes the item from the list and returns a boolean.

I agree that a hint would be better, I found this little snippet from wikipedia:

a predicate P(x) will be true or false, depending on whether x belongs to a set.

https://en.wikipedia.org/wiki/Predicate_(mathematical_logic)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ahh, perhaps just add the predicate definition in the README.md?

Copy link
Contributor

@ilya-khadykin ilya-khadykin Oct 7, 2017

Choose a reason for hiding this comment

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

I am not sure actually, since there is an ability to generate these doc files from special templates. It helps staying in sync with https://github.com/exercism/problem-specifications/ and stuff like that.

Looks like this track uses old approach and I'll have to do a bit of research on what is the best way to add hints to exercises and come back to you. Is it Ok?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

ya, when I get some more time I can take a look too.

@ilya-khadykin
Copy link
Contributor

@jnaulty sorry for the late reply.

Following our previous conversation, will it be possible to put hints in .meta/hint.md?

We use configlet to generate README.md files for exercises.

@ilya-khadykin ilya-khadykin merged commit 4f083db into exercism:master Nov 7, 2017
@ilya-khadykin
Copy link
Contributor

@jnaulty I've merged your PR, thanks for your help!

I'll revisit our process of generating READMEs soon (hopefully) and move your definition you predicate in 'hints' section

@jnaulty
Copy link
Contributor Author

jnaulty commented Nov 8, 2017

thanks @m-a-ge

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.

2 participants