questions for `derive-check` Peter McGoron (29 May 2026 10:15 UTC)
Re: questions for `derive-check` Artyom Bologov (29 May 2026 12:33 UTC)
Re: questions for `derive-check` Peter McGoron (04 Jun 2026 13:05 UTC)

Re: questions for `derive-check` Artyom Bologov 29 May 2026 12:33 UTC

Hi Peter,

> 1. Is derive-check a macro or a procedure?

I assumed it was a procedure, because it accepts a quoted datum (like in
your example below.) I need to clarify that.

> 2. In what environment (the second argument to `eval`) would one
> evaluate the returned datum?

Oh. Right. When we talk about `eval` we need to also think of
the environment. I am tempted by two options:

a) Simply saying “current lexical environment” or “current dynamic
   environment.” But that’s a heavy burden on the implementation and
   huge under-specification.

b) Providing environment explicitly as an (optional?) second argument to
   `derive-check`.

Now I’m inclined to add a second argument to `derive-check` (b).

> 3. How do you expect `derive-check` would handle contextual
> information if it is passed a datum, like
>
>        (let ((x 0))
>          (derive-check '(+ x 10)))

It is passed as datum, and this question seems related to (2) for me. So
in case the current lexical environment is used (a,) it returns
'integer? or 'number? or '(check-eqv? 10). And in case of provided
environment (b)—it depends on the environment.

Did I understand you correctly?

Best of luck,
--
Artyom Bologov
https://aartaka.me