chicken-hackers
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Chicken-hackers] Bug in make-parameter / parameterize


From: Jörg F . Wittenberger
Subject: [Chicken-hackers] Bug in make-parameter / parameterize
Date: 25 Oct 2018 14:01:08 +0200

Hi Chickeneers,

learning from srfi-154 it seems there is a bug in make-parameter/parameterize.

Here a simplified and shortend implementation of srfi-157 plus a test
lifted from the srfi.  With chicken (tested with version 4.11.1) it
fails (returns #f).  (chibi-scheme passes the test returning #t.)

Best

/Jörg

(let* ((current-dynamic-extent
       (lambda ()
         (call-with-current-continuation
          (lambda (return)
            (call-with-values
                (lambda ()
                  (call-with-current-continuation
                   (lambda (c)
                     (return
                      (lambda (thunk)
                        (call-with-current-continuation
                         (lambda (k)
                           (c k thunk))))))))
              (lambda (k thunk)
                (call-with-values thunk k)))))))
      (with-dynamic-extent
       (lambda (dynamic-extent thunk)
         (dynamic-extent thunk))))
(eq?
  (let*
      ((x (make-parameter 'a))
       (de (parameterize
            ((x 'b))
            (current-dynamic-extent))))
    (parameterize
     ((x 'c))
     (with-dynamic-extent
      de
      (lambda ()
        (x)))))
  'b))

;;;------------




reply via email to

[Prev in Thread] Current Thread [Next in Thread]