Hello all!

I am trying to run the following script to test something. For some reason, when it is interpreted it works properly (as far as I know), while when it is compiled and run it loops infinitely:

(define (mode entry)
  (let ((inc 0))
    (define saved-continuation #f)
    (set! entry (call/cc (lambda (k)
                           (set! saved-continuation k)
                           entry)))
    (set! inc (+ inc entry))
    (write inc)
    (newline)
    saved-continuation))

(define a (mode 1))
(a 2)

If I switch out the last two lines with ((mode 1) 2) the infinite loop behavior will occur regardless of whether it is interpreted or compiled.

I was planning to use something similar to this to handle different submodes of a script, but am stumped as to why this is happening.

Is this a bug in Chicken? My csi header:

CHICKEN
(c) 2008-2013, The Chicken Team
(c) 2000-2007, Felix L. Winkelmann
Version 4.8.0.4 (stability/4.8.0) (rev 578619b)
linux-unix-gnu-x86-64 [ 64bit manyargs dload ptables ]
compiled 2013-07-15 on aeryn.xorinia.dim (Darwin)

I encountered the same behavior using the latest Chicken revision from the git repository (aaac3530597fd28c35c07bbd54aff53bac3fd190).

Thanks,
--
Jonathan Chan
j...@fastmail.fm

_______________________________________________
Chicken-users mailing list
Chicken-users@nongnu.org
https://lists.nongnu.org/mailman/listinfo/chicken-users

Reply via email to