[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Chicken-users] Compilation issue with v4.7.0
From: |
Pedro Henrique Antunes de Oliveira |
Subject: |
Re: [Chicken-users] Compilation issue with v4.7.0 |
Date: |
Fri, 12 Aug 2011 13:42:37 -0300 |
Maybe, top level execution is undefined.
I read R5RS once, but not paying total attention, and I don't remember
it defining how top level execution should work.
On Fri, Aug 12, 2011 at 1:40 PM, Paul Colby <address@hidden> wrote:
>
> On Aug 12, 2011, at 9:16 AM, Pedro Henrique Antunes de Oliveira wrote:
>
>> I am not sure why this happens, but once I've heard that TOP LEVEL
>> execution is different from normal execution, inside a lambda
>> expression for example.
>>
>> Try compiling this
>>
>> (let ((A #t)
>> (B 'undefined))
>> (if A
>> (set! B 'good)
>> (set! B 'bad))
>> (print B))
>>
>> It runs as expected.
>>
>> Your problem is probably related to how top level evaluations are executed.
>>
>> If I recall correctly, continuations, at top level, behave differently too.
>>
>> On Fri, Aug 12, 2011 at 11:56 AM, Paul Colby <address@hidden> wrote:
>>> Hi,
>>> I tried the following file as a prelude to doing conditional compilation
>>> and ran into the following snag,
>>> <snip>
>
> I already had tried this workaround but was not be able to do top level
> defines
> within the let making conditional compilation less interesting. It might be
> worth mentioning that I
> also tried my little test program with the -O4 switch and it works as
> expected yielding 'good' -On
> where n is 0, 1, 2, or 3 prints 'undefined' per the scoping rules of scheme.
> Clearly, top level
> execution differences shouldn't depend on the compilers optimization level.
>
> Thanks for taking a look.
>
> Regards
>
>