Proposal: Tick and undefined execution semantics - 2
This page is dedicated to discussing this specific proposal
ContributeContributions
StephenPelc [212] Tick and undefined execution semantics - 2Proposal2021-09-08 10:15:49
Tick and undefined execution semantics
Proposal
8 September 2021
Stephen Pelc
Change Log
2021-09-08 Initial version
Problem
The value (xt) returned by ' (tick
) may not be useful for words with no defined execution semantics. Since the development of the ANS-94 standard, two common system behaviors have emerged. Systems based on classical Forth provide some execution semantics for all words and may provide additional functionality, e.g. LOCATE or XREF. A more recent approach is for ' and friends to have an ambiguous condition (or error) for all words without execution semantics.
Previous proposals to modify ' have focused on ' itself. This proposal focuses on the use of the returned xt.
Solution
An implementation dependent result is returned by ' for words with undefined execution semantics.
No current system is disenfranchised. It can continue doing what it already does. It can continue to error, to declare an ambiguous condition or to carry on.
However, an ambigous condition may occur when a value returned by ' for a word with no execution semantics is used.
Proposal
In the glossary entries 6.1.0070 ' (Tick) and 6.1.2510 ['] (BracketTick)
Replace the phrase:
An ambiguous condition exists if name is not found.
by
If name has no execution semantics, the behavior of xt is implementation dependent and may lead to an ambiguous condition.
In the glossary entries 6.2.2295 TO, 6.2.1725 IS, 6.2.0698 ACTION-OF,
replace the phrase:
An ambiguous condition exists if any of POSTPONE, [COMPILE], ' or ['] are applied to TO.
by the phrase:
An ambiguous condition exists if POSTPONE or [COMPILE] are applied to TO.
In the section 4.1.2 Ambiguous conditions
replace the phrase:
attempting to obtain the execution token, (e.g., with 6.1.0070 ', 6.1.1550 FIND, etc. of a definition with undefined interpretation semantics;
by the phrase:
attempting to use the execution token, (e.g., returned by 6.1.0070 ', 6.1.1550 FIND, etc. of a definition with undefined interpretation semantics;