Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.forth > #19951
| From | anton@mips.complang.tuwien.ac.at (Anton Ertl) |
|---|---|
| Newsgroups | comp.lang.forth |
| Subject | Re: Double integer input |
| Date | 2013-02-23 17:27 +0000 |
| Organization | Institut fuer Computersprachen, Technische Universitaet Wien |
| Message-ID | <2013Feb23.182701@mips.complang.tuwien.ac.at> (permalink) |
| References | (1 earlier) <kg6cg1$a3b$1@speranza.aioe.org> <brWdnQmhLoxDJ7vMnZ2dnUVZ_uKdnZ2d@supernews.com> <kg6fbr$9m5$1@online.de> <2013Feb22.163514@mips.complang.tuwien.ac.at> <kg893n$u6q$1@online.de> |
Bernd Paysan <bernd.paysan@gmx.de> writes:
>Anton Ertl wrote:
>> And there was a specific occasion that lead to taking out "," in
>> Gforth: I wrote a priece of code that used "2,", and it compiled fine
>> but did not work. Eventually I found that Gforth at the time had no
>> word "2,", but it had "," as double indicator. So it saw a double
>> literal instead of the word "2,". With Elisabeth's list, "2-" would
>> be another trap.
>
>Yes, but today, 2- is floating point for 2, just like 2+. We didn't take
>that out, every word that converts to a sensible floating point number with
>>FLOAT is accepted as input.
Actually until recently, there was a check for the syntax of a number
on the Forth level, and it did not accept "2-" as float, so we did
take that out:
Gforth 0.7.0, Copyright (C) 1995-2008 Free Software Foundation, Inc.
Gforth comes with ABSOLUTELY NO WARRANTY; for details type `license'
Type `bye' to exit
2-
:1: Undefined word
>>>2-<<<
Maybe you eliminated that syntax check in your recent work on
recognizers. I think it would be a good idea to put it back in.
>With our new recognizers, we could implement a
><number>+ and <number>- recognizer, which would eliminate that trap, and
>just compile the literal + and literal - instead (* and / as well).
That would also be a possibility, but I wonder if this is not too much
magic for too little benefit.
>Currently, Gforth has dp-char and fp-char, following MPE, which allows us to
>switch to MPE mode, which is ',' for doubles and '.' for float. I'm not
>sure if this is all rigth. My suggestion would be a configuration register
>for dp and fp sepearators, which is a 32 bit mask for the characters between
>$20 and $3F. But all that has the global state disadvantage - you need to
>say which mode you want to be in, when you aren't in standard mode, and when
>your program is a library, you don't want to disturb the users.
If we have a way to properly scope this kind of feature, it may be ok,
otherwise I consider it too dangerous for general consumption.
- 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 2013: http://www.euroforth.org/ef13/
Back to comp.lang.forth | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
Double integer input Rosangela Medeiros da Silva <rosangelamesil@gmail.com> - 2013-02-13 18:15 -0800
Re: Double integer input Rosangela Medeiros da Silva <rosangelamesil@gmail.com> - 2013-02-14 02:07 -0800
Re: Double integer input Coos Haak <chforth@hccnet.nl> - 2013-02-14 16:18 +0100
Re: Double integer input Coos Haak <chforth@hccnet.nl> - 2013-02-14 16:27 +0100
Re: Double integer input "A. K." <akk@nospam.org> - 2013-02-14 20:54 +0100
Re: Double integer input Coos Haak <chforth@hccnet.nl> - 2013-02-14 23:20 +0100
Re: Double integer input "Ed" <invalid@nospam.com> - 2013-02-22 11:00 +1100
Re: Double integer input "Elizabeth D. Rather" <erather@forth.com> - 2013-02-21 14:24 -1000
Re: Double integer input Bernd Paysan <bernd.paysan@gmx.de> - 2013-02-22 01:50 +0100
Re: Double integer input anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2013-02-22 15:35 +0000
Re: Double integer input Bernd Paysan <bernd.paysan@gmx.de> - 2013-02-22 18:15 +0100
Re: Double integer input stephenXXX@mpeforth.com (Stephen Pelc) - 2013-02-22 19:02 +0000
Re: Double integer input anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2013-02-23 17:27 +0000
Re: Double integer input Bernd Paysan <bernd.paysan@gmx.de> - 2013-02-24 03:42 +0100
Re: Double integer input "Elizabeth D. Rather" <erather@forth.com> - 2013-02-22 09:08 -1000
Re: Double integer input anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2013-02-23 16:15 +0000
Re: Double integer input stephenXXX@mpeforth.com (Stephen Pelc) - 2013-02-23 17:35 +0000
Re: Double integer input anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2013-02-25 15:25 +0000
Re: Double integer input albert@spenarnc.xs4all.nl (Albert van der Horst) - 2013-02-23 19:34 +0000
Re: Double integer input "Rod Pemberton" <do_not_have@notemailnotz.cnm> - 2013-02-23 18:35 -0500
Re: Double integer input Andrew Haley <andrew29@littlepinkcloud.invalid> - 2013-02-23 14:58 -0600
Re: Double integer input Zbiggy <zbigniew2011REMOVE@gmail.REMOVE.com> - 2013-02-23 22:01 +0100
Re: Double integer input albert@spenarnc.xs4all.nl (Albert van der Horst) - 2013-02-24 04:03 +0000
Re: Double integer input "Elizabeth D. Rather" <erather@forth.com> - 2013-02-23 18:13 -1000
Re: Double integer input Zbiggy <zbigniew2011REMOVE@gmail.REMOVE.com> - 2013-02-24 12:01 +0100
Re: Double integer input anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2013-02-25 18:09 +0000
Re: Double integer input rickman <gnuarm@gmail.com> - 2013-02-24 15:01 -0500
Re: Double integer input Coos Haak <chforth@hccnet.nl> - 2013-02-25 01:13 +0100
Re: Double integer input Mark Wills <markrobertwills@yahoo.co.uk> - 2013-02-24 23:44 -0800
Re: Double integer input rickman <gnuarm@gmail.com> - 2013-02-27 07:47 -0500
Re: Double integer input Mark Wills <markrobertwills@yahoo.co.uk> - 2013-02-24 23:42 -0800
Re: Double integer input Andrew Haley <andrew29@littlepinkcloud.invalid> - 2013-02-25 03:57 -0600
Re: Double integer input albert@spenarnc.xs4all.nl (Albert van der Horst) - 2013-02-25 14:09 +0000
Re: Double integer input Bernd Paysan <bernd.paysan@gmx.de> - 2013-02-25 16:45 +0100
Re: Double integer input Andrew Haley <andrew29@littlepinkcloud.invalid> - 2013-02-25 18:26 -0600
Re: Double integer input Bernd Paysan <bernd.paysan@gmx.de> - 2013-02-26 02:04 +0100
Re: Double integer input Andrew Haley <andrew29@littlepinkcloud.invalid> - 2013-02-26 05:10 -0600
Re: Double integer input Bernd Paysan <bernd.paysan@gmx.de> - 2013-02-26 15:31 +0100
Re: Double integer input Andrew Haley <andrew29@littlepinkcloud.invalid> - 2013-02-26 10:28 -0600
Re: Double integer input anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2013-02-25 16:38 +0000
Re: Double integer input rickman <gnuarm@gmail.com> - 2013-02-24 14:54 -0500
Re: Double integer input "Elizabeth D. Rather" <erather@forth.com> - 2013-02-24 11:59 -1000
Re: Double integer input anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2013-02-25 18:11 +0000
Re: Double integer input rickman <gnuarm@gmail.com> - 2013-02-27 07:58 -0500
Re: Double integer input anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2013-03-02 17:10 +0000
Re: Double integer input "Ed" <invalid@nospam.com> - 2013-02-22 13:22 +1100
Re: Double integer input "Elizabeth D. Rather" <erather@forth.com> - 2013-02-21 16:31 -1000
Re: Double integer input Alex McDonald <blog@rivadpm.com> - 2013-02-22 04:54 -0800
Re: Double integer input "WJ" <w_a_x_man@yahoo.com> - 2013-02-24 22:05 +0000
Re: Double integer input Paul Rubin <no.email@nospam.invalid> - 2013-02-24 15:02 -0800
Re: Double integer input Brad Eckert <hwfwguy@gmail.com> - 2013-02-25 09:22 -0800
Re: Double integer input Brad Eckert <hwfwguy@gmail.com> - 2013-02-25 10:21 -0800
Re: Double integer input Alex McDonald <blog@rivadpm.com> - 2013-02-26 07:47 -0800
Re: Double integer input "WJ" <w_a_x_man@yahoo.com> - 2013-02-28 06:27 +0000
Re: Double integer input Paul Rubin <no.email@nospam.invalid> - 2013-02-23 21:34 -0800
Re: Double integer input "Elizabeth D. Rather" <erather@forth.com> - 2013-02-24 08:16 -1000
csiph-web