[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Chicken-users] (use foo) versus (declare (uses foo)), csi versus cs
Re: [Chicken-users] (use foo) versus (declare (uses foo)), csi versus csc
Sun, 21 Oct 2007 12:32:28 +0200
On Fri, Oct 19, 2007 at 06:06:59PM -0500, Zbigniew wrote:
> OK, try this.
> (define-extension bar)
> (define (fac n)
> (if (zero? n)
> (* n (fac (- n 1))) ) )
> #+compiling (declare (uses bar))
> (use bar)
> (write (fac 10)) (newline)
> With this incantation you cannot automatically include bar into foo as
> as a shared library. To include a shared bar.so, remove the entire
> #+compiling line. Alternatively you can bypass the requirement for
> this #+compiling directive in the first place by passing "-uses bar":
> $ csc -uses bar foo.scm bar.scm -o foo
> Then remove the -uses option if you want to compile shared.
Why is the difference between compiled and interpreted mode there?
The meaning of these things isn't fundamentally different between the two
modes, is it? Can't (declare) statements be parsed by the interpreter as
I understand that dynamic (use) calls (within if or cond, for example)
can't be compiled, but surely the interpreter can pick up the compiler hints..
"The process of preparing programs for a digital computer
is especially attractive, not only because it can be economically
and scientifically rewarding, but also because it can be an aesthetic
experience much like composing poetry or music."
-- Donald Knuth
Description: PGP signature