[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Chicken-users] Script behavior different when interpreted vs. compi
From: |
Jonathan Chan |
Subject: |
Re: [Chicken-users] Script behavior different when interpreted vs. compiled |
Date: |
Sat, 10 Aug 2013 11:43:52 -0700 |
Sorry, not a bug; my fault. I wasn't thinking clearly - after testing it
in Racket and seeing an error about redefining a, I realized that the
continuation was actually going all the way back to the define. Will
have to keep working on what I intended.
Thanks,
--
Jonathan Chan
On Sat, Aug 10, 2013, at 12:37 AM, Jonathan Chan wrote:
> 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
>
> _______________________________________________
> Chicken-users mailing list
> address@hidden
> https://lists.nongnu.org/mailman/listinfo/chicken-users