Re: Does type/predicate dispatching belong to SRFI-253?
Artyom Bologov 22 Oct 2024 09:15 UTC
Hi Wolfgang,
>> Thus the question: does type dispatching belong to SRFI-253?
>
> In my opinion, no—I think it belongs in a pattern-matcher, or (as you
> suggest) in some sort of inheiritance-based system.
Yes, this reasoning was part of why I removed check-case macro
initially. But I'm indecisive—type dispatching is too close to type
checking.
> You could provide
> a simple ‘type-case’ form and its derivatives in SRFI 253, but its
> usefulness would be limited without the destructuring power of a full
> pattern-matcher. And that would be far outside the current scope.
And I'm okay with it being restricted—SRFI-253 is not about generality,
it's about a baseline for (relatively simple) type/correctness checks
across implementations. And simple type dispatching more or less fits
this picture.
> But maybe you have something other than a ‘type-case’ in mind?
No, it's indeed a simple type-case-like thing, with minor differences
dictated by predicate-based nature of SRFI-253.
Best of luck,
--
Artyom Bologov
https://aartaka.me