Thank you very much for the helpful reply, which makes sense.
But it raises another question. You say:
A conforming
program may not redefine F elsewhere. The SBCL file compiler takes
some advantage of this for type inference, while LOAD doesn't.
The first of these sentences puts forth a notion of "conforming" that
seems to contradict this passage from the end of Section 5.3.1
("Defining Named Functions") of CLtL 2:
It is permissible to use defun to redefine a function, to install a
corrected version of an incorrect definition, for example. It is
permissible to redefine a macro as a function. It is an error to
attempt to redefine the name of a special form (see table 5-1) as a
function.
In particular, suppose I define functions F and G, where G calls F,
and then I redefine F with a different return type, where G (still)
calls F without error. Are you saying that because of type inference,
if the initial definitions of F and G are in a compiled file then I
could get an error when calling G after redefining F?
Thanks --
-- Matt
Sender: jsnell@...
Cc: sbcl-help@...
From: Juho Snellman <jsnell@...>
Date: 15 Jan 2007 00:00:07 +0200
X-SpamAssassin-Status: No, hits=-2.6 required=5.0
X-UTCS-Spam-Status: No, hits=-312 required=200
Matt Kaufmann <kaufmann@...> writes:
> Hello --
>
> I have recently tried an experiment with a program I'm working on
> (ACL2) in which I avoid explicit calls to compile-file, loading .lisp
> source files instead of the resulting .fasl files before saving an
> image. In SBCL 1.0 on Ubuntu, the program's regression suite ran
> significantly slower when I avoided compile-file (using the same
> unloaded machine both times). This surprised me, since my
> understanding is that SBCL always compiles.
While loading a source file does compile the code, it's not exactly
equivalent to a COMPILE-FILE followed by loading the fasl.
For example, an implementation is allowed to assume that any calls to
a function F in the file where it is defined refer to that exact
definition of F, unless F has been declared as NOTINLINE. A conforming
program may not redefine F elsewhere. The SBCL file compiler takes
some advantage of this for type inference, while LOAD doesn't.
--
Juho Snellman
|