Re: SRFI 273: Extensions to Data (Type-)Checking
Artyom Bologov 19 May 2026 02:51 UTC
Hi Arthur, hi y’all,
I’ll be extremely happy to hear y’all’s feedback on this SRFI. Some
things that I’m mulling over:
• Is there maybe a better name for derive-check?
• Is there any need to derive type of data with derive-check or its
specialized sibling? Right now derive-check infers the return type of
the expression, and not type of the expression as data. I.e.:
(derive-check '(+ 1 2))
;; => number?
(derive-check-data '(+ 1 2))
;; => (check-pair-of? (check-eqv? '+) check-any?)
;; Or whatever
• Is adding new auxiliary syntax (check? and check-impl?) to
syntax-rules too much? I feel like this is too radical of a change and
there must be a better way to achieve type-guarded macros. One such
way would be syntax-case + derive-check, but there’s no counterpart
for syntax-rules that’d work as well.
• Should there be a generic check-collection-of? checking predicate, or
is that optimizing for the wrong thing?
• check-container-of? for boxes and the like?
• Should check-list-of? and check-vector-of? specify length? How do you
imagine the signature for these predicates?
• Is there a need for check-unspecified? predicate? It kind of is a type
too…
But these are just my own doubts and questions, yours might differ!
Best of love,
--
Artyom Bologov
https://aartaka.me