PDA

View Full Version : Internal workings of FORGET


estl
11-21-02, 03:45 PM
I need to build a word that combines the functionality of ' (tick) and FORGET (Max-FORTH 3.5 ). I need to retrieve information from the parameter field from the target word and then FORGET the target word and everything following it. The tick will give me access to the information ( pfaptr -> pfa -> info ) but I want to make sure I fully emulate the internal workings of FORGET.

rob
11-21-02, 05:31 PM
Just rerun the input stream by restoring the value in >IN like so:

: 'F >IN @ ' SWAP >IN ! FORGET ; OK
: Z ; : Y ; : X ; OK
' Y HEX . 800D7C OK
'F Y . 800D7C OK
LATEST ID. Z OK

In this example the word 'F ticks the following word, restores the input stream position and then forgets the word. The three definitions for X Y and Z are to test. This should work for any MaxForth.

Rob