These are chat archives for evhub/coconut

27th
Jul 2018
yggdr
@yggdr
Jul 27 2018 15:21
@evhub Re the addpattern MatchError Bug from MR435: I've finally had a bit of time looking into this, but I ran into an interesting problem. You seem to purposefully allow multiple different functions build upon the same base function. See build/util.coco for the function empty_list_base_case, which two entirely different functions use to build upon using addpattern: qsort7 and qsort8. You basically treat pattern-matching functions not like a single function, where we dispatch to the concrete implementation depending on the arguments we pass to the function, but more like a nonlinear(!) class hierarchy. I'm not sure I'll be able to implement the bugfix in the way I proposed, but I'd have to do a bit more thinking to ensure I actually understand what happens in such a nonlinear case.
This behaviour of two different function using the same "base" function in addpattern needs documenting. I for one might even argue that it should be advised against, since it is not how these functions work in other languages like Elixir, where you have support for pattern matching in the language itself, unlike python.