ruby icon indicating copy to clipboard operation
ruby copied to clipboard

Adding a keyword argument to Series

Open emcoding opened this issue 5 years ago • 5 comments

We don't have an early core exercise that introduces keyword arguments. In a discussion between @ Josh and @kotp it became clear that in the Series exercise, it's not per se clear that the passed in number is indicating a slice size or the number of slices that should be returned. Looks like a perfect candidate for a keyword argument to me!

@pgaspar @kotp What do you think? And is this (reasonably) doable?

emcoding avatar Jul 25 '19 20:07 emcoding

Current supporting information is the information in the readme which reads:

Given a string of digits, output all the contiguous substrings of length `n` in
that string in the order that they appear.

For example, the string "49142" has the following 3-digit series:

- "491"
- "914"
- "142"

And the following 4-digit series:

- "4914"
- "9142"

And if you ask for a 6-digit series from a 5-digit string, you deserve
whatever you get.

Note that these series are only required to occupy *adjacent positions*
in the input; the digits need not be *numerically consecutive*.

and the canonical data.

kotp avatar Jul 26 '19 00:07 kotp

Are we still accepting changes for this issue? (checking in relation to issue #935), and if so, would it be acceptable to add a test generator as part of the same commit (since the tests would have to be updated in either case)?

jbergenson avatar Aug 05 '19 20:08 jbergenson

@pgaspar Could you respond to the question about the test generator?

About the keywords: Yes to adding the keywords. With one caveat: there are some weird things with this exercise. I discovered that last week, so the exercise may change again shortly. I don't expect that it would affect the presence of keyword arguments though. Or would you prefer to wait for the next version? (The new issue should be up for discussion later this week. )

emcoding avatar Aug 05 '19 21:08 emcoding

@F3PiX @bergbergs I think adding a test generator makes sense - I'm not sure why it wasn't added before. Possibly because it's an old exercise.

pgaspar avatar Aug 05 '19 23:08 pgaspar

I am still interested in this issue/PR, but I think it makes sense to wait until the issue @F3PiX mentioned is posted, as I don't think it makes sense to release two substantive changes to the exercise in quick succession. I'll hold until then.

jbergenson avatar Aug 06 '19 15:08 jbergenson

I'd like to keep series as is, but I would welcome some new exercises that use keyword arguments as we will certainly implement a concept exercise for this, and will therefore want to unlock exercises that help practice it.

I'm going to go ahead and close this issue.

kytrinyx avatar Oct 13 '22 10:10 kytrinyx