Opened 8 years ago

Closed 8 years ago

#1336 closed defect (fixed)

Another parameterize issue reported by Joo ChurlSoo

Reported by: Mario Domenech Goulart Owned by:
Priority: critical Milestone: 4.12.0
Component: core libraries Version: 4.11.0
Keywords: parameterize Cc:
Estimated difficulty:

Description

Reported by Joo ChurlSoo? via e-mail.

CHICKEN
(c) 2008-2016, The CHICKEN Team
(c) 2000-2007, Felix L. Winkelmann
Version 4.11.0 (rev ce980c4)
windows-mingw32-x86 [ manyargs dload ptables ]
compiled 2016-05-28 on yves.more-magic.net (Linux)
#;1> (let ((f (make-parameter 'a))
       (path '())
       (g (make-parameter 'g))
       (c #f))
       (let ((add (lambda () (set! path (cons (f) path)))))
     (add)
     (parameterize ((f 'b)
            (g (call-with-current-continuation
                (lambda (c0) (set! c c0) 'c))))
       (add) (f (g)) (add))
     (f 'd)
     (add)
     (if (< (length path) 8)
         (c 'e)
         (reverse path))))
(a b c d b e d b e d) ; correct

#;2> (let ((f (make-parameter 'a))
       (path '())
       (g (make-parameter 'g))
       (c #f))
       (let ((add (lambda () (set! path (cons (f) path)))))
     (add)
     (parameterize ((f 'b))
       (g (call-with-current-continuation (lambda (c0) (set! c c0) 'c)))
       (add) (f (g)) (add))
     (f 'd)
     (add)
     (if (< (length path) 8)
         (c 'e)
         (reverse path))))
(a b c d a e d d e d) ; seems to be incorrect
;; (cf.)
(a b c d c e d e e d)

Attachments (1)

0001-Save-current-values-when-leaving-parameterizes.patch (3.2 KB) - added by sjamaan 8 years ago.
First attempt, not working properly in compiled mode yet

Download all attachments as: .zip

Change History (6)

comment:1 Changed 8 years ago by sjamaan

Yup, we broke this in the fix. Looks like nobody noticed it.

comment:2 Changed 8 years ago by sjamaan

Fun detail: In compiled mode, the first one fails too!

Changed 8 years ago by sjamaan

First attempt, not working properly in compiled mode yet

comment:3 Changed 8 years ago by sjamaan

Milestone: someday4.12.0
Priority: majorcritical

I think this is a pretty bad regression, so I'm moving this up in prio

comment:4 Changed 8 years ago by sjamaan

Slightly cleaner version of this patch sent to -hackers, plus a patch that removes the compile/runtime difference.

comment:5 Changed 8 years ago by evhan

Resolution: fixed
Status: newclosed

Fixed by 9e20052/87b879b (master) and 6ea929d/a75d2b2 (chicken-5).

Note: See TracTickets for help on using tickets.