mhx@iae.nl (mhx) writes:
FYI: END is the name of a cursor-control key.
Yes, the one that was standardized as K-END.
I don't think anything can be done to catch this kind of Forth
mistake (using word names that are defined on the target system
but have a different meaning there then on the host).
There are certainly things that could be done, it's just that not
enough Forth system implementors implement the necessary features (not
that implementing them would be particularly burdensome) and
consequently Forth programmers don't do the things that could be done.
In particular, we have "extension queries" <
http://www.forth200x.org/extension-query.html>. So if dxf had made a
proposal for END and continued it to the CfV stage in the old
Forth200x process, there would be a unique extension name that could
be queried for, and one could then take appropriate action if the
system does not support dxf's END.
The CfV system has had a hiatus for several years when the process
converted to Web 2.0 and now is starting up again, but given the lack
of interest from system implementors in wordset queries and extension
queries up to now, I expect that we will not see a revival of the
extension queries.
The Forth community seems to have settled on [DEFINED] and [UNDEFINED]
being good enough, but END demonstrates that they are not.
For comparison, the C people have their "#include"s which allows them
to define sets of names, but in addition they have feature test macros <
https://www.gnu.org/software/libc/manual/html_node/Feature-Test-Macros.html>, which you define before the "#include" to tell the include file which
version of the sets of names defined in the file you want to have.
Admittedly they have a bigger problem: compilation fails if the same
name is declared twice with incompatible types, or if it is defined
twice. But I think this more rigid discipline in C also comes from
there being billions of lines of C code rather than a few million like
Forth, much of which is system-specific anyway. They want any name
conflicts to show up during compilation, instead of getting a spurious
success like dxf's SORTI3 compiling on iForth.
- anton
--
M. Anton Ertl
http://www.complang.tuwien.ac.at/anton/home.html
comp.lang.forth FAQs:
http://www.complang.tuwien.ac.at/forth/faq/toc.html
New standard:
https://forth-standard.org/
EuroForth 2023:
https://euro.theforth.net/2023
--- SoupGate-Win32 v1.05
* Origin: fsxNet Usenet Gateway (21:1/5)