PS Even without the multiple cleanup-form extension, I shouldn't have coded (lambda () <expr>) in the macro text. One should always code this like (lambda () (values) <expr>) or even better (lambda () (values <expr>)) so that an error is likely to be reported when a non-expression is provided for <expr>.
Am So., 9. Okt. 2022 um 17:13 Uhr schrieb Marc Nieper-Wißkirchen <[email protected]>: > > Am So., 9. Okt. 2022 um 17:03 Uhr schrieb John Cowan <[email protected]>: > > >> Thanks; with my definition, I would have to code it like > >> (unwind-protect protected-form (begin (values) cleanup-form ...)) as > >> otherwise definitions would be allowed by the definition making it too > >> easy to write non-portable code. > > > > > > Eh? `Begin` doesn't allow declarations; only `lambda` and the `let` family > > do. > > My proposed macro has > > (lambda () > <cleanup-form>) > > as a subform. Expanding a begin in this context would have the > meaning of the first form of begin in section 4.2.3 of R7RS ([1]). > > -- > > [1] In fact, the first form of begin should probably not have been > listed in this section at all but somewhere else because it is not an > expression form.
