Re: Current standings: Strawpoll: better name for PARSE-WORD
by anton » Thu, 21 Apr 2005 02:10:29 GMT
XXXX@XXXXX.COM (Marcel Hendrix) writes:
PARSE is obviously more appropriate than <WORD> here.
I don't understand that.
Another case for PARSE.
I guess that's supposed to mean "the rest of the line". PARSE would
work equally well here.
Another case for PARSE.
Looks to me like PARSE is more appropriate for the second <WORD> here,
too.
Undocumented, no analysis possible.
That's interesting, because this might be a case where the author
apparently knew about PARSE, and the use of <WORD> with a non-BL
identifier is intentional, not just a bug like in most of the other
cases. But without documentation or usage examples it's hard to tell.
An alternative explanation is that originally there was something else
here, and Marcel introduced <WORD> in his usual way of sprinking
iForthisms over all code he sees:-).
Hmm, I think I'm getting it now: Find the first '"', then the string
we are interested in goes from there to the next '"'. PARSE would be
more appropriate than <WORD> here, too.
Overall, it seems to me that we can divide the usages of <WORD> into
three groups based on the delimiter:
Delimiter BL: Used correctly, BL <WORD> can be replaced with
PARSE-WORD ( -- addr u ).
Delimiter 0: Used correctly, can be replaced with PARSE.
Other delimiters: Bug, should be replaced with PARSE
- 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.complang.tuwien.ac.at/forth/ansforth/forth200x.html