Digest #291 2025-01-23
Contributions
I couldn't find in any standard (fig-forth, ans...) a definition of the word saying how it is implemented, specially where the definition list of the word created using :NONAME is compiled.
In
:NONAME 2 * ;
where "2 *" is compiled? where in memory is literal 2 and * xt? and how long it will be using that memory? is there any way to free the memory?
15.6.2.1909.40 NAME>STRING
says:
The buffer containing c-addr u may be transient and valid until the next invocation of
NAME>STRING
.
What is the point of allowing the returned string to be in a transient buffer? Which implementation approach benefits from that?
In typical implementations, the lifetime of the returned string is the same as the lifetime of nt.
Replies
The traditional implementation is to use the Forth parser. But given the specification, how would you detect the difference? So yes, I think that both kinds of implementations are standard-conforming.
Should the original (presumably incorrect) version of this test still appear here and at F.6.1.2214 SM/REM ?
This web-page shows the contents of the sections 6.1.2214 and F.6.1.2214 in Forth-2012 (pdf) (see also Intro). If this content is changed, it will no longer reflect Forth-2012. I think that only a web-page with erratum (or a special comment in each web-page) can be added to Forth-2012 and here.
See also the issue: Support several versions of the standard in parallel.
Or perhaps N buffer: counts counts N erase