-
-
Notifications
You must be signed in to change notification settings - Fork 546
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
ETL: input elements define function parameter count #1536
Conversation
Hi @ErikSchierboom, I used CSharp as an example which I understand you are involved with. I'm curious if if/how your generator inferred the input data was for a function taking a single dictionary rather than a function taking several parameters. |
Good question. There is nothing in the canonical data itself that encodes this, which is why there is special handling in this exercise's generator: https://github.com/exercism/csharp/blob/ed87d8c9818ea46a7db7856cc9a294ef6a2a10ae/generators/Exercises/Generators/Etl.cs#L26 Note: there are a few occasions that need special handling, and dictionary-related exercises are one of them. |
Oh and by the way, I agree that one input parameter should be defined for the combination of data. 👍 |
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.
LGTM! Just one thing: the version number needs to be bumped.
AH yes, the version CI checks are working well. thx @ErikSchierboom |
Yep! |
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.
Awesome work!
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.
LGTM too! Thanks for adding clarity.
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.
🚀 🚀 🚀
It seems that only a version bump is necessary. Latest changes to this problem: - exercism/problem-specifications#1536 - exercism/problem-specifications#1575
It seems that only a version bump is necessary. Latest changes to this problem: - 1.0.0 to 1.0.1, descriptions too long: exercism/problem-specifications#1526 - 1.0.1 to 2.0.0, change input JSON format: exercism/problem-specifications#1536 - 2.0.0 to 2.0.1, capitalize Scrabble: exercism/problem-specifications#1575
This supersedes stale PR #1485. (It was easier to redo off HEAD than resolve conflict there)
Background - In practical terms for test generation, the the number of "input" elements is the number of parameters of the function-under-test. Considering the following as an example which specifies a function with three parameters as input...
all-your-base Canonical-data
This is reflected by several language implementations:
all-your-base CSharp
all-your-base Ruby
all-your-base ObjectiveC
By that pattern, the following...
etl canonical-data
...would imply two separate functions, one with two parameters and another with seven parameters.
But actually "1","2","3","4","8","10" are part of the data, not part of the function definition.
The example language implementations correctly inferred the intent was to call a single-parameter function...
etl CSharp
etl Ruby
etl ObjectiveC
It is better to be explicit that the transform function takes a single parameter of a legacy data map.
Thus the following canonical-data is proposed...