Evaluation order of lambda-checked predicate expressions Wolfgang Corcoran-Mathe 24 Sep 2025 16:03 UTC

Hello,

SRFI 253 came up in discussion on the #scheme IRC channel today &
I observed that the SRFI makes no mention of the evaluation order of
predicate expressions in 'lambda-checked' & 'define-checked' forms.
The SRFI seems to allow something like

    (let ((b #f))
      ((lambda-checked ((x (begin (set! b #t) integer?))
                        (y (if b integer? real?)))
         (+ x y))
       1
       2.3))

but does not explicitly say whether the application will raise an
error. I'd like the SRFI to be emended to state that 'lambda-checked'
evaluates the 'predicates' (or, better, "predicate expressions") in
an unspecified order.

Evaluating components of a lambda's parameter list is a tricky
idea. While I think the above issue has an obvious fix, I worry that
lambda-checked may have other dark corners yet to be explored.

I regret not studying this during the SRFI's draft period.

Regards,

Wolfgang

--
Wolfgang Corcoran-Mathe  <xxxxxx@sigwinch.xyz>