chicken-users
[Top][All Lists]
Advanced

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

Re: [Chicken-users] CSI and CSC do not do the same for syntax definition


From: Alaric Snell-Pym
Subject: Re: [Chicken-users] CSI and CSC do not do the same for syntax definitions
Date: Tue, 17 Jan 2012 10:46:27 +0000
User-agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.18) Gecko/20110617 Thunderbird/3.1.11

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On 01/17/2012 09:35 AM, address@hidden wrote:
> I have two files which are run correctly by the interpreter but the
> compiled version fails to run:
>
> $ csi -i -s x.scm
> x
> y
>
> $ csc x.scm && ./x
> x
>
> Error: unbound variable: y
>
> Is this the intended behavior?

Yes. The effect of load is, necessarily, at run time. When run in csi,
the load can therefore happen immediately, and csi gets the syntax
definition of y. When compiled, the load happens not at compile time but
at run time, when it's too late to expand any syntax; the compiler has
compiled in a reference to y as a (initially unbound) variable in the
hope that loading y.scm will assign a value to y. However, syntax
definitions are not value assignments, as they are compile-time beasts!

ABS

- --
Alaric Snell-Pym
http://www.snell-pym.org.uk/alaric/
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.11 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAk8VUYMACgkQRgz/WHNxCGosyACcCY5CpL+aUap/omyXLL9aR0yb
yLYAn1xr6cgmt05/9zW5/vkYBfgx3dgX
=gvpQ
-----END PGP SIGNATURE-----



reply via email to

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