Proposal: Update rationale for SLITERAL
This page is dedicated to discussing this specific proposal
ContributeContributions
ruv [292] Update rationale for SLITERALProposal2023-03-06 00:03:30
Author
Ruv
Change Log
- 2023-03-06 Initial version
Problem
In the draft 2020-01, the section A.17.6.1.2212 SLITERAL
conflicts with the section 6.1.2165 S"
.
In 2017 it was decided to merge the words FILE S"
and S\"
into the corresponding words in CORE/CORE-EXT (see the minutes 2017 and preceding discussion "Core-ext S\"
should reference File-ext S\"
"). It was implemented in the draft 2020-01.
However, the section A.17.6.1.2212 has not been updated, and it shows an implementation for CORE S"
before 2017, which leads to confusions (it was noticed by Anthony Howe in "Confusion over S"
and SLITERAL
").
Solution
Update the section A.17.6.1.2212 according to the new 6.1.2165. Take into account A.6.1.0190 ."
.
Proposal
Replace the content of the section A.17.6.1.2212 SLITERAL
by the following:
The current functionality of 6.1.2165
S"
may be provided by the following definition:: S" ( "ccc\<quote\>" -- c-addr u | ) [CHAR] " PARSE STATE @ IF POSTPONE SLITERAL THEN ; IMMEDIATE
Note: Depending on the Forth system implementation, this definition may leads to the following environmental restrictions:
- the lifetime of the string returned by the interpretation semantics for
S"
is only valid until the input buffer is refilled or the input source is changed;- the compilation semantics for
S"
that are appended by applyingPOSTPONE
toS"
cannot be performed if the system in interpretation state.
In the section 6.1.2165 S"
, add into the last paragraph, which starts with "See:", at the end before the dot:
, A.17.6.1.2212
SLITERAL