Re: The IMMEDIATE mess
- From: "Alex McDonald" <alex_mcd@xxxxxxxxxxxxxxx>
- Date: 29 Aug 2006 14:59:01 -0700
Elizabeth D Rather wrote:
J Thomas wrote:
Andrew Haley wrote:...
J Thomas <jethomas5@xxxxxxxxx> wrote:
Andrew is doing a fine job with this topic, I just want to add a bit.
IMMEDIATE is adequate to a lot of tasks. If you want a word that only
makes sense in compile state, then you can make it with IMMEDIATE . And
you can use your innate good sense not to use it except in compile
state.
If you want the same name to show two different behaviors, one in
interpret state and one in compile state, pretty much your only
portable choice is to write a state-smart word with all the
disadvantages that come with that.
Agree entirely. In 35 years I've yet to have a problem with IMMEDIATE.
In fact, I've been at a loss to understand what "mess" it is you're
worried about.
There are two kinds of disadvantages to state-smart words. One kind
...
So I want to find a way to add the features I want instead of get rid
of existing features. Then as the body of code that uses the old
features ages and code that uses the new features builds up, future
standards can consider those old features obsolescent and finally get
rid of them completely.
What I want is increased ability to choose what to do with a word, at
lookup time.
Known methods that can get this include:
[list snipped]
On the other side there's the question whether these capabilities are
worth having. In each case, it could be argued that they give
programmers too much power. If you give Forth programmers power,
they'll use it.
They'll extend the language in new and tricky ways. A standard does
more than code portability, it also provides programmer portability,
and the more tricky code that's hard to understand, the less
interchangeable the programmers.
You're talking about Tom Cruise-type hot-shots who have to show off.
They probably exist in every language, and are mostly anathema to
serious folks just trying to get work done. I object both to adding
features that cater to the hot shots, and equally to efforts to thwart
them that have the side-effect of hampering the ability of the serious
professionals to get their work done.
...
It's possible I want things I shouldn't want.
Entirely possible. It seems to me that you're being excessively
theoretical in imagining problems where none exist on this issue.
I can't see why you claim "Tom Cruise-type hot-shots" are the only ones
interested in getting this to work. Documenting immediacy was something
that the ANS Forth committee went to great lengths to eliminate
(section A.6.1.2033 POSTPONE);
<quote>
COMPILE was designed to be applied to non-immediate words and [COMPILE]
to immediate words. This burdens the programmer with needing to know
which words in a system are immediate. Consequently, Forth standards
have had to specify the immediacy or non-immediacy of all words covered
by the Standard. This unnecessarily constrains implementors.
</quote>
What makes state-smart words different? If my implementation of word X
can't be POSTPONEd correctly because it's state-smart, but your X can,
that seems to me a fundamental burden on the programmer much worse than
the immediacy problem the standard fixed, as the list of words can very
from system to system -- and they can all still claim ANS compliance
without documenting them. I for one see it to be a problem worthy of
discussion. If serious professionals think otherwise, I'm baffled as to
why they might consider program portability and correctness an optional
feature. Enlightenment, please.
--
Regards
Alex McDonald
.
- Follow-Ups:
- Re: The IMMEDIATE mess
- From: Elizabeth D Rather
- Re: The IMMEDIATE mess
- References:
- The IMMEDIATE mess
- From: J Thomas
- Re: The IMMEDIATE mess
- From: Andrew Haley
- Re: The IMMEDIATE mess
- From: J Thomas
- Re: The IMMEDIATE mess
- From: Andrew Haley
- Re: The IMMEDIATE mess
- From: J Thomas
- Re: The IMMEDIATE mess
- From: Elizabeth D Rather
- The IMMEDIATE mess
- Prev by Date: Re: The IMMEDIATE mess
- Next by Date: Re: INCLUDE and file paths
- Previous by thread: Re: The IMMEDIATE mess
- Next by thread: Re: The IMMEDIATE mess
- Index(es):
Relevant Pages
|