chicken-users
[Top][All Lists]
Advanced

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

[Chicken-users] Script behavior different when interpreted vs. compiled


From: Jonathan Chan
Subject: [Chicken-users] Script behavior different when interpreted vs. compiled
Date: Sat, 10 Aug 2013 00:37:01 -0700
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130806 Thunderbird/17.0.8

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
address@hidden



reply via email to

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