Just Launched: You can now import projects and releases from Google Code onto SourceForge
We are excited to release new functionality to enable a 1-click import from Google Code onto the Allura platform on SourceForge. You can import tickets, wikis, source, releases, and more with a few simple steps. Read More
From: Leslie P. Polzer <sky@vi...> - 2009-06-12 17:59:27
I've noticed that TYPECASE compiles into a FOP-FUNCALL which
in turn tries to find any classes (IIRC via FIND-CLASSOID)
used in the cases and errors if it can't.
This has some funny effects when loading FASLs before the class
is defined, because usually TYPECASE isn't supposed to require
definition of the type forms until the code is executed.
Recompiling the file before loading it again gets rid of this
Bottom line: is it really necessary to raise an error here
when the class isn't defined?
From: Leslie P. Polzer <sky@vi...> - 2009-06-14 17:19:40
Leslie P. Polzer wrote:
> I've noticed that TYPECASE compiles into a FOP-FUNCALL which
> in turn tries to find any classes (IIRC via FIND-CLASSOID)
> used in the cases and errors if it can't.
Here's the relevant backtrace:
0: (SB-KERNEL:FIND-CLASSOID-CELL PLAYER)[:EXTERNAL]
2: (SB-FASL::LOAD-FASL-GROUP [...])
I might dive into the code myself if time allows.
2009/6/12 Leslie P. Polzer <sky@...>:
> Bottom line: is it really necessary to raise an error here when the class isn't defined?
I haven't checked properly, but I believe this is covered by CLHS
126.96.36.199, "Semantic Constraints".
Basically, the compiler is allowed to assume that the environment the
code is loaded into is pretty much like the one it was compiled in --
which includes having sufficiently similar type definitions.
If you need to be able to load the code before the classes are
defined, you need to compile it before they are defined.