This is the mail archive of the
kawa@sourceware.org
mailing list for the Kawa project.
Re: difference between using eval from the interactive prompt and from a file?
- From: Helmut Eller <eller dot helmut at gmail dot com>
- To: kawa at sources dot redhat dot com
- Date: Fri, 11 Nov 2011 20:21:11 +0100
- Subject: Re: difference between using eval from the interactive prompt and from a file?
- References: <CAE2A29A.255AF%lexaay@gmail.com> <4EBD6180.9040009@bothner.com>
* Per Bothner [2011-11-11 17:55] writes:
> On 11/11/2011 02:02 AM, Helmut Eller wrote:
>> R7RS section 5.1 Programs:
>>
>> Expressions occurring at the top level of a program are
>> interpreted imperatively; they are executed in order when
>> the program is invoked or loaded, and typically perform
>> some kind of initialization.
>>
>> So I think this is one more case where Kawa is not standard conform.
>
> Ah, but when you say "kawa evaltest.scm" evaltest.scm is treated as a
> module, not a program. If you want evaltest.scm to be treated as a
> R7RS "program" use the -f flag. (Of course most of the time it
> doesn't matter - in Kawa certain modules are often also programs,
> or at least behave the same way when loaded.)
>
> So this is not an example of Kawa non-conformance.
(with-language-lawyer-hat-on
R7RS 5.5.1. Module Syntax (page 24):
The top-level forms in a module are executed in the order in
which they occur when the module is loaded.
Seems to suggest that programs and modules should do the same.
)
Helmut