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

precompile-random-code-segments



The comments in notes.text about precompile-random-code-segments have
confused quite a number of people.  Looking back on them its no great
suprise.  This message attempts to straighten things out a a bit.

The crucial point that was confused before is that the precom file must
be compiled after your entire system is LOADED.  It is not necessary
for your system to have been compiled in the current image, just loaded.

The rest of this message is the text from notes.text re-worked to
attempt to make this more clear.  I will also take a shot at abstracting
out the defsys stuff so that people can use that and then I will send
out a message saying how to do this using that stuff.

In addition this release includes the beginnings of support for doing
some of the compiling which PCL does a load time at compile time
instead.  To use this support, put the form:

  (pcl::precompile-random-code-segments)

in a file which is compiled after all your other pcl using files are
loaded.  Then arrange for that file to be loaded before all your
other pcl using files are loaded.

For example, if your system has two files called "classes" and "methods",
create a new file called "precom" that contains:

  (in-package 'pcl)
 
  (pcl::precompile-random-code-segments)

Then you can compile your system with:

  (defun compile-my-system ()
    (let ((compiled-a-file-p nil))
      (when (source-newer-than-binary "classes")
	(compile-file "classes")
	(setq compiled-a-file-p t))
      (load "classes")
      (when (source-newer-than-binary "methods")
	(compile-file "methods")
	(setq compiled-a-file-p t))
      (load "methods")
      (when (or compiled-a-file-p
		(source-newer-than-binary "precom"))
	(compile-file "precom"))))

and load your system with:

  (defun load-my-system ()
    (load "precom")
    (load "classes")
    (load "methods"))
-------