Newsgroups: comp.lang.lisp.x
Path: cantaloupe.srv.cs.cmu.edu!das-news2.harvard.edu!oitnews.harvard.edu!purdue!lerc.nasa.gov!magnus.acs.ohio-state.edu!math.ohio-state.edu!cs.utexas.edu!howland.reston.ans.net!ix.netcom.com!netcom.com!mayer
From: mayer@netcom.com (Niels P. Mayer)
Subject: Re: (undefun ...)
Message-ID: <mayerDGt80q.2nn@netcom.com>
Organization: NETCOM On-line Communication Services (408 261-4700 guest)
References: <46ap31$8i@hecate.umd.edu>
Distribution: inet
Date: Sat, 21 Oct 1995 17:46:02 GMT
Lines: 33
Sender: mayer@netcom23.netcom.com

In article <46ap31$8i@hecate.umd.edu>, c2mxwalk@fre.fsu.umd.edu (MORIBUND) writes:
> To anyone who has messed with the source for xlisp....  I'm in the process of 
> writing a large lisp program for a project at school and I would like to know 
> where to start looking in the source code to implement an (UNDEFUN ...) 
> function.
> 
> The purpose of this function would be to remove a previous (DEFUN ...) from 
> memory (thus giving room to other functions for list management/whatever).
> 

Unless I'm misunderstanding what you're looking for, you can do this with
a combination of 'fmakunbound' and 'unintern', e.g. I have a function
I wrote that will run a function then "nuke" it:

	(defun run-fn-then-nuke (fn-sym)
	  (funcall fn-sym)
	  (fmakunbound fn-sym)
	  (unintern fn-sym))

which you "run" like this:

	(run-fn-then-nuke 'init-user-vars)
	(run-fn-then-nuke 'init-lib-user-tempdir)
	(run-fn-then-nuke 'init-lib-media)
	(run-fn-then-nuke 'init-lib-parsewww-structed-cls)
	(run-fn-then-nuke 'init-lib-wyswidget)
	(run-fn-then-nuke 'init-stredit-struct-edit)

!?!?!?!?!?!?!?!?!?!?!?!?!?!?!?!?!?!?!?!?!?!?!?!?!?!?!?!?!?!?!?!?!?!?!?!?!?!?!
!   Niels Mayer ..... mayer@eit.com   ! http://www.eit.com/~mayer           !
! Enterprise Integration Technologies ! http://www.eit.com/software/wwweasel!
! 800 El Camino Real, Menlo Park, CA. ! http://www.eit.com/software/winterp !
!?!?!?!?!?!?!?!?!?!?!?!?!?!?!?!?!?!?!?!?!?!?!?!?!?!?!?!?!?!?!?!?!?!?!?!?!?!?!
