Objectives for „List Ops„

Given that all requirements (maybe except for rfold, which would could be [op] @list.reverse) are Batteries-Included in Raku, I am wondering what the lesson learned from List Ops could be.

Maybe using Roles to extend a given Class (so functionality is added purely by „does RoleThatImplementsFeatureX“ during testing)?

Did anyone spend already some thoughts on this?

The idea is that the student gets a feel for how these fundamental operations can be implemented, and how they can build on each other.

I don’t know Raku, but @m-dango does so I’ll let them comment on this.

Here a simple proposal - focussing on implementing the requested ListOps without build-in features.

For the sake of easy testing the “OO requirements” are strong, forcing the learner to use a specific pattern.

Maybe this is a way to go in this exercise. Maybe it can be simplified to give some freedom on the underlying structures.

Would it be possible to put the class declarations into another file - like also other Languages use multiple files? Then the template for the learner would be easy to digest.