[Ecls-list] Newbie question

Juan Jose Garcia Ripoll lisp at arrakis.es
Mon Dec 20 01:34:00 UTC 2004


daniel jay macdonald wrote:

> Thanks! It would be nice if there was a doc wiki so things like this 
> could be compiled in one place. Its a bit of a put off for new users 
> to have to sift the archives in vain for common things like this 
> (although I did eventually find some posts hinting at it in passing).

I am sorry about the poor documentation, but I really have very little 
time to work on this project and I prefer to spend it working on the 
code -- there are so many things to improve! I have tried to find out 
whether SourceForge permits something like a Wiki, but I have not 
succeeded so far. Since, I do not think it would be nice to abuse 
cliki.net using it for our purposes, there are very few options left.

> My next dumb question: how do I force ecl to reload a shared library? 
> I want to recompile code and then call the new versions without 
> restarting ecl. Based on glances at the gc code that unloads libraries 
> I try this:
>
> (defun nuke-package (name)
>   (let ((pkg (find-package name)))
>   (do-symbols (s pkg)
>     ;(si::unlink-symbol s))
>     (when (eq (symbol-package s) pkg)
>       (fmakunbound s)
>       (makunbound s)
>       (unintern s) ))
>   (delete-package pkg)
>   (si::gc t)))
>
> But it doesnt seem to be quite enough.
> This seems like a natural thing to do, am I missing the simple answer?

Well, there are two tricks you can try. One is to garbage collect the 
library you created. If you confine your functions to a single package 
and then unbind all of them, that should be enough. If this does not 
work, please send me a copy of the smallest file for which that does not 
happen.

The other possibility is to produce output fasl files with different 
names. You can get this by supplying yourself a :output-file parameter 
to the compile-file function:

 > (compile-file "foo.lsp" :output-file (ext::mkstemp "foo"))
;;; Compiling foo.lsp.
;;; Compiling (DEFUN F1 ...).
;;; End of Pass 1. 
;;; Emitting code for F1.
[...]
;;; Finished compiling foo.lsp.
#P"/home/jlr/src/ecls-new/build/fooeZxAtM.fas"
Top level.
 > (load *)
;;; Loading "/home/jlr/src/ecls-new/build/fooeZxAtM.fas"
"/home/jlr/src/ecls-new/build/fooeZxAtM.fas"
Top level.

Regards,

    Juanjo




More information about the ecl-devel mailing list