🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: net.lang.forth
Article #356

Re: Information Hiding in FORTH

#356
From: steve
Date: Thu, 26 Jun 1986 17:55
27 lines
1803 bytes
In article <12110@amdcad.UUCP>, tim@amdcad.UUCP (Tim Olson) writes:
> [ summary: a way of hiding a word to make its scope local is to fiddle
>   with the link pointers and remove it from the dictionary chain]

I think an easier way of doing this is to use the sequence 

	' WORD-TO-HIDE NFA HEX 20 TOGGLE

This will set the 'smudge' bit in the word's name length field and hide it
quite nicely.  It also doesn't require you to address into the header which
is prohibited in the Forth '79 standard.

Another way of doing this is by putting the 'local' word in a vocabulary
used by the package you are building.  Then it will be visible anytime you
want it and invisible when you don't want it.  My assembler uses words like
[ and ] for addressing modes.  These are normal Forth words as well.  When
I am using the assembler, I set the context to ASSEMBLER and the assembler 
definitions for these words become visible.  When I end a CODE definition, 
I set the context back to FORTH and the normal definitions become visible.

-- 

...smeagol\			Steve Schlaifer
......wlbr->!jplgodo!steve	Advance Projects Group, Jet Propulsion Labs
....logico/			4800 Oak Grove Drive, M/S 156/204
				Pasadena, California, 91109
					+1 818 354 3171
Technical Details
Message-ID: <817@jplgodo.UUCP>
Path: arc1-ca.pugleaf.net!utzoo!watmath!clyde!caip!topaz!ll-xn!nike!ucbcad!ucbvax!decvax!decwrl!pyramid!hplabs!felix!scgvaxd!wlbr!jplgodo!steve
References: <12110@amdcad.UUCP>

Show Full Headers
Complete Article Headers
Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP
Path: arc1-ca.pugleaf.net!utzoo!watmath!clyde!caip!topaz!ll-xn!nike!ucbcad!ucbvax!decvax!decwrl!pyramid!hplabs!felix!scgvaxd!wlbr!jplgodo!steve
From: steve@jplgodo.UUCP
Newsgroups: net.lang.forth
Subject: Re: Information Hiding in FORTH
Message-ID: <817@jplgodo.UUCP>
Date: Thu, 26-Jun-86 13:55:15 EDT
Article-I.D.: jplgodo.817
Posted: Thu Jun 26 13:55:15 1986
Date-Received: Sun, 29-Jun-86 05:33:26 EDT
References: <12110@amdcad.UUCP>
Organization: Jet Propulsion Labs, Pasadena, CA
Lines: 27