[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: problem in initialize-instance
- To: poman@CS.UCLA.EDU
- Subject: Re: problem in initialize-instance
- From: Gregor.pa@Xerox.COM
- Date: Tue, 16 Aug 88 10:33 PDT
- Cc: commonloops.PA@Xerox.COM
- Fcc: BD:>Gregor>mail>outgoing-mail-3.text.newest
- In-reply-to: <8808152331.AA03419@neptune.CS.UCLA.EDU>
- Line-fold: no
Date: Mon, 15 Aug 88 16:30:59 PDT
From: poman@CS.UCLA.EDU
There is a problem in compiling auxilliary methods defined for initialize-
instance. Compilation will bomb with the error of calling the compiler
recursively. The following is the example that I worked on :
(defclass ppname (name)
((whole-name :accessor glue-name)))
(defmethod initialize-instance :after
((cname ppname))
(format t " whole name is :~a ~%" (glue-name cname )))
I would appreciate any information about fixing the bug.
You don't say, but this must be in KCL.
As you say, the problem here is that the KCL compiler isn't reentrant.
I have it on my list of things to do to teach PCL about an elegant way
to deal with non reentrant compilers, but it is pretty low priority
right now.
Here is a way you can get around this problem. Before attempting to
compile your program, first simple load it interpreted. Then compile
your program. The last file compiled in your program should contain the
line:
(pcl::precompile-random-code-segments)
Whenever you subsequently compile or load your program, that file should
be loaded first. It must be compiled last and loaded first. This will
have the effect of precompiling all the special code segments your
program seems to need.
Sometimes during the life of your program, you will add something to it
that will require a new special code segment. This may require you to
first load that part of the program interpreted, then compile it.
As I said, this will be fixed in PCL someday, although a much more
elegant fix would be to make the KCL compiler reentrant.
-------