Suggested change to the sample implementation, & other comments Göran Weinholt (21 Oct 2022 18:08 UTC)
(missing)
Fwd: Suggested change to the sample implementation, & other comments Marc Nieper-Wißkirchen (23 Oct 2022 11:34 UTC)
Re: Suggested change to the sample implementation, & other comments Marc Nieper-Wißkirchen (23 Oct 2022 11:36 UTC)
Re: Suggested change to the sample implementation, & other comments Marc Nieper-Wißkirchen (22 Oct 2022 08:17 UTC)
Re: Suggested change to the sample implementation, & other comments Marc Nieper-Wißkirchen (22 Oct 2022 14:17 UTC)

Re: Suggested change to the sample implementation, & other comments Marc Nieper-Wißkirchen 23 Oct 2022 11:36 UTC

Am Fr., 21. Okt. 2022 um 20:27 Uhr schrieb Marc Nieper-Wißkirchen
<xxxxxx@gmail.com>:

[...]

> Am Fr., 21. Okt. 2022 um 20:09 Uhr schrieb Göran Weinholt <xxxxxx@weinholt.se>:
> >
> > Hello Marc,
> >
> > Thanks for another interesting SRFI. I noticed that the sample
> > implementation uses a construction that neither Chez nor Loko optimizes:
> >
> >   (expand/optimize
> >     '(define set-car+cdr!
> >        (lambda (p x y)
> >          (assert (pair? p))
> >          (perform
> >            (set-car! p x)
> >            (set-cdr! p y)))))
> >   =>
> >   (begin
> >     (set! set-car+cdr!
> >       (lambda (p x y)
> >         (let ([t (pair? p)])
> >           (if t
> >               (void)
> >               (assertion-violation #f "failed assertion (pair? p)")))
> >         (call-with-values
> >           (lambda () (set-car! p x))
> >           (lambda g2
> >             (call-with-values
> >               (lambda () (set-cdr! p y))
> >               (lambda g3 (values)))))))
> >     (void))
>
> Thank you very much for making this test.  I would have thought that
> Chez uses the ideas of Ashley/Dybvig's paper "Implementation of
> Multiple Return Values in Scheme" to eliminate the `call-with-values`
> calls.  (As mentioned in that paper, `call-with-values` it is not a
> particularly good primitive because of the unnecessary closure
> generation).

BTW, is there an easy way to let Chez print the results of its
intermediate or final nanopasses?

Thanks, Marc