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

Re: garbage collection



Peter Dudey asks:

> Is there a way to "clear" the interpreter, i.e., remove all user
> definitions and declarations, without exiting and reloading?

Assuming you haven't modified system data structures or created new
packages, this one might help:

(let ((p (find-package "USER")))
  (do-symbols (s p) (when (eq (symbol-package s) p) (unintern s p)))
)

> When I build some horrid, arcane pointer structure, the various items in
> it are subject to garbage collection when and only when there's nothing
> pointing to them . . . right?

Right. In the simplest case you set a global variable to NIL.
It's even simpler if your database is not contained in a global variable
at all.


                    Bruno Haible
                    haible@ma2s2.mathematik.uni-karlsruhe.de