- Foreword
- Proposals Process
- 200x Membership
- 1 Introduction
- 2 Terms, notation, and references
- 3 Usage requirements
- 4 Documentation requirements
- 5 Compliance and labeling
- 6 Glossary
- 7 The optional Block word set
- 8 The optional Double-Number word set
- 9 The optional Exception word set
- 10 The optional Facility word set
- 11 The optional File-Access word set
- 12 The optional Floating-Point word set
- 13 The optional Locals word set
- 14 The optional Memory-Allocation word set
- 15 The optional Programming-Tools word set
- 16 The optional Search-Order word set
- 17 The optional String word set
- 18 The optional Extended-Character word set
- Annex A: Rationale
- Annex B: Bibliography
- Annex C: Compatibility analysis
- Annex D: Portability guide
- Annex E: Reference Implementations
- Annex F: Test Suite
- Annex H: Alphabetic list of words
9 The optional Exception word set
9.1 Introduction
9.2 Additional terms and notation
None.
9.3 Additional usage requirements
9.3.1 THROW values
The THROW values {-255...-1} shall be used only as assigned by this standard. The values {-4095...-256} shall be used only as assigned by a system.
Programs shall not define values for use with THROW in the range {-4095...-1}.
9.3.2 Exception frame
An exception frame is the implementation-dependent set of information recording the current execution state necessary for the proper functioning of CATCH and THROW. It often includes the depths of the data stack and return stack.
9.3.3 Exception stack
A stack used for the nesting of exception frames by CATCH and THROW. It may be, but need not be, implemented using the return stack.
9.3.4 Possible actions on an ambiguous condition
A system choosing to execute THROW when detecting one of the ambiguous conditions listed in table 9.1 shall use the throw code listed there.
See: 3.4.4 Possible actions on an ambiguous condition.
Code Reserved for | Code Reserved for | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
| ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
9.3.5 Exception handling
There are several methods of coupling CATCH and THROW to other procedural nestings. The usual nestings are the execution of definitions, use of the return stack, use of loops, instantiation of locals and nesting of input sources (i.e., with LOAD, EVALUATE, or INCLUDE-FILE).When a THROW returns control to a CATCH, the system shall un-nest not only definitions, but also, if present, locals and input source specifications, to return the system to its proper state for continued execution past the CATCH.
9.4 Additional documentation requirements
9.4.1 System documentation
9.4.1.1 Implementation-defined options
- Values used in the system by 9.6.1.0875 CATCH and 9.6.1.2275 THROW (9.3.1 THROW values, 9.3.4 Possible actions on an ambiguous condition).
9.4.1.2 Ambiguous conditions
- no additional requirements.
9.4.1.3 Other system documentation
- no additional requirements.
9.4.2 Program documentation
- no additional requirements.
9.5 Compliance and labeling
9.5.1 Forth-2012 systems
The phrase "Providing the Exception word set" shall be appended to the label of any Standard System that provides all of the Exception word set.The phrase "Providing name(s) from the Exception Extensions word set" shall be appended to the label of any Standard System that provides portions of the Exception Extensions word set.
The phrase "Providing the Exception Extensions word set" shall be appended to the label of any Standard System that provides all of the Exception and Exception Extensions word sets.
9.5.2 Forth-2012 programs
The phrase "Requiring the Exception word set" shall be appended to the label of Standard Programs that require the system to provide the Exception word set.The phrase "Requiring name(s) from the Exception Extensions word set" shall be appended to the label of Standard Programs that require the system to provide portions of the Exception Extensions word set.
The phrase "Requiring the Exception Extensions word set" shall be appended to the label of Standard Programs that require the system to provide all of the Exception and Exception Extensions word sets.
9.6 Glossary
9.6.1 Exception words
9.6.2 Exception extension words
ContributeContributions
ruv [260] Exception word set is not optional any moreComment2022-08-18 13:50:15
On the 2017 standard meeting the Exception word set was made mandatory to make it possible to remove some ambiguous conditions.
Could somebody point out the corresponding proposal and/or rationale for that?
An alternative way could be to remove the ambiguous conditions in the Exception word set only (by updating the corresponding core sections), or conditionally specify behavior in the core sections, i.e. to throw an exception if the Exception word set is implemented, and declare an ambiguous condition otherwise.