Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.forth > #59729
| From | anton@mips.complang.tuwien.ac.at (Anton Ertl) |
|---|---|
| Newsgroups | comp.lang.forth |
| Subject | Double numbers and floats in the text interpreter (was: FP-Number...) |
| Date | 2017-05-22 16:17 +0000 |
| Organization | Institut fuer Computersprachen, Technische Universitaet Wien |
| Message-ID | <2017May22.181718@mips.complang.tuwien.ac.at> (permalink) |
| References | (2 earlier) <c9d38aae-76ff-4bd1-9266-cb18161dfd90@googlegroups.com> <2017May21.165944@mips.complang.tuwien.ac.at> <db12b0d8-5560-410d-9a29-6a37b6016f14@googlegroups.com> <2017May22.134303@mips.complang.tuwien.ac.at> <33aae2b8-f7c7-41e5-a790-88bcfb963372@googlegroups.com> |
minforth@arcor.de writes:
>Am Montag, 22. Mai 2017 13:56:42 UTC+2 schrieb Anton Ertl:
>So popular Forths follow either "legacy" or "standard" as their particular
>authors like or do not like.
Actually both: They support "0." as double as required by the
standard, and "1.03" as double as allowed (for systems) by the
standard, and as required by legacy programs.
>Indeed the most consistent way would be to declare legacy double number
>recognition obsolete, unless they are casted by some prefix
>(# or [D] perhaps).
#0. is already a standard (Forth-2012) way to write doubles, and it
does not conflict with FP syntax in the wider world.
However, assuming we manage to de-standardize "0.", that is only the
first step. As long as legacy programs continue to use "0." and
"1.23", systems will continue to support this syntax, and cannot
switch to using this syntax for FP.
One way to deal with that would be to prefix the legacy programs with
some word (maybe LEGACY-DOUBLE-SYNTAX) that switches the
interpretation of "0." to mean double, but that means that you cannot
mix the legacy program with new code.
So what is needed IMO is a tool that converts the legacy code into
modern code (e.g., replace "0." with "#0." or "$0.", or maybe some
system-specific non-conflicting syntax, e.g., ".0."). Should not be
hard to write: Just output the input on text interpretation, except
for numbers with the "0." syntax; there the tool outputs the modern
form.
- 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 2017: http://www.euroforth.org/ef17/
Back to comp.lang.forth | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
FP-Number Ambiguities minforth@arcor.de - 2017-05-19 14:06 -0700
Re: FP-Number Ambiguities anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2017-05-20 10:56 +0000
Re: FP-Number Ambiguities minforth@arcor.de - 2017-05-20 11:50 -0700
Re: FP-Number Ambiguities anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2017-05-21 14:59 +0000
Re: FP-Number Ambiguities minforth@arcor.de - 2017-05-21 12:08 -0700
Re: FP-Number Ambiguities mhx@iae.nl - 2017-05-21 12:50 -0700
Re: FP-Number Ambiguities minforth@arcor.de - 2017-05-21 15:04 -0700
Re: FP-Number Ambiguities anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2017-05-22 11:43 +0000
Re: FP-Number Ambiguities minforth@arcor.de - 2017-05-22 06:40 -0700
Re: FP-Number Ambiguities albert@cherry.spenarnc.xs4all.nl (Albert van der Horst) - 2017-05-22 16:33 +0200
Re: FP-Number Ambiguities minforth@arcor.de - 2017-05-22 08:34 -0700
Double numbers and floats in the text interpreter (was: FP-Number...) anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2017-05-22 16:17 +0000
Re: FP-Number Ambiguities pahihu <pahihu@gmail.com> - 2017-05-24 10:19 -0700
Re: FP-Number Ambiguities minforth@arcor.de - 2017-05-24 11:21 -0700
Re: FP-Number Ambiguities pahihu <pahihu@gmail.com> - 2017-05-24 12:13 -0700
Re: FP-Number Ambiguities minforth@arcor.de - 2017-05-24 13:12 -0700
Re: FP-Number Ambiguities (answer imported from future) Jan Coombs <jenfhaomndgfwutc@murmic.plus.com> - 2017-05-20 22:54 +0100
Re: FP-Number Ambiguities "HAA" <someone@microsoft.com> - 2017-05-24 17:21 +1000
Re: FP-Number Ambiguities minforth@arcor.de - 2017-05-24 01:11 -0700
Re: FP-Number Ambiguities "HAA" <someone@microsoft.com> - 2017-05-25 12:28 +1000
Re: FP-Number Ambiguities minforth@arcor.de - 2017-05-25 00:36 -0700
csiph-web