Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.forth > #52412 > unrolled thread
| Started by | minforth@arcor.de |
|---|---|
| First post | 2016-11-03 09:37 -0700 |
| Last post | 2016-11-04 17:09 +0000 |
| Articles | 6 — 3 participants |
Back to article view | Back to comp.lang.forth
Word lists and word sets minforth@arcor.de - 2016-11-03 09:37 -0700
Re: Word lists and word sets Mark Wills <markwills1970@gmail.com> - 2016-11-03 14:25 -0700
Re: Word lists and word sets anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2016-11-03 22:40 +0000
Re: Word lists and word sets anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2016-11-03 21:57 +0000
Re: Word lists and word sets minforth@arcor.de - 2016-11-04 06:59 -0700
Re: Word lists and word sets anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2016-11-04 17:09 +0000
| From | minforth@arcor.de |
|---|---|
| Date | 2016-11-03 09:37 -0700 |
| Subject | Word lists and word sets |
| Message-ID | <5cae7f30-610d-48d2-82b6-16cc208326ac@googlegroups.com> |
I am not really familiar with the Standard. I am wondering about: is there any real correlation between word sets and word lists? After looking it up I gathered that word sets are only word clusters in the standard document. On the other hand they are not independent / orthogonal from each other (f.ex. BLOCK and FILE share disk access, FILE and EXCEPTION share ior exeception identifiers). Then there is this strange word ENVIRONMENT? seemingly without practical usage, because querying word set designators is not much worth in real world applications.
[toc] | [next] | [standalone]
| From | Mark Wills <markwills1970@gmail.com> |
|---|---|
| Date | 2016-11-03 14:25 -0700 |
| Message-ID | <c9314752-df3a-4367-a7a3-775959821564@googlegroups.com> |
| In reply to | #52412 |
On Thursday, 3 November 2016 16:37:27 UTC, minf...@arcor.de wrote: > I am not really familiar with the Standard. I am wondering about: is there any real correlation between word sets and word lists? > > After looking it up I gathered that word sets are only word clusters in the standard document. On the other hand they are not independent / orthogonal from each other (f.ex. BLOCK and FILE share disk access, FILE and EXCEPTION share ior exeception identifiers). > > Then there is this strange word ENVIRONMENT? seemingly without practical usage, because querying word set designators is not much worth in real world applications. ENVIRONMENT? is absolutely pathetic. Get this: It returns strings, but Forth HAS NO STRING COMPARISON words. None. You have to write your own! The committee could have decided to make it return a bit mask of supported functions and standardized the meaning of the bits. But no.
[toc] | [prev] | [next] | [standalone]
| From | anton@mips.complang.tuwien.ac.at (Anton Ertl) |
|---|---|
| Date | 2016-11-03 22:40 +0000 |
| Message-ID | <2016Nov3.234051@mips.complang.tuwien.ac.at> |
| In reply to | #52420 |
Mark Wills <markwills1970@gmail.com> writes:
>ENVIRONMENT? is absolutely pathetic. Get this: It returns strings,
No standard query returns a string
> but
>Forth HAS NO STRING COMPARISON words.
<http://forth-standard.org/standard/string/COMPARE>
- 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 2016: http://www.euroforth.org/ef16/
[toc] | [prev] | [next] | [standalone]
| From | anton@mips.complang.tuwien.ac.at (Anton Ertl) |
|---|---|
| Date | 2016-11-03 21:57 +0000 |
| Message-ID | <2016Nov3.225724@mips.complang.tuwien.ac.at> |
| In reply to | #52412 |
minforth@arcor.de writes:
>I am not really familiar with the Standard. I am wondering about: is there =
>any real correlation between word sets and word lists?
>
>After looking it up I gathered that word sets are only word clusters in the=
> standard document.
Yes.
> On the other hand they are not independent / orthogonal=
> from each other (f.ex. BLOCK and FILE share disk access, FILE and EXCEPTIO=
>N share ior exeception identifiers).
You mean, the wordsets depend on each other?
In Forth-94 (no longer in -2012) a system with FILE words is
guaranteed to support the block words.
There is no dependence between FILE or MEMORY-ACCESS (both of which
produce ior values), and EXCEPTION. If you have THROW from the
EXCEPTION wordset, you can THROW the iors in Forth-2012 (and, if the
system follows the recommendation in FOrth-94, also in Forth-94).
>Then there is this strange word ENVIRONMENT? seemingly without practical us=
>age, because querying word set designators is not much worth in real world =
>applications.
One potential use of querying for wordsets could have been to give an
indication to the system that the program uses the wordset and that it
should load it right away and report it present. However,none of the
mainstream Forth systems work that way: Gforth contains everything
from the start, and SwiftForth and VFX don't take the hint, and in a
display of ultimate user-friendlyness require the user to divine the
system-specific magic incantation for loading the missing wordsets.
So, because wordset queries were neglected by systems, and
consequently, also by programmers, in Forth-94, in Forth-2012 we made
them obsolescent rather than updating them. There is now also
[DEFINED] and [UNDEFINED], which, while not telling whether the
queried word corresponds to the Forth standard, at least gives a
definitive answer instead of the don't-know result that ENVIRONMENT?
may produce.
ENVIRONMENT? also has other uses besides wordset queries. E.g., you
can use it to query for various sizes.
- 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 2016: http://www.euroforth.org/ef16/
[toc] | [prev] | [next] | [standalone]
| From | minforth@arcor.de |
|---|---|
| Date | 2016-11-04 06:59 -0700 |
| Message-ID | <5d2b244f-470c-443c-a560-dac171874d26@googlegroups.com> |
| In reply to | #52412 |
Thanks for your responses. So I can forget ENVIRONMENT? (and while I am at it forget FORGET as well) ;-) And it does not make much sense to select some wordsets for a system implementation without implementing exceptions (which can be a can of worms when one has to close files or i/o channels after exceptions). So IMO it would have been good to have a more elborated namespace standard, but no whining intended, Forth is for bare metal after all...
[toc] | [prev] | [next] | [standalone]
| From | anton@mips.complang.tuwien.ac.at (Anton Ertl) |
|---|---|
| Date | 2016-11-04 17:09 +0000 |
| Message-ID | <2016Nov4.180911@mips.complang.tuwien.ac.at> |
| In reply to | #52437 |
minforth@arcor.de writes:
>Thanks for your responses.
>
>So I can forget ENVIRONMENT? (and while I am at it forget FORGET as well) ;-)
As a programmer, sure, if you don't need it, ignore it. Of course,
the problem is that if you need it, some systems have pretty useless
implementations. If you have that problem, make it known to the
system providers.
As a system implementor, ENIRONMENT? is a core word, so if you want to
have a standard system, you have to implement it. Whether your
implementation is then useless or useful is a
quality-of-implementation issue.
FORGET is optional, somewhat popular (there was a "save FORGET"
movement that succeeded for Forth-2012 despite FORGET being
obsolescent since Forth-94), but Gforth does not have it and we have
heard few calls for it. So it's up to you.
>And it does not make much sense to select some wordsets for a system implementation without implementing exceptions (which can be a can of worms when one has to close files or i/o channels after exceptions).
I think it's a good idea to implement the exception wordset, and it
does not make much sense not to implement it. Nevertheless, if you
really dislike it, you can leave it away, and the rest of the wordsets
will just work fine. Of course, most programmers using the FILE and
MEMORY wordsets also use THROW, so if you want your system to run
programs by other programmers (and why else would you want to write a
standard system), that's a good practical reason to have EXCEPTION
with both.
As for closing files after exceptional conditions, the exception
wordset allows programmers to actually handle such cases properly,
e.g.:
: open-execute ( c-addr u fam xt -- )
\ xt has stack-effect ( fid -- )
>r open-file throw r> over >r catch r> close-file throw throw ;
There is a small window of vulnerability between OPEN-FILE and CATCH,
and between CATCH and CLOSE-FILE, but in most cases it's much better
than the classical Forth approach of just ABORTing and leaving it to
the user to clean up.
>So IMO it would have been good to have a more elborated namespace standard,
Not sure what name spaces have to do with any of that.
- 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 2016: http://www.euroforth.org/ef16/
[toc] | [prev] | [standalone]
Back to top | Article view | comp.lang.forth
csiph-web