Fix Sets "tuple" example because it's misleading#96
Open
EdgeCaseBerg wants to merge 2 commits intoscala-exercises:mainfrom
Open
Fix Sets "tuple" example because it's misleading#96EdgeCaseBerg wants to merge 2 commits intoscala-exercises:mainfrom
EdgeCaseBerg wants to merge 2 commits intoscala-exercises:mainfrom
Conversation
This example is incorrect. The statement ``` Set(1,2,3) - (1,2) ``` for example does not use a tuple at all, it's the same thing as this: ``` Set(1,2,3).-(1,2) ``` Which is calling the overloaded version of the `-` method of `Set` which accepts two initial arguments plus a varadiac list of however many elements you want which allows you to do things like ``` Set(1,2,3,4) - (1,2,3,4,5) // etc ``` No where in this are tuples ever actually used. And to say so (as it does currently) is misleading to programmers trying to use scala-exercises as a way of learning the standard library. If you DID try to use a tuple it would not work: ``` Set(1,2,3) - ((1,2)) //this will not compile ```
Contributor
|
@EdgeCaseBerg thanks for the clarifications. Can we keep the number of args in the exercise the same as before so already answered exercises remain correct for users that have already completed them? thanks! |
Author
|
Hey @raulraja |
@raulraja pointed out that it'd be a good idea to keep the number of arguments in the exercise I'm clarifying the same so that users who have already answered the exercise still see it marked as correct. So this commit removes the additional test meant to help hammer the point about varadiac arguments and sets the arguments to the test to be the same as before, and moves the note about varadiac-ness to the comment on the existing test itself.
Author
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This example is incorrect. The statement
(for example) does not use a tuple at all, it's the same thing as this:
Which is calling the overloaded version of the
-method ofSetwhichaccepts two initial arguments plus a varadiac list of however many
elements you want which allows you to do things like
No where in this are tuples ever actually used. And to say so (as it
does currently) is misleading to programmers trying to use
scala-exercises as a way of learning the standard library. If you DID
try to use a tuple it would not work:
because the types to not align.