Re: `temporarily` should not be splicing construct.
Marc Nieper-WiÃkirchen 30 Jun 2025 06:06 UTC
Hi Zhu,
thank you very much for your report. Indeed, the reference
implementation should expand into `(let () b1 b2 ...)' in the first
case.
Would you mind opening a pull request?
Thanks,
Marc
Am Do., 12. Juni 2025 um 07:49 Uhr schrieb Zhu Zihao <xxxxxx@163.com>:
>
> In the refrence implementation [1]:
>
> ```
> (define-syntax/who temporarily
> (lambda (x)
> (syntax-case x ()
> [(_ () b1 b2 ...) #'(begin b1 b2 ...)]
> [(_ ([x e] ...) b1 b2 ...)
> (with-syntax ([(p ...) (generate-temporaries #'(x ...))]
> [(y ...) (generate-temporaries #'(x ...))])
> #'(let ([p x] ... [y e] ...)
> (let ([swap (lambda ()
> (let ([t (p)]) (p y) (set! y t))
> ...)])
> (dynamic-wind swap (lambda () b1 b2 ...) swap))))])))
> ```
>
> When use as `(temporarily () b1 b2 ...)`,it expand to (begin b1 b2 ...)
> and become a splicing construct. IMO it should expand to (let () b1 b2
> ...) like Chez's implementation[2]
>
>
> [1]: https://github.com/scheme-requests-for-implementation/srfi-226/blob/master/lib/control-features.sls#L1237
> [2]: https://github.com/cisco/ChezScheme/blob/main/s/syntax.ss#L8346
> --
> Retrieve my PGP public key:
> 执行下列命令以获取我的 PGP 公有密钥:
>
> gpg --recv-keys B3EBC086AB0EBC0F45E0B4D433DB374BCEE4D9DC
>
> Zihao