Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.forth > #33810
| From | anton@mips.complang.tuwien.ac.at (Anton Ertl) |
|---|---|
| Newsgroups | comp.lang.forth |
| Subject | Re: VFX error? |
| Date | 2014-10-10 10:39 +0000 |
| Organization | Institut fuer Computersprachen, Technische Universitaet Wien |
| Message-ID | <2014Oct10.123947@mips.complang.tuwien.ac.at> (permalink) |
| References | <5b5849fc-0165-4eef-8ddb-833862c3adde@googlegroups.com> <2014Oct10.093331@mips.complang.tuwien.ac.at> <5437b07e$0$15866$e4fe514c@dreader35.news.xs4all.nl> |
albert@spenarnc.xs4all.nl (Albert van der Horst) writes:
>>As someone else explained, there is a word CD in VFX, and that
>>collides. Prepending a 0 to a hex number is traditional Forth
>>practice to avoid that problem, and used to be recommended for all hex
>>numbers, whether there is a known collision or not. These days you
>>can write $cd (no need to use HEX), and I recommend using that.
>
>I can't see how the $ helps.
It does not conflict with any word that consists of letters only.
>Suppose we have a word to go to a directory with a named string
>
>: cdED ZEN HERE HERE __NR_chdir XOS ?ERRUR ;
>
>use it like
> "euler" cdED
>
>Now define
>
>: $cd PARSE-NAME cdED ;
Sure, you can define words with any name, so for any way to recognize
a hex number, you could contrive a word that shadows a hex number.
However, words consisting of letters only are much more common, and
there is no word in the standard that starts with $.
$ is used as hex prefix in a number of assemblers, and more
importantly, it was in wide use in Forth systems as hex prefix when I
made the proposal. Ok, $ is used as string prefix in BASIC and
(probably inspired by that) by some Forth programmers, but, as
discussed above, there is no absolutely safe alternative, and the $
prefix looked best and still looks best to me, given all the things to
consider.
- 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 2014: http://www.euroforth.org/ef14/
Back to comp.lang.forth | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
VFX error? jzakiya@gmail.com - 2014-10-09 21:47 -0700
Re: VFX error? Michael Barry <barrym95838@yahoo.com> - 2014-10-09 22:08 -0700
Re: VFX error? Bruno Gauthier <bgauthier@free.fr> - 2014-10-10 07:17 +0200
Re: VFX error? anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2014-10-10 07:33 +0000
Re: VFX error? albert@spenarnc.xs4all.nl (Albert van der Horst) - 2014-10-10 10:10 +0000
Re: VFX error? anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2014-10-10 10:39 +0000
Re: VFX error? "Rod Pemberton" <buzzoff@nonamewhichexists.cmm> - 2014-10-17 22:04 -0400
Re: VFX error? Andrew Haley <andrew29@littlepinkcloud.invalid> - 2014-10-10 03:06 -0500
Re: VFX error? francois.ganza@wanadoo.fr - 2014-10-10 01:47 -0700
Re: VFX error? anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2014-10-10 10:36 +0000
Re: VFX error? stephenXXX@mpeforth.com (Stephen Pelc) - 2014-10-10 13:34 +0000
Re: VFX error? albert@spenarnc.xs4all.nl (Albert van der Horst) - 2014-10-10 15:09 +0000
Re: VFX error? stephenXXX@mpeforth.com (Stephen Pelc) - 2014-10-10 13:26 +0000
Re: VFX error? jzakiya@gmail.com - 2014-10-10 12:41 -0700
Re: VFX error? "Rod Pemberton" <buzzoff@nonamewhichexists.cmm> - 2014-10-17 22:09 -0400
Re: VFX error? Just Ian <superian@gmail.com> - 2014-10-22 08:25 -0700
Re: VFX error? Coos Haak <chforth@hccnet.nl> - 2014-10-22 21:14 +0200
Re: VFX error? albert@spenarnc.xs4all.nl (Albert van der Horst) - 2014-10-22 20:40 +0000
Re: VFX error? hughaguilar96@yahoo.com - 2014-10-22 20:14 -0700
Re: VFX error? francois.ganza@wanadoo.fr - 2014-10-11 15:31 -0700
Re: VFX error? Julian Fondren <julian.fondren@gmail.com> - 2014-10-11 21:04 -0700
csiph-web