This issue is a discussion for contributors to collaborate in getting ready to be featured in 48in24. Please refer to this forum topic for more info.
We will be featuring List Ops from Feb 20 onwards.
Staff jobs
These are things for Erik/Jeremy to do:
☐ Check/update exercise in Problem Specifications
Create + schedule video
Community jobs
For each track:
Implement List Ops
Add approaches (and an approaches introduction!) for each idiomatic or interesting/educational approach.
Add video walkthroughs (record yourself solving and digging deeper into the exercise).
Highlight up to 16 different featured exercises (coming soon)
Existing Approaches
You can use these as the basis for approaches on your own tracks. Feel free to copy/paste/reuse/rewrite/etc as you see fit! Maybe ask ChatGPT to translate to your programming language.
The Rust track has accumulate implemented, but not list-ops. Should I implement list-ops and deprecate accumulate? Given that accumulate was deprecated in favor of list-ops, I suppose it doesn’t make sense to have both.
Your choice basically. Some tracks have done that, but track maintainers have to decide for themselves whether it makes sense for their track. As an example, I’ve not deprecated accumulate in C# and F#, as it makes for a very focused exercise to help teach yield respectively recursion.
This is certainly an interesting exercise in bash. Functions in bash typically receive arguments by value, but arrays are harder to pass by value: you can stringify the array, but choosing a separator that doesn’t appear also in the data can be challenging. The array name can be passed to the function and some pretty horrific string manipulation can be done to make a copy of the array elements.
bash v4 introduced “namerefs” where you’d pass the array name to a function and in the function, that parameter is declared as a reference.
incr() { local -n var=$1; ((var++)); return; }
x=5
incr x
echo $x # => 6
This is kind of an esoteric concept to explain in a couple of minutes in a video, perhaps. I wanted to highlight bash for this exercise because it is the first one in bash where the solution is not a standalone script, but a library of functions. Apart from namerefs, the solutions are not particularly notable.