bug#48098: let/ec compilation bug
Stefan Israelsson Tampe <[email protected]>
| Newsgroups | gmane.lisp.guile.bugs |
|---|---|
| Message-ID | <CAGua6m3642LYw7dR1uz2+ACWeB8y4DCjLdh0-r+9bep3w_y6Ww@mail.gmail.com> |
Here is an interesting test case that shows that fi we define (define-syntax-rule (letec-m f) (let/ec c (f c))) (define (letec-f f) (let/ec c (f c))) we can get two different behaviors with letec-m compiles wrongly. Obviously a bug! This is important in casy you would like to make a loop macro effectively with a continue directive.
a.scm
(text/x-scheme, 323 B)
(use-modules (ice-9 control)) (define-syntax-rule (letec-m f) (let/ec c (f c))) (define (letec-f f) (let/ec c (f c))) (letec-m (lambda (break) (let lp ((i 0)) (when (< i 2) (pk 1 i) (lp (+ i 1)))))) (letec-f (lambda (break) (let lp ((i 0)) (when (< i 2) (pk 2 i) (lp (+ i 1)))))) #| OUTPUT: ;;; (2 0) ;;; (2 1) |#