( Title: Single-Linked Nodes File: snode.fs Version: 1.2.3 Author: David N. Williams License: LGPL Last revision: September 1, 2006 ) \ Copyright (C) 2000-2002 David N. Williams ( This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or at your option any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. Please see the file POLITENESS included with this distribution. ANS Forth compatible except for: - Case sensitivity. - Assumption that zero does not occur as an address. Please see the file NOTATION. ) \ *** WORDS ( Single-linked node structure: /SNODE-DATA: /SNODE-HEADER ) \ *** SNODE STRUCTURE ( "Snodes" are single-linked nodes. They have only single, forward links, so their header structure is trivial [one cell]. It is the same as the NXNODE part of the double-linked node header structure, but we just use @ and ! instead of >NXNODE @ and >NXNODE ! This file supplies a few other structure words. Please see sexample.fs for examples of their use by an application. ) 1 cells constant /snode-header : /snode-data: ( "name" total.offset -- ) ( To be used at the end of a data continuation to a single-linked node structure to define a constant that counts the size of the data field only, leaving out the header. ) /snode-header - constant ; \ *** SNODE SPACES ( A typical use of MAKE-NODES to allocate a space of single-linked nodes called MYSNODES might be the following: ) \ ( #nodes /node.data) /snode-header \ make-nodes constant mysnodes