Re: SRFI 282: Missing R7RS (Type) Predicates Peter McGoron 16 Sep 2026 14:48 UTC

I agree with the others re library? and syntax-transformer?.

It would be interesting to see a first-class library SRFI that
integrates with implementations with them (STKlos, MIT-Scheme I think,
Guile I think), although that would be a big effort.

I have posted about the usefulness and ease of implementation of
parameter? in this thread.

I also think environment? is a good predicate. I tested Chez (rnrs
eval), Sagittarius, Guile, Gauche, MIT-Scheme, CHICKEN 6, and Chibi, and
they all have some sort of opaque object named "module," "library," or
"environment" as the returned value of (environment '(scheme base)) (or
equivalently (environment '(rnrs))). If these implementations implement
some sort of error check prior to evaluating the environment, then
environment? can expose that error check.

I think the SRFI should be split into (srfi 282 parameter) and (srfi 282
environment), each exporting the appropriate procedure. Each is
optional, and the user can check if one is supported using

     (cond-expand
       ((library (srfi 282 parameter)) ...)
       (else ...))

If one is supplied, then (predicate? x) being true means that the "it is
an error" behavior doesn't occur.

-- Peter McGoron