Google
 

Trailing-Edge - PDP-10 Archives - decuslib20-01 - decus/20-0004/swaphash.tty
There are no other files named swaphash.tty in the archive.
SWAPHASH

This file defines functions for manipulating swapped hash-arrays, hash-arrays
that reside in shadow space.

For most of the functions that operate on ordinary hash arrays there is
a corresponding function that operates on swapped arrays.  The corresponding
function has the same name, with an S prefixed on the front.  Thus,

SHARRAY creates a swapped hasharray,
SGETHASH retrieves values from it,
SMAPHASH maps it,
SPUTHASH stores into it.

Swapped arrays are unlike ordinary hasharrays in that the
top-level list-structure of the values is also stored in the
swapped array.  The list structure value is copied into shadow space
and recreated by SGETHASH.  The swapped array will
contain pointers to the core-resident non-lists or list CAR's in the values.

Since it is sometimes desirable to ask whether a given key has a value
but the particular value is not needed, the function STESTHASH is provided;
this function is called like SGETHASH and returns T if the key has
a value in the array without consing up the whole list-structure.

The function SEQMEMBHASH[x;v;h] is a more specific predicate:  it returns
T if the value of X in the hasharray H is or contains V, analogous to
the EQMEMB function.  Again, the test is done without consing up the
list-structure.

Finally, two special functions are provided for adding and subtracting
elements from lists in a swapped array, SADDHASH and SSUBHASH:

ssubhash[x;v;h]  deletes the element v from the list hashvalue
	of x in the swapped hasharray h.  Equivalent to
	(SPUTHASH X (REMOVE V (SGETHASH X H) H), but doesn't actually
	cons up the value.

saddhash[x;v;h] makes sure that the value of x in h contains v (i.e.,
	adds it if it is not already there.  saddhash assumes that the
	value is being treated as an unordered set, not an ordered list, and
	does not guarantee to maintain the list value in any particular
	sequence.

SWAPHASH is used by SMARTARG and MSSWAP.  Loading the latter file in will
cause the masterscope database to be stored in swaparrays.

Larry Masinter and Ron Kaplan