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

Packages and shadowing

The (mis)feature that it complained about defining a function in the
global package was removed since the manual was published.  It will
query you if you are RE-defining a function, because the function is
defined in two different files.  You can type N to proceed without
redefining the function.  But if you are defining a function that
happens to be global, it will just let you go ahead and do it, since it
can't break anything.  So just going ahead and loading your file should
not break the machine.

There probably isn't a really good way to find out which globals you have
defined.  I can suggest the following function (I suggest you compile it
before running it):

	(defun find-functions-in-file (file)
	   (setq file (funcall (fs:parse-pathname file) ':generic-pathname))
	   (loop for sym being the interned-symbols in 'global
		 unless (eq sym nil)
		   when (eq (si:get-source-file-name sym 'defun) file)
		    collect sym))

This uses only things in the manual except for get-source-file-name
which didn't exist when the manual was written.