You're right; I forgot to account for subclassing.
If I switched off of pattern matching to pull out the closures and instead used Kernel.elem, it would work with tuples of varying length. Then you'd be able to write subclasses by replacing the closures with your own, and add additional items to the end to add more methods.
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
You're right; I forgot to account for subclassing.
If I switched off of pattern matching to pull out the closures and instead used
Kernel.elem
, it would work with tuples of varying length. Then you'd be able to write subclasses by replacing the closures with your own, and add additional items to the end to add more methods.