tail call and bounded space requirement Shiro Kawai (26 Oct 2022 20:22 UTC)
Re: tail call and bounded space requirement Marc Nieper-Wißkirchen (26 Oct 2022 20:48 UTC)
Re: tail call and bounded space requirement Shiro Kawai (26 Oct 2022 21:43 UTC)
Re: tail call and bounded space requirement Marc Nieper-Wißkirchen (27 Oct 2022 05:41 UTC)
Re: tail call and bounded space requirement Shiro Kawai (28 Oct 2022 20:55 UTC)
Re: tail call and bounded space requirement Marc Nieper-Wißkirchen (28 Oct 2022 21:02 UTC)
Re: tail call and bounded space requirement Shiro Kawai (28 Oct 2022 23:44 UTC)

Re: tail call and bounded space requirement Marc Nieper-Wißkirchen 28 Oct 2022 21:02 UTC

Am Fr., 28. Okt. 2022 um 22:55 Uhr schrieb Shiro Kawai <xxxxxx@gmail.com>:
>
> I assume the same applies to the parameterization, that is, the following should run in a constant space.  Correct?
>
> (define p (make-parameter 0))
> (let loop ()
>    (parameterize ((p 1))
>        (loop)))

Yes, this is the expectation (and a reason why parameterize possesses
a tail-context guarantee.  The idea is that a parameter is
conceptually the same as an implicit argument.  An a loop like

(let loop ((p 0))
  (loop 1))

also runs in bounded space.

I should check whether the sample implementation is correct in this regard.