Re: Forth 200X and the Hayes tester
- From: Jonah Thomas <j2thomas@xxxxxxxxxx>
- Date: Sat, 9 Jun 2007 04:56:40 -0400
anton@xxxxxxxxxxxxxxxxxxxxxxxxxx (Anton Ertl) wrote:
Jonah Thomas <j2thomas@xxxxxxxxxx> writes:
When we are agreed about behaviors but we argue about what names to
give them -- doesn't that seem somehow trivial? Suppose we had two
solutions:
1. Let the compiler switch around the names' actions as needed. So
compilation can work with minimal changes to source code.
2. Let the text editor modify names as needed. So source code can
look the way you expect and still function correctly.
Then it becomes much less important that we choose one name when
common practice diverges.
Sounds like the Algol 60 approach. Not really an example to follow
(certainly not in this regard, and none of Algol 60s many successful
descendents have done so).
Among other things this would reduce the desired programmer
portability.
In the present case, there is actually no name clash (the locals use
of { is for the compilation semantics, and Forth Inc. could add {
comments as interpretation semantics in their implementation), only
the assumption that programmers could be confused.
I'm seeing this as a repetitive problem. So long as we think about
standards we will have name clashes where different systems use the same
name for different things, and different names for the same thing, and
we argue about which name to use where. In some fraction of cases both
uses for one name or both names for one function will be in enough use
to be painful for the losers to switch. Each time this happens it hurts
the standard and it hurts the Forth community.
If we have methods to easily change names it can only be an improvement.
Wordlists are a good start. To import somebody else's code, set up a
wordlist that defines his special names his way. Add it to the search
order before you import and remove it when you're done.
SYNONYM is a good start. Change the names as you need them.
I'm not sure what coding practices make it easy to change names in
source code. It's moderately bad to have names like TO that are common
in the documentation, since a global replace can corrupt the comments.
(But with literate programming that's easy to prevent, provided the name
isn't used in the documentation. ;) ) It's moderately bad to make
strings that must fit into indepently-fixed-size buffers, since a longer
new name might lead to the string getting truncated. Similarly it's a
little risky to make the new name longer than the old one.
When you change a name you need to change it in all the files you use
which use that name. And of course you need to carefully document the
change in case you miss a file you aren't using now, that you might use
after you've forgotten what the old name did.
I don't know what else.
Sure, programmers are less portable when they have to deal with
different names for the same thing and the same name for different
things than they would be if that never happened. Since it does happen,
and since standardising on one name may not always be the solution, and
since somebody has to deal with legacy code with the old names
regardless, it might make sense to have routine approaches (and perhaps
standard names for some routines) to handle it.
.
- Follow-Ups:
- Re: Forth 200X and the Hayes tester
- From: Peter Knaggs
- Re: Forth 200X and the Hayes tester
- References:
- Forth 200X and the Hayes tester
- From: Gerry
- Re: Forth 200X and the Hayes tester
- From: Marcel Hendrix
- Re: Forth 200X and the Hayes tester
- From: Anton Ertl
- Re: Forth 200X and the Hayes tester
- From: Stephen Pelc
- Re: Forth 200X and the Hayes tester
- From: Elizabeth D Rather
- Re: Forth 200X and the Hayes tester
- From: Stephen Pelc
- Re: Forth 200X and the Hayes tester
- From: Elizabeth D Rather
- Re: Forth 200X and the Hayes tester
- From: Stephen Pelc
- Re: Forth 200X and the Hayes tester
- From: Stephen Pelc
- Re: Forth 200X and the Hayes tester
- From: Jonah Thomas
- Re: Forth 200X and the Hayes tester
- From: Anton Ertl
- Forth 200X and the Hayes tester
- Prev by Date: assembler syntax
- Next by Date: Re: multiple or
- Previous by thread: Re: Forth 200X and the Hayes tester
- Next by thread: Re: Forth 200X and the Hayes tester
- Index(es):
Relevant Pages
|