Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.forth > #39511

Re: FORGET for CamelForth (Z80)?

Date 2015-06-01 13:21 -1000
From "Elizabeth D. Rather" <erather@forth.com>
Organization FORTH, Inc.
Newsgroups comp.lang.forth
Subject Re: FORGET for CamelForth (Z80)?
References <ct38jvF6436U1@mid.individual.net> <sq0bx.30459$Ik1.8952@fx12.iad>
Message-ID <Y4-dnXR1-MWfdPHInZ2dnUU7-UGdnZ2d@supernews.com> (permalink)

Show all headers | View raw


On 6/1/15 7:12 AM, Bob wrote:
> On 06/01/2015 10:30 AM, Peter Heitzer wrote:
>> Hello folks,
>> for some old Z80 SBC I managed to adopt camel forth 1.2 for standalone
>> use. Unfortunately camel forth has not FORGET in its dictionary.
>> I'd like to implement it for I find it useful in the develop phase
>> but I have not enought knowledge to do it by myself. If anyone already
>> has a definition for FORGET I would highly appreciate if he could
>> post it.
>> Thanks a lot in advance.
>>
>>
> FORGET needs to find the newest definition to keep then set
> the dictionary search pointer and the pointer to the end of
> used memory.
>
> : FORGET   [COMPILE]   '   ( LOOKUP NAME FROM INPUT STREAM )
>     DUP NFA DP ! ( DP IS USED BY HERE, THIS FREES UP MEMORY )
>     LFA @  CURRENT @  ! ; ( LINK TO PRIOR WORD, SET CURRENT )
>                         ( VOCABULARY TO START SEARCH THERE )
>
> This is what I used on a Z80 long ago.  Today it is politically
> incorrect because it depends on knowing what is in the dictionary
> and then touching that.  NFA takes what tick gives and adjusts to
> the name field address.  LFA takes what tick gives and adjusts to
> the link field address.  DP is end of dictionary pointer.

I don't see anything "politically incorrect" about having to use 
implementation knowledge to implement FORGET. This is why it was 
included in ANS Forth (though marked "Obsolescent"). We standardize 
words that are useful but would be hard to implement without 
implementation details.

> Warning, don't forget stuff that will cause a problem.  If you
> create another vocabulary and delete some of its words then the
> unforgotten vocabulary head points to deleted stuff that will
> soon be written over.  If you forget an entire vocabulary that
> may be OK.  If you have a vectoring word that has been pointed
> to forgotten code it will soon fail.  Failures will happen at
> some time in the future, far from the cause, generating
> confusion.

This is an important warning!

Cheers,
Elizabeth

-- 
==================================================
Elizabeth D. Rather   (US & Canada)   800-55-FORTH
FORTH Inc.                         +1 310.999.6784
5959 West Century Blvd. Suite 700
Los Angeles, CA 90045
http://www.forth.com

"Forth-based products and Services for real-time
applications since 1973."
==================================================

Back to comp.lang.forth | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

FORGET for CamelForth (Z80)? "Peter Heitzer" <peter.heitzer@rz.uni-regensburg.de> - 2015-06-01 14:30 +0000
  Re: FORGET for CamelForth (Z80)? Bob <bob@none.com> - 2015-06-01 13:12 -0400
    Re: FORGET for CamelForth (Z80)? "Elizabeth D. Rather" <erather@forth.com> - 2015-06-01 13:21 -1000
    Re: FORGET for CamelForth (Z80)? "HAA" <someone@microsoft.com> - 2015-06-03 13:20 +1000
  Re: FORGET for CamelForth (Z80)? albert@spenarnc.xs4all.nl (Albert van der Horst) - 2015-06-01 18:43 +0000
    Re: FORGET for CamelForth (Z80)? Coos Haak <chforth@hccnet.nl> - 2015-06-01 22:10 +0200
      Re: FORGET for CamelForth (Z80)? albert@spenarnc.xs4all.nl (Albert van der Horst) - 2015-06-01 20:43 +0000
        Re: FORGET for CamelForth (Z80)? Coos Haak <chforth@hccnet.nl> - 2015-06-01 23:50 +0200
      Re: FORGET for CamelForth (Z80)? "Peter Heitzer" <peter.heitzer@rz.uni-regensburg.de> - 2015-06-02 10:36 +0000

csiph-web