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

list-ops: Update instructions append #710

Merged
merged 8 commits into from
Jan 5, 2025
46 changes: 27 additions & 19 deletions exercises/practice/list-ops/.docs/instructions.append.md
Original file line number Diff line number Diff line change
@@ -1,19 +1,27 @@
# Instructions append

## Appendix

The instructions are synced with a shared repository to ensure consistency across all language tracks.
For this exercise in the Clojure track, assume both the input and output are vectors.
As a stretch goal, consider how you could implement the solution without using lists anywhere in your code.
Also, think about the efficiency of your program.

It is important not to reuse existing Clojure built-in functions with similar functionality, as doing so would diminish the intended learning value of the exercise.
Key functions from the **clojure.core** namespace to avoid include `into`, `concat`, `cat`, `lazy-cat`, `mapcat`, `flatten`, `filter`, `filterv`, `remove`, `count`, `map`, `mapv`, `reduce`, `transduce`, `reverse`, and `rseq`.

### Optional goals

Try to pass the tests by devising a solution that assumes both the input and output are lists instead of vectors.
The test suite does not need to be modified.
This time, consider how you could implement the solution without using vectors anywhere in your code.

If you decide to publish this solution, be sure to include a comment indicating that it addresses the optional goal of using lists. Don't forget to update the docstrings!
# Instructions append

## Appendix

**Note**: The above instructions are synced with a shared repository to ensure consistency across all language tracks.
Any instructions listed in this appendix override the ones above.

For this exercise in the Clojure track, assume both the input and output are vectors.
As a stretch goal, consider how you could implement the solution without using lists anywhere in your code.
Also, think about the efficiency of your program.

It is important not to reuse existing Clojure built-in functions with similar functionality, as doing so would diminish the intended learning value of the exercise.
Key functions from the **clojure.core** namespace to avoid include `into`, `concat`, `cat`, `lazy-cat`, `mapcat`, `flatten`, `filter`, `filterv`, `remove`, `count`, `map`, `mapv`, `reduce`, `transduce`, `reverse`, and `rseq`.

### Optional goals

Try to pass the tests by devising a solution that assumes:

- both the input and output are lists instead of vectors
- the test suite isn't modified

Copy link
Member

Choose a reason for hiding this comment

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

The test suite is not modified is a standard of Exercism. Should we need to mention that here?

Copy link
Member Author

Choose a reason for hiding this comment

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

I'm afraid I don't have any other option. The tests are already using vectors as input, and in the first bullet, I ask to assume that they are using lists. Without the second bullet, some folks might be confused, while others might believe that the only way the first assumption can be true is by downloading the exercise and manually changing the tests to use lists, which is definitely not intended. Both bullets are necessary to clarify what I’m explaining in line 22:

These assumptions directly influence the types of the functions that can be used.

This is an optional and slightly more challenging goal. I'm explicitly mentioning more than I usually would to make it a bit clearer how they should approach it without going off on tangents. Still, it assumes a certain level of maturity from the reader, and it's meant only for those who want extra practice.

In any case, the reason I marked this as a draft is to let it sit here while I think about whether I can find an alternative way to phrase the optional goal, or even remove it altogether.

Copy link
Member

@kotp kotp Nov 25, 2024

Choose a reason for hiding this comment

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

We could state: as usual, the tests are not meant to be modified, since it is a confirmation that this is not different than other exercises, in this regard.

Otherwise, if I saw this fairly soon after coming to Exercism, it would likely encourage me to change other exercise test files, which is also not intended.

Copy link
Member Author

Choose a reason for hiding this comment

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

Sounds reasonable. I'll see how I can rephrase the assumptions. Thanks!

These assumptions directly influence the types of the functions that can be used.

As a stretch goal, consider how you could implement the solution without using vectors anywhere in your code.

If you decide to publish this solution, be sure to include a comment indicating that it addresses the optional goal of using lists.
Don't forget to update the docstrings!
Loading
Oops, something went wrong.