Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.forth > #44089
| From | anton@mips.complang.tuwien.ac.at (Anton Ertl) |
|---|---|
| Newsgroups | comp.lang.forth |
| Subject | Re: Search order at startup |
| Date | 2015-12-05 16:18 +0000 |
| Organization | Institut fuer Computersprachen, Technische Universitaet Wien |
| Message-ID | <2015Dec5.171820@mips.complang.tuwien.ac.at> (permalink) |
| References | <565df3f2$0$23772$e4fe514c@news.xs4all.nl> |
Albert van der Horst <albert@spenarnc.xs4all.nl> writes:
>The other day I tried to load a program in lina using -t
>(case-insensitive and try to load all unknown words).
>
>It didn't work for a program that started:
>"
> vocabulary application
> application also ...
>"
...
>If I load the same application in gforth it loads without
>trouble. I understand why because the initial order in gforth is
>
>Forth Forth Root Forth
>
>So one of the Forth's is replaced by application, no problem.
>
>What I don't know whether this behaviour is required by the
>standard. I couldn't find it anyway.
It's not required. Actually the standard mandates very little (too
little IMO) about the default search order.
>So is this program standard,
I don't think so.
> or is gForth accomodating a legacy
>construct here?
IIRC the reason that Gforth has for putting Forth on the search order
twice is that we also want to accomodate programs written for
fig-Forth vocabulary handling: Fig-Forth just had one CONTEXT
vocabulary instead of a search order, but its vocabularies were
organized such that a new vocabulary also contains the (IIRC) CONTEXT
vocabulary at the time of the definition of the new vocabulary); in
particular, all vocabularies eventually ended in the FORTH
vocabulary. A typical use was:
vocabulary bla
bla definitions
... \ define bla words using words from FORTH and BLA
If you use that code with the Gforth default search order, it will
search BLA, FORTH, and ROOT, and that's what we want.
In Forth-83 (I think) we got a search order, vocabularies did not
include other vocabularies, and we got ALSO, and the typical use
became
vocabulary bla
also bla definitions
For such code you do not need the second FORTH in the search order.
Looking at VFX and SwiftForth, they both have only one FORTH on the
search order.
- 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: http://www.forth200x.org/forth200x.html
EuroForth 2015: http://www.rigwit.co.uk/EuroForth2015/
Back to comp.lang.forth | Previous | Next — Previous in thread | Find similar | Unroll thread
Search order at startup Albert van der Horst <albert@spenarnc.xs4all.nl> - 2015-12-01 19:24 +0000 Re: Search order at startup Bernd Paysan <bernd.paysan@gmx.de> - 2015-12-01 23:16 +0100 Re: Search order at startup anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2015-12-05 16:18 +0000
csiph-web