( Title: Measured string stack representation File: mstrings-srep.fs Author: David N. Williams License: LGPL Version: 0.8.4 Test file: mstrings-test.fs Change log: mstrings.log Revised: August 27, 2008 Copyright [C] 2002, 2007, 2008 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 software 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. If you take advantage of the option in the LGPL to put a particular version of this library under the GPL, the author[s] would regard it as polite if you would put any direct modifications under the LGPL as well, and include a copy of this request near the beginning of the modified library source. A "direct modification" is one that enhances or extends the library in line with its original concept, as opposed to developing a distinct application or library which might use it. This is a self-contained library in the mstrings collection. It is mostly ANS Forth compatible up to case dependence, [UNDEFINED], and REQUIRED. The code is intended to be character clean. Please see the file mstrings.txt for terminology and more detailed word specifications. ) decimal \ *** STACK REPRESENTATION WORDS ( MCOUNT -MCOUNT /M ) \ *** UTILITY WORDS \ DEBUGGING \ : .# ( n -- ) cr ." #" . cr ; [UNDEFINED] cell- [IF] : cell- ( addr -- addr-cell ) [ 1 cells ] literal - ; [THEN] \ *** DEFINITIONS \ These will be redefined if dstrings is loaded later. [UNDEFINED] /mcount [IF] \ dstrings not loaded : mcount ( m -- s ) dup @ swap cell+ swap ; : -mcount ( s -- m ) drop cell- ; [THEN] : /m ( len -- c[len]+cell ) chars cell+ ;