Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!sdd.hp.com!decwrl!ucbvax!MITCH.ENG.SUN.COM!wmb From: wmb@MITCH.ENG.SUN.COM Newsgroups: comp.lang.forth Subject: Re: redefining words Message-ID: <9008070137.AA00402@ucbvax.Berkeley.EDU> Date: 6 Aug 90 21:59:17 GMT Sender: daemon@ucbvax.BERKELEY.EDU Reply-To: wmb%MITCH.ENG.SUN.COM@SCFVM.GSFC.NASA.GOV Organization: The Internet Lines: 33 > I've got an application where the definitions of words may be changed > many times, and I'd like the new definition to actually replace the > old one rather than simply being tacked on for future use. Is there > any "standard" way to remove/replace words and reclaim the dictionary > space for them? No. Some (not many) systems have this capability, but as far as I know there is no "common practice" in this area (other than FORGETting back to a certain point and reloading everything after that). The most common scheme for replacing the definition of a word is called "vectored execution", but it does not accomplish the aim of reclaiming the dictionary space used by the old definition. Vectored execution works as follows: VARIABLE 'FOO : FOO 'FOO @ EXECUTE ; To set the action performed by FOO , say to BAR , you execute ' BAR FOO ! Some systems have a built-in mechanism for doing this, e.g.: DEFER FOO ' BAR IS FOO Another common technique is the DOER ... MAKE construct described in _Thinking Forth_ . Personally, I do not like DOER ... MAKE because it adds yet another non-postfix syntactic construct to Forth. Mitch