The following documentation is necessary to comply for Ficl to comply with the DPANS94 standard. It describes what areas of the standard Ficl implements, what areas it does not, and how it behaves in areas undefined by the standard.
Providing names from the Core Extensions word set
Providing names from the Double-Number word set
Providing the Exception word set
Providing the Exception Extensions word set
Providing the File-Access word set
Providing the File-Access Extensions word set
Providing names from the Floating-Point word set
Providing the Locals word set
Providing the Locals Extensions word set
Providing the Memory Allocation word set
Providing the Programming-Tools word set
Providing names from the Programming-Tools Extensions word set
Providing the Search-Order word set
Providing the Search-Order Extensions word set
Providing names from the String Extensions word set
\n" + heading + "\n
\n" ?> The implementation-defined items in the following list represent characteristics and choices left to the discretion of the implementor, provided that the requirements of the Standard are met. A system shall document the values for, or behaviors of, each item.
System dependent. You can change the default address alignment by defining FICL_ALIGN on your compiler's command line, or in platform.h. The default value is set to 2 in ficl.h. This causes dictionary entries and ALIGN and ALIGNED to align on 4 byte boundaries. To align on 2n byte boundaries, set FICL_ALIGN to n. Depends on target system, C runtime library, and your implementation of ficlTextOut(). None implemented in the versions supplied in primitives.c. Because ficlEvaluate() is supplied a text buffer externally, it's up to your system to define how that buffer will be obtained. Depends on target system and implementation of ficlTextOut(). Ficl characters are one byte each. There are no alignment requirements. No special processing is performed on characters beyond case-folding. Therefore, extended characters will not match their unaccented counterparts. Ficl uses the Standard C function isspace() to distinguish space characters. Uses the data stack. The maximum supported value of BASE is 36. Ficl will fail via assertion in function ltoa() of utility.c if the base is found to be larger than 36 or smaller than 2. There will be no effect if NDEBUG is defined, however, other than possibly unexpected behavior. Target system dependent. Calls ABORT to exit. Target system dependent (implementation of outer loop that calls ficlEvaluate()). Counted strings are limited to 255 characters. Limited by available memory and the maximum unsigned value that can fit in a cell (232-1). Ficl stores the first 31 characters of a definition name. Same as maximum definition name length. None supported. This is up to the target system. None supported. This is up to the target system. Okay, we don't know what this means. If you understand what they're asking for here, please call the home office. Target system dependent, either 32 or 64 bits. System dependent. Ficl represents a CELL internally as a union that can hold a ficlInteger32 (a signed 32 bit scalar value), a ficlUnsigned32 (32 bits unsigned), and an untyped pointer. No specific byte ordering is assumed. System dependent. Assuming a 32 bit implementation, range for signed single-cell values is [-231, 231-1]. Range for unsigned single cell values is [0, 232-1]. Range for signed double-cell values is [-263, 263-1]. Range for unsigned double cell values is [0, 264-1]. None. Default is 255. Depends on the setting of FICL_PAD_SIZE in ficl.h. System dependent, generally 4. System dependent, generally 1. This buffer is supplied by the host program. Ficl imposes no practical limit. Default is 255. Depends on the setting of FICL_PAD_SIZE in ficl.h. Default is 255. Depends on the setting of FICL_PAD_SIZE in ficl.h. The Ficl dictionary is not case-sensitive. ok> Symmetric. 1. System dependent. Ficl makes no special checks for overflow. No. Definitions are unsmudged after ; only, and only then if no control structure matching problems have been detected.
Ficl calls ABORT then prints the name followed by not found. Ficl stores the first 31 characters of the definition name, and uses all characters of the name in computing its hash code. The actual length of the name, up to 255 characters, is stored in the definition's length field. No problem: all addresses in Ficl are absolute. You can reach any 32 bit address in Ficl's address space. Ficl makes no check for argument type compatibility. Effects of a mismatch vary widely depending on the specific problem and operands. Ficl returns a valid token, but the result of executing that token while interpreting may be undesirable. Results are target procesor dependent. Generally, Ficl makes no check for divide-by-zero. The target processor will probably throw an exception. With FICL_ROBUST (defined in ficl.h) set to a value of 2 or greater, most data, float, and return stack operations are checked for underflow and overflow. This is not checked, and bad things will happen. Ficl generates an error message if the dictionary is too full to create a definition header. It checks ALLOT as well, but it is possible to make an unchecked allocation request that will overflow the dictionary. Ficl protects all ANS Forth words with undefined interpretation semantics from being executed while in interpret state. It is possible to defeat this protection using ' (tick) and EXECUTE though. Varies depending on the nature of the buffer. The input buffer is supplied by ficl's host function, and may reside in read-only memory. If so, writing the input buffer can ganerate an exception. String literals are stored in the dictionary, and are writable. In the unlikely event you are able to construct a pictured numeric string of more than FICL_PAD_LENGTH characters, the system will be corrupted unpredictably. The buffer area that holds pictured numeric output is at the end of the virtual machine. Whatever is mapped after the offending VM in memory will be trashed, along with the heap structures that contain it. Ficl does not copy parsed strings unless asked to. Ordinarily, a string parsed from the input buffer during normal interpretation is left in-place, so there is no possibility of overflow. If you ask to parse a string into the dictionary, as in SLITERAL, you need to have enough room for the string, otherwise bad things may happen. This is usually not a problem. Value will be truncated. Most stack underflows are detected and prevented if FICL_ROBUST (defined in sysdep.h) is set to 2 or greater. Otherwise, the stack pointer and size are likely to be trashed. Ficl returns for a new input buffer until a non-empty one is supplied.
The following specific ambiguous conditions are noted in the glossary entries of the relevant words:
Memory corruption will occur—the exact behavior is unpredictable because the input buffer is supplied by the host program's outer loop. It finds the address of the definition before DOES> Not implemented. This is okay until the cells are overwritten with something else. The dictionary maintains a hash table, and the table must be updated in order to de-allocate words without corruption. Target processor dependent. Consequences include: none (Intel), address error exception (68K). See above on data space read/write alignment. If FICL_ROBUST is two or larger, Ficl will detect a stack underflow, report it, and execute ABORT to exit execution. Otherwise the error will not be detected, and memory corruption will occur. Loop initiation words are responsible for checking the stack and guaranteeing that the control parameters are pushed. Any underflows will be detected early if FICL_ROBUST is set to 2 or greater. Note however that Ficl only checks for return stack underflows at the end of each line of text. No problem. Ficl's version of TO works correctly with words defined with:
  • VALUE
  • 2VALUE
  • FVALUE
  • F2VALUE
  • CONSTANT
  • FCONSTANT
  • 2CONSTANT
  • F2CONSTANT
  • VARIABLE
  • 2VARIABLE
as well as with all "local" variables. Ficl prints an error message and executes ABORT Not detected. Results vary depending on the specific problem. The word is postponed correctly. Ficl stores the first FICL_COUNTED_STRING_MAX - 1 characters in the destination buffer. (The extra character is the trailing space required by the standard. Yuck.) Depends on target process or and C runtime library implementations of the << and >> operators on unsigned values. For I386, the processor appears to shift modulo the number of bits in a cell. Undefined. CREATE reserves a field in words it builds for DOES> to fill in. If you use DOES> on a word not made by CREATE it will overwrite the first cell of its parameter area. That's probably not what you want. Likewise, pictured numeric words assume that there is a string under construction in the VM's scratch buffer. If that's not the case, results may be unpleasant.
Default is 64—unused locals are cheap. Change by redefining FICL_MAX_LOCALS (defined in ficl.h).
Locals can be found in interpretation state while in the context of a definition under construction. Under these circumstances, locals behave correctly. Locals are not visible at all outside the scope of a definition. See the CORE ambiguous conditions, above (no change).
SEE de-compiles definitions from the dictionary. Ficl words are stored as a combination of things:
  1. bytecodes (identified as "instructions"),
  2. addresses of native Ficl functions, and
  3. arguments to both of the above.
Colon definitions are decompiled. Branching instructions indicate their destination, but target labels are not reconstructed. Literals and string literals are so noted, and their contents displayed.
Defaults to 16. Can be changed by redefining FICL_MAX_WORDLISTS (declared in ficl.h). Equivalent to FORTH-WORDLIST 1 SET-ORDER
Ficl stores a link to the current definition independently of the compile wordlist while it is being defined, and links it into the compile wordlist only after the definition completes successfully. Changing the compile wordlist mid-definition will cause the definition to link into the new compile wordlist. Ficl prints an error message if the search order underflows, and resets the order to its default state. Ficl prints an error message if the search order overflows, and resets the order to its default state.