Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.forth > #46423 > unrolled thread

Decimal Point vs. Decimal Comma

Started byrickman <gnuarm@gmail.com>
First post2016-04-02 17:49 -0400
Last post2016-05-06 20:37 -0400
Articles 20 on this page of 95 — 28 participants

Back to article view | Back to comp.lang.forth


Contents

  Decimal Point vs. Decimal Comma rickman <gnuarm@gmail.com> - 2016-04-02 17:49 -0400
    Re: Decimal Point vs. Decimal Comma anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2016-04-03 06:23 +0000
      Re: Decimal Point vs. Decimal Comma rickman <gnuarm@gmail.com> - 2016-04-03 02:59 -0400
      Re: Decimal Point vs. Decimal Comma Coos Haak <chforth@hccnet.nl> - 2016-04-03 17:33 +0200
        Re: Decimal Point vs. Decimal Comma "Elizabeth D. Rather" <erather@forth.com> - 2016-04-03 21:21 -1000
          Re: Decimal Point vs. Decimal Comma Paul Rubin <no.email@nospam.invalid> - 2016-04-04 01:42 -0700
            Re: Decimal Point vs. Decimal Comma hughaguilar96@gmail.com - 2016-04-04 02:00 -0700
              Re: Decimal Point vs. Decimal Comma Albert van der Horst <albert@spenarnc.xs4all.nl> - 2016-04-04 10:00 +0000
                Re: Decimal Point vs. Decimal Comma hughaguilar96@gmail.com - 2016-04-04 03:04 -0700
                Re: Decimal Point vs. Decimal Comma "Elizabeth D. Rather" <erather@forth.com> - 2016-04-04 11:16 -1000
            Re: Decimal Point vs. Decimal Comma "Elizabeth D. Rather" <erather@forth.com> - 2016-04-03 23:28 -1000
              Re: Decimal Point vs. Decimal Comma Paul Rubin <no.email@nospam.invalid> - 2016-04-04 02:38 -0700
                Re: Decimal Point vs. Decimal Comma "Elizabeth D. Rather" <erather@forth.com> - 2016-04-04 11:09 -1000
              Re: Decimal Point vs. Decimal Comma "HAA" <someone@microsoft.com> - 2016-04-08 00:18 +1000
                Re: Decimal Point vs. Decimal Comma Andrew Haley <andrew29@littlepinkcloud.invalid> - 2016-04-08 03:27 -0500
                  Re: Decimal Point vs. Decimal Comma anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2016-04-08 08:30 +0000
                    Re: Decimal Point vs. Decimal Comma Ron Aaron <rambamist@gmail.com> - 2016-04-08 12:00 +0300
                      Re: Decimal Point vs. Decimal Comma anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2016-04-08 10:25 +0000
                        Re: Decimal Point vs. Decimal Comma Ron Aaron <rambamist@gmail.com> - 2016-04-08 13:34 +0300
                          Re: Decimal Point vs. Decimal Comma anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2016-04-08 11:46 +0000
                            Re: Decimal Point vs. Decimal Comma Ron Aaron <rambamist@gmail.com> - 2016-04-08 15:20 +0300
                    Re: Decimal Point vs. Decimal Comma Andrew Haley <andrew29@littlepinkcloud.invalid> - 2016-04-08 04:08 -0500
                      Re: Decimal Point vs. Decimal Comma anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2016-04-08 10:26 +0000
                        Re: Decimal Point vs. Decimal Comma Andrew Haley <andrew29@littlepinkcloud.invalid> - 2016-04-08 10:37 -0500
                          Re: Decimal Point vs. Decimal Comma anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2016-04-09 15:28 +0000
                            Re: Decimal Point vs. Decimal Comma Paul Rubin <no.email@nospam.invalid> - 2016-04-09 10:17 -0700
                              Re: Decimal Point vs. Decimal Comma anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2016-04-11 14:45 +0000
                                Re: Decimal Point vs. Decimal Comma Ron Aaron <rambamist@gmail.com> - 2016-04-12 10:18 +0300
                        Re: Decimal Point vs. Decimal Comma hughaguilar96@gmail.com - 2016-04-08 09:05 -0700
                          Re: Decimal Point vs. Decimal Comma hughaguilar96@gmail.com - 2016-04-08 10:14 -0700
                            Re: Decimal Point vs. Decimal Comma Julian Fondren <julian.fondren@gmail.com> - 2016-04-08 15:51 -0700
                              Re: Decimal Point vs. Decimal Comma Julian Fondren <julian.fondren@gmail.com> - 2016-04-08 16:11 -0700
                          Re: Decimal Point vs. Decimal Comma "WJ" <w_a_x_man@yahoo.com> - 2016-05-09 01:16 +0000
                        Re: Decimal Point vs. Decimal Comma Bernd Paysan <bernd.paysan@gmx.de> - 2016-04-08 22:18 +0000
                          Re: Decimal Point vs. Decimal Comma Paul Rubin <no.email@nospam.invalid> - 2016-04-08 20:33 -0700
                            Re: Decimal Point vs. Decimal Comma mhx@iae.nl - 2016-04-09 01:20 -0700
                              Re: Decimal Point vs. Decimal Comma anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2016-04-09 11:03 +0000
                            Re: Decimal Point vs. Decimal Comma mhx@iae.nl - 2016-04-09 01:29 -0700
                          Double and FP syntax (was: Decimal Point vs. Decimal Comma) anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2016-04-09 09:19 +0000
                            Re: Double and FP syntax "Elizabeth D. Rather" <erather@forth.com> - 2016-04-09 14:25 -1000
                              Re: Double and FP syntax hughaguilar96@gmail.com - 2016-04-10 21:48 -0700
                            Re: Double and FP syntax (was: Decimal Point vs. Decimal Comma) stephen@mpeforth.com (Stephen Pelc) - 2016-04-15 10:17 +0000
                              Re: Double and FP syntax (was: Decimal Point vs. Decimal Comma) hughaguilar96@gmail.com - 2016-04-17 16:48 -0700
                              Re: Double and FP syntax (was: Decimal Point vs. Decimal Comma) anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2016-04-24 16:03 +0000
          Re: Decimal Point vs. Decimal Comma Albert van der Horst <albert@spenarnc.xs4all.nl> - 2016-04-04 09:27 +0000
        Re: Decimal Point vs. Decimal Comma Albert van der Horst <albert@spenarnc.xs4all.nl> - 2016-04-04 08:52 +0000
      Re: Decimal Point vs. Decimal Comma Bernd Paysan <bernd.paysan@gmx.de> - 2016-04-03 23:14 +0000
        Re: Decimal Point vs. Decimal Comma Ron Aaron <rambamist@gmail.com> - 2016-04-04 07:18 +0300
          Re: Decimal Point vs. Decimal Comma Ron Aaron <rambamist@gmail.com> - 2016-04-04 07:48 +0300
    Re: Decimal Point vs. Decimal Comma upsidedown@downunder.com - 2016-04-03 09:45 +0300
    Re: Decimal Point vs. Decimal Comma Nils M Holm <nmh@ananda.local> - 2016-04-03 07:32 +0000
    Re: Decimal Point vs. Decimal Comma George Neuner <gneuner2@comcast.net> - 2016-04-03 05:25 -0400
      Re: Decimal Point vs. Decimal Comma Robert Wessel <robertwessel2@yahoo.com> - 2016-04-03 17:22 -0500
    Re: Decimal Point vs. Decimal Comma Norbert_Paul <norbertpauls_spambin@yahoo.com> - 2016-04-03 14:05 +0200
    Re: Decimal Point vs. Decimal Comma Hans-Bernhard Bröker <HBBroeker@t-online.de> - 2016-04-03 14:18 +0200
      Re: Decimal Point vs. Decimal Comma upsidedown@downunder.com - 2016-04-03 20:24 +0300
        Re: Decimal Point vs. Decimal Comma Niklas Holsti <niklas.holsti@tidorum.invalid> - 2016-04-03 21:05 +0300
          Re: Decimal Point vs. Decimal Comma Albert van der Horst <albert@spenarnc.xs4all.nl> - 2016-04-04 09:00 +0000
        Re: Decimal Point vs. Decimal Comma Ron Aaron <rambamist@gmail.com> - 2016-04-03 21:16 +0300
          Re: Decimal Point vs. Decimal Comma Albert van der Horst <albert@spenarnc.xs4all.nl> - 2016-04-04 09:17 +0000
            Re: Decimal Point vs. Decimal Comma Ron Aaron <rambamist@gmail.com> - 2016-04-04 12:46 +0300
              Re: Decimal Point vs. Decimal Comma anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2016-04-05 06:02 +0000
        Re: Decimal Point vs. Decimal Comma Bernd Paysan <bernd.paysan@gmx.de> - 2016-04-03 23:21 +0000
          Re: Decimal Point vs. Decimal Comma anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2016-04-04 07:11 +0000
            Re: Decimal Point vs. Decimal Comma Bernd Paysan <bernd.paysan@gmx.de> - 2016-04-04 21:11 +0000
        Re: Decimal Point vs. Decimal Comma hughaguilar96@gmail.com - 2016-04-03 19:27 -0700
        Re: Decimal Point vs. Decimal Comma Robert Wessel <robertwessel2@yahoo.com> - 2016-04-04 00:13 -0500
          Re: Decimal Point vs. Decimal Comma "Boudewijn Dijkstra" <sp4mtr4p.boudewijn@indes.com> - 2016-04-04 14:06 +0200
        Re: Decimal Point vs. Decimal Comma Nobody <nobody@nowhere.invalid> - 2016-04-05 03:32 +0100
          Re: Decimal Point vs. Decimal Comma hughaguilar96@gmail.com - 2016-04-04 19:52 -0700
          Re: Decimal Point vs. Decimal Comma upsidedown@downunder.com - 2016-04-05 09:56 +0300
            Re: Decimal Point vs. Decimal Comma hughaguilar96@gmail.com - 2016-04-05 00:13 -0700
              Re: Decimal Point vs. Decimal Comma anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2016-04-05 09:44 +0000
                Re: Decimal Point vs. Decimal Comma Albert van der Horst <albert@spenarnc.xs4all.nl> - 2016-04-05 12:38 +0000
            Re: Decimal Point vs. Decimal Comma Albert van der Horst <albert@spenarnc.xs4all.nl> - 2016-04-05 10:03 +0000
              Re: Decimal Point vs. Decimal Comma Bernd Paysan <bernd.paysan@gmx.de> - 2016-04-05 21:42 +0000
            Re: Decimal Point vs. Decimal Comma George Neuner <gneuner2@comcast.net> - 2016-04-05 11:11 -0400
              Re: Decimal Point vs. Decimal Comma Andrew Haley <andrew29@littlepinkcloud.invalid> - 2016-04-05 11:33 -0500
              Re: Decimal Point vs. Decimal Comma hughaguilar96@gmail.com - 2016-04-05 11:58 -0700
              Re: Decimal Point vs. Decimal Comma anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2016-04-06 12:50 +0000
          Re: Decimal Point vs. Decimal Comma anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2016-04-05 07:15 +0000
            Re: Decimal Point vs. Decimal Comma hughaguilar96@gmail.com - 2016-04-05 01:12 -0700
            Re: Decimal Point vs. Decimal Comma Bernd Paysan <bernd.paysan@gmx.de> - 2016-04-05 21:50 +0000
              Re: Decimal Point vs. Decimal Comma Dimiter_Popoff <dp@tgi-sci.com> - 2016-04-06 01:18 +0300
                Re: Decimal Point vs. Decimal Comma hughaguilar96@gmail.com - 2016-04-05 23:47 -0700
                Re: Decimal Point vs. Decimal Comma Bernd Paysan <bernd.paysan@gmx.de> - 2016-04-08 23:11 +0000
                  Re: Decimal Point vs. Decimal Comma Dimiter_Popoff <dp@tgi-sci.com> - 2016-04-09 03:19 +0300
                    Re: Decimal Point vs. Decimal Comma hughaguilar96@gmail.com - 2016-04-08 22:06 -0700
                    Re: Decimal Point vs. Decimal Comma mac <acolvin@efunct.com> - 2016-04-11 18:52 +0000
                      Re: Decimal Point vs. Decimal Comma Dimiter_Popoff <dp@tgi-sci.com> - 2016-04-11 23:39 +0300
    Re: Decimal Point vs. Decimal Comma endlessboomcapitalism@gmail.com - 2016-05-02 15:29 -0700
      Re: Decimal Point vs. Decimal Comma rickman <gnuarm@gmail.com> - 2016-05-02 22:27 -0400
        Re: Decimal Point vs. Decimal Comma Gerard Sontag <gerardsontag@gmail.com> - 2016-05-03 05:06 -0700
        Re: Decimal Point vs. Decimal Comma Bernd Paysan <bernd.paysan@gmx.de> - 2016-05-06 23:42 +0000
          Re: Decimal Point vs. Decimal Comma rickman <gnuarm@gmail.com> - 2016-05-06 20:37 -0400

Page 1 of 5  [1] 2 3 4 5  Next page →


#46423 — Decimal Point vs. Decimal Comma

Fromrickman <gnuarm@gmail.com>
Date2016-04-02 17:49 -0400
SubjectDecimal Point vs. Decimal Comma
Message-ID<ndpeif$7og$1@dont-email.me>
I know that roughly half the world uses a period to separate the 
fractional part of a number from the integer part.  Roughly half the 
world uses a comma for the same purpose.  But what about in computer 
languages?  A little research showed that Algol was specified to work 
with either.  Other computer languages seem to work primarily or 
exclusively with a period (point).

Are there any languages that support both formats without special 
programming?

-- 

Rick

[toc] | [next] | [standalone]


#46431

Fromanton@mips.complang.tuwien.ac.at (Anton Ertl)
Date2016-04-03 06:23 +0000
Message-ID<2016Apr3.082356@mips.complang.tuwien.ac.at>
In reply to#46423
rickman <gnuarm@gmail.com> writes:
>I know that roughly half the world uses a period to separate the 
>fractional part of a number from the integer part.  Roughly half the 
>world uses a comma for the same purpose.  But what about in computer 
>languages?  A little research showed that Algol was specified to work 
>with either.

Not really.  Algol 60 (not sure about 68) did not specify the concrete
representation of the lexemes.  So one compiler could accept 123.45
and a different compiler could accept 123,45 as concrete syntax of the
same number.  But the compilers would not necessarily accept the other
syntax.  A typical standardization cockup.

>Are there any languages that support both formats without special 
>programming?

Some Forth implementations do.  E.g., SwiftForth and bigForth:

                       ANS bigFORTH 386-Linux rev. 2.3.1

123.45 d. 12345  ok
123,45 d. 12345  ok

A very early version of Gforth also worked that way, but I removed
this feature, because it's more important to be able to get a useful
error message if you use "2,", but the Forth system does not define
it.  I have not missed this feature, and I come from the part of the
world that uses decimal comma.

- 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 2015: http://www.rigwit.co.uk/EuroForth2015/

[toc] | [prev] | [next] | [standalone]


#46433

Fromrickman <gnuarm@gmail.com>
Date2016-04-03 02:59 -0400
Message-ID<ndqeq8$v03$1@dont-email.me>
In reply to#46431
On 4/3/2016 2:23 AM, Anton Ertl wrote:
> rickman <gnuarm@gmail.com> writes:
>> I know that roughly half the world uses a period to separate the
>> fractional part of a number from the integer part.  Roughly half the
>> world uses a comma for the same purpose.  But what about in computer
>> languages?  A little research showed that Algol was specified to work
>> with either.
>
> Not really.  Algol 60 (not sure about 68) did not specify the concrete
> representation of the lexemes.  So one compiler could accept 123.45
> and a different compiler could accept 123,45 as concrete syntax of the
> same number.  But the compilers would not necessarily accept the other
> syntax.  A typical standardization cockup.
>
>> Are there any languages that support both formats without special
>> programming?
>
> Some Forth implementations do.  E.g., SwiftForth and bigForth:
>
>                         ANS bigFORTH 386-Linux rev. 2.3.1
>
> 123.45 d. 12345  ok
> 123,45 d. 12345  ok
>
> A very early version of Gforth also worked that way, but I removed
> this feature, because it's more important to be able to get a useful
> error message if you use "2,", but the Forth system does not define
> it.  I have not missed this feature, and I come from the part of the
> world that uses decimal comma.

But neither of these are "correct".  I was talking about the radix point 
that separates the fraction from the integer portion of a number.

-- 

Rick

[toc] | [prev] | [next] | [standalone]


#46445

FromCoos Haak <chforth@hccnet.nl>
Date2016-04-03 17:33 +0200
Message-ID<8sa9z42z9vse$.qj6vwvteh7h9$.dlg@40tude.net>
In reply to#46431
Op Sun, 03 Apr 2016 06:23:56 GMT schreef Anton Ertl:

> rickman <gnuarm@gmail.com> writes:
>>I know that roughly half the world uses a period to separate the 
>>fractional part of a number from the integer part.  Roughly half the 
>>world uses a comma for the same purpose.  But what about in computer 
>>languages?  A little research showed that Algol was specified to work 
>>with either.
> 
> Not really.  Algol 60 (not sure about 68) did not specify the concrete
> representation of the lexemes.  So one compiler could accept 123.45
> and a different compiler could accept 123,45 as concrete syntax of the
> same number.  But the compilers would not necessarily accept the other
> syntax.  A typical standardization cockup.
> 
>>Are there any languages that support both formats without special 
>>programming?
> 
> Some Forth implementations do.  E.g., SwiftForth and bigForth:
> 
>                        ANS bigFORTH 386-Linux rev. 2.3.1
> 
> 123.45 d. 12345  ok
> 123,45 d. 12345  ok
> 
> A very early version of Gforth also worked that way, but I removed
> this feature, because it's more important to be able to get a useful
> error message if you use "2,", but the Forth system does not define
> it.  I have not missed this feature, and I come from the part of the
> world that uses decimal comma.
> 
> - anton

To my surprise, the current versions of Gforth have it.
Win32Forth does not have 2,
SF (2011) does not have it either.

groet Coos

[toc] | [prev] | [next] | [standalone]


#46460

From"Elizabeth D. Rather" <erather@forth.com>
Date2016-04-03 21:21 -1000
Message-ID<KuCdnRWVeJBhiJ_KnZ2dnUU7-dvNnZ2d@supernews.com>
In reply to#46445
On 4/3/16 5:33 AM, Coos Haak wrote:
> Op Sun, 03 Apr 2016 06:23:56 GMT schreef Anton Ertl:
>
...
>>> Are there any languages that support both formats without special
>>> programming?
>>
>> Some Forth implementations do.  E.g., SwiftForth and bigForth:
>>
>>                         ANS bigFORTH 386-Linux rev. 2.3.1
>>
>> 123.45 d. 12345  ok
>> 123,45 d. 12345  ok
>>
>> A very early version of Gforth also worked that way, but I removed
>> this feature, because it's more important to be able to get a useful
>> error message if you use "2,", but the Forth system does not define
>> it.  I have not missed this feature, and I come from the part of the
>> world that uses decimal comma.
>>
>> - anton
>
> To my surprise, the current versions of Gforth have it.
> Win32Forth does not have 2,
> SF (2011) does not have it either.

Not sure what you mean by that. In SwiftForth (and all other FORTH, Inc. 
systems since the 70's) 2, is a perfectly good double integer whose 
value is 2.

Cheers,
Elizabeth

-- 
==================================================
Elizabeth D. Rather   (US & Canada)   800-55-FORTH
FORTH Inc.                         +1 310.999.6784
5959 West Century Blvd. Suite 700
Los Angeles, CA 90045
http://www.forth.com

"Forth-based products and Services for real-time
applications since 1973."
==================================================

[toc] | [prev] | [next] | [standalone]


#46462

FromPaul Rubin <no.email@nospam.invalid>
Date2016-04-04 01:42 -0700
Message-ID<87pou5rchs.fsf@nightsong.com>
In reply to#46460
"Elizabeth D. Rather" <erather@forth.com> writes:
> Not sure what you mean by that. In SwiftForth (and all other FORTH,
> Inc. systems since the 70's) 2, is a perfectly good double integer
> whose value is 2.

Interesting, in gforth, 2, (two-comma) writes a double to the heap (like
, , ) and I thought that was standard until checking just now.  But it's
a gforth extension.

[toc] | [prev] | [next] | [standalone]


#46466

Fromhughaguilar96@gmail.com
Date2016-04-04 02:00 -0700
Message-ID<07fb1532-a2d7-4719-88ec-0edcff1b4370@googlegroups.com>
In reply to#46462
On Monday, April 4, 2016 at 1:42:41 AM UTC-7, Paul Rubin wrote:
> "Elizabeth D. Rather" <erather@forth.com> writes:
> > Not sure what you mean by that. In SwiftForth (and all other FORTH,
> > Inc. systems since the 70's) 2, is a perfectly good double integer
> > whose value is 2.
> 
> Interesting, in gforth, 2, (two-comma) writes a double to the heap (like
> , , ) and I thought that was standard until checking just now.  But it's
> a gforth extension.

You mean, writes it to the dictionary (not the heap).

Anyway, that is a bug in gForth --- if you define a number to do something else, that is going to cause a lot of confusion --- maybe later gForth will define 5 to be a function that reformats the hard-disk.

[toc] | [prev] | [next] | [standalone]


#46474

FromAlbert van der Horst <albert@spenarnc.xs4all.nl>
Date2016-04-04 10:00 +0000
Message-ID<57023b25$0$5869$e4fe514c@news.xs4all.nl>
In reply to#46466
hughaguilar96@gmail.com writes:

>On Monday, April 4, 2016 at 1:42:41 AM UTC-7, Paul Rubin wrote:
>> "Elizabeth D. Rather" <erather@forth.com> writes:
>> > Not sure what you mean by that. In SwiftForth (and all other FORTH,
>> > Inc. systems since the 70's) 2, is a perfectly good double integer
>> > whose value is 2.
>>
>> Interesting, in gforth, 2, (two-comma) writes a double to the heap (like
>> , , ) and I thought that was standard until checking just now.  But it's
>> a gforth extension.

>You mean, writes it to the dictionary (not the heap).
>Anyway, that is a bug in gForth --- if you define a number to do
\ something else, that is going to cause a lot of confusion --- maybe
\ later gForth will define 5 to be a function that reformats the
\ hard-disk.

The word 2, is traditionally present in quite a few Forth's of
European origin.
I think it rather a design flaw in Forth itself that words that
work on pairs start with a 2 such that they look like numbers.
(A better choice would've been to use D throughout).
Once you have 2SWAP and 2DUP you're forced to have 2>R and
2R@ then 2@ 2! and lastly 2, .

The best name for 2, is 2, , helas. You cannot blame gforth
for that.

(Most Forth words are numbers in base 64 anyway. D. is already
a HEX double in all standard Forths. If the double number word
set is loadable, and its loading is not synchronous with loading
double number recognition, you've the same problem.)

Groetjes Albert
-- 
Albert van der Horst, UTRECHT,THE NETHERLANDS
Economic growth -- being exponential -- ultimately falters.
albert@spe&ar&c.xs4all.nl &=n http://home.hccnet.nl/a.w.m.van.der.horst

[toc] | [prev] | [next] | [standalone]


#46477

Fromhughaguilar96@gmail.com
Date2016-04-04 03:04 -0700
Message-ID<f525af51-91c6-46ea-8f7c-86e089f98a07@googlegroups.com>
In reply to#46474
On Monday, April 4, 2016 at 3:00:07 AM UTC-7, Albert van der Horst wrote:
> I think it rather a design flaw in Forth itself that words that
> work on pairs start with a 2 such that they look like numbers.
> (A better choice would've been to use D throughout).
> Once you have 2SWAP and 2DUP you're forced to have 2>R and
> 2R@ then 2@ 2! and lastly 2, .

Yes. Michael Barry suggested DSWAP DDUP etc. for Stundurd Forth and I agreed, so that is the way Stundurd Forth is now.

[toc] | [prev] | [next] | [standalone]


#46488

From"Elizabeth D. Rather" <erather@forth.com>
Date2016-04-04 11:16 -1000
Message-ID<C4-dnUtxrekqRJ_KnZ2dnUU7-KXNnZ2d@supernews.com>
In reply to#46474
On 4/4/16 12:00 AM, Albert van der Horst wrote:
> hughaguilar96@gmail.com writes:
>
>> On Monday, April 4, 2016 at 1:42:41 AM UTC-7, Paul Rubin wrote:
>>> "Elizabeth D. Rather" <erather@forth.com> writes:
>>>> Not sure what you mean by that. In SwiftForth (and all other FORTH,
>>>> Inc. systems since the 70's) 2, is a perfectly good double integer
>>>> whose value is 2.
>>>
>>> Interesting, in gforth, 2, (two-comma) writes a double to the heap (like
>>> , , ) and I thought that was standard until checking just now.  But it's
>>> a gforth extension.
>
>> You mean, writes it to the dictionary (not the heap).
>> Anyway, that is a bug in gForth --- if you define a number to do
> \ something else, that is going to cause a lot of confusion --- maybe
> \ later gForth will define 5 to be a function that reformats the
> \ hard-disk.
>
> The word 2, is traditionally present in quite a few Forth's of
> European origin.
> I think it rather a design flaw in Forth itself that words that
> work on pairs start with a 2 such that they look like numbers.
> (A better choice would've been to use D throughout).
> Once you have 2SWAP and 2DUP you're forced to have 2>R and
> 2R@ then 2@ 2! and lastly 2, .
>
> The best name for 2, is 2, , helas. You cannot blame gforth
> for that.
>
> (Most Forth words are numbers in base 64 anyway. D. is already
> a HEX double in all standard Forths. If the double number word
> set is loadable, and its loading is not synchronous with loading
> double number recognition, you've the same problem.)

This why it's a good thing that Forth searches the dictionary before 
attempting number conversion.

Cheers,
Elizabeth


-- 
==================================================
Elizabeth D. Rather   (US & Canada)   800-55-FORTH
FORTH Inc.                         +1 310.999.6784
5959 West Century Blvd. Suite 700
Los Angeles, CA 90045
http://www.forth.com

"Forth-based products and Services for real-time
applications since 1973."
==================================================

[toc] | [prev] | [next] | [standalone]


#46469

From"Elizabeth D. Rather" <erather@forth.com>
Date2016-04-03 23:28 -1000
Message-ID<OvOdnbYrrbVIrp_KnZ2dnUU7-aHNnZ2d@supernews.com>
In reply to#46462
On 4/3/16 10:42 PM, Paul Rubin wrote:
> "Elizabeth D. Rather" <erather@forth.com> writes:
>> Not sure what you mean by that. In SwiftForth (and all other FORTH,
>> Inc. systems since the 70's) 2, is a perfectly good double integer
>> whose value is 2.
>
> Interesting, in gforth, 2, (two-comma) writes a double to the heap (like
> , , ) and I thought that was standard until checking just now.  But it's
> a gforth extension.

 From the SwiftForth manual (and every other manual from us since 1973): 
"Punctuation in a number (decimal point, comma, colon, slash, or dash 
anywhere other than before the leftmost digit) will cause the number to 
be converted as a double number." This is convenient because you can, 
for example, type a date like 4/01/2016 and it will go on the stack as a 
double, to be passed directly to a word that will convert it as a date. 
Likewise times, angles, and other formatted numbers. It's really a very 
convenient convention.

Cheers,
Elizabeth

-- 
==================================================
Elizabeth D. Rather   (US & Canada)   800-55-FORTH
FORTH Inc.                         +1 310.999.6784
5959 West Century Blvd. Suite 700
Los Angeles, CA 90045
http://www.forth.com

"Forth-based products and Services for real-time
applications since 1973."
==================================================

[toc] | [prev] | [next] | [standalone]


#46471

FromPaul Rubin <no.email@nospam.invalid>
Date2016-04-04 02:38 -0700
Message-ID<87lh4tr9wa.fsf@nightsong.com>
In reply to#46469
"Elizabeth D. Rather" <erather@forth.com> writes:
> "Punctuation in a number (decimal point, comma, colon, slash,
> or dash anywhere other than before the leftmost digit) will cause the
> number to be converted as a double number." This is convenient because
> you can, for example, type a date like 4/01/2016...

That's neat, but it relies on a careful definition of punctuation, since
2@ and 2! have been around forever and I would have thought @ and !  are
punctuation too.

[toc] | [prev] | [next] | [standalone]


#46486

From"Elizabeth D. Rather" <erather@forth.com>
Date2016-04-04 11:09 -1000
Message-ID<-NednT9hgrKERZ_KnZ2dnUU7-UvNnZ2d@supernews.com>
In reply to#46471
On 4/3/16 11:38 PM, Paul Rubin wrote:
> "Elizabeth D. Rather" <erather@forth.com> writes:
>> "Punctuation in a number (decimal point, comma, colon, slash,
>> or dash anywhere other than before the leftmost digit) will cause the
>> number to be converted as a double number." This is convenient because
>> you can, for example, type a date like 4/01/2016...
>
> That's neat, but it relies on a careful definition of punctuation, since
> 2@ and 2! have been around forever and I would have thought @ and !  are
> punctuation too.

That is why the manual itemizes the specific characters covered by this 
convention.

Cheers,
Elizabeth

-- 
==================================================
Elizabeth D. Rather   (US & Canada)   800-55-FORTH
FORTH Inc.                         +1 310.999.6784
5959 West Century Blvd. Suite 700
Los Angeles, CA 90045
http://www.forth.com

"Forth-based products and Services for real-time
applications since 1973."
==================================================

[toc] | [prev] | [next] | [standalone]


#46576

From"HAA" <someone@microsoft.com>
Date2016-04-08 00:18 +1000
Message-ID<ne5q76$13oe$1@gioia.aioe.org>
In reply to#46469
Elizabeth D. Rather wrote:
> On 4/3/16 10:42 PM, Paul Rubin wrote:
> > "Elizabeth D. Rather" <erather@forth.com> writes:
> >> Not sure what you mean by that. In SwiftForth (and all other FORTH,
> >> Inc. systems since the 70's) 2, is a perfectly good double integer
> >> whose value is 2.
> >
> > Interesting, in gforth, 2, (two-comma) writes a double to the heap (like
> > , , ) and I thought that was standard until checking just now.  But it's
> > a gforth extension.
>
>  From the SwiftForth manual (and every other manual from us since 1973):
> "Punctuation in a number (decimal point, comma, colon, slash, or dash
> anywhere other than before the leftmost digit) will cause the number to
> be converted as a double number." This is convenient because you can,
> for example, type a date like 4/01/2016 and it will go on the stack as a
> double, to be passed directly to a word that will convert it as a date.
> Likewise times, angles, and other formatted numbers. It's really a very
> convenient convention.
>
> Cheers,
> Elizabeth

A program that accepts a variety of punctuation characters positioned
anywhere within a numeric string isn't convenient.  It's dangerous.
As Forth Standards progressed so did the restrictions on what is
deemed a valid double number.  That was a good thing.


[toc] | [prev] | [next] | [standalone]


#46582

FromAndrew Haley <andrew29@littlepinkcloud.invalid>
Date2016-04-08 03:27 -0500
Message-ID<l6idnZ2zi67_9prKnZ2dnUU7-W2dnZ2d@supernews.com>
In reply to#46576
HAA <someone@microsoft.com> wrote:
> Elizabeth D. Rather wrote:
>>
>>  From the SwiftForth manual (and every other manual from us since 1973):
>> "Punctuation in a number (decimal point, comma, colon, slash, or dash
>> anywhere other than before the leftmost digit) will cause the number to
>> be converted as a double number." This is convenient because you can,
>> for example, type a date like 4/01/2016 and it will go on the stack as a
>> double, to be passed directly to a word that will convert it as a date.
>> Likewise times, angles, and other formatted numbers. It's really a very
>> convenient convention.
> 
> A program that accepts a variety of punctuation characters positioned
> anywhere within a numeric string isn't convenient.  It's dangerous.
> As Forth Standards progressed so did the restrictions on what is
> deemed a valid double number.  That was a good thing.

I disagree.  We're talking about something which has been in use for
forty-odd years, and has not turned out do be dangerous.  I think we'd
know by now if it was.

Andrew.

[toc] | [prev] | [next] | [standalone]


#46583

Fromanton@mips.complang.tuwien.ac.at (Anton Ertl)
Date2016-04-08 08:30 +0000
Message-ID<2016Apr8.103003@mips.complang.tuwien.ac.at>
In reply to#46582
Andrew Haley <andrew29@littlepinkcloud.invalid> writes:
>I disagree.  We're talking about something which has been in use for
>forty-odd years, and has not turned out do be dangerous.  I think we'd
>know by now if it was.

As I already reported, >20 years ago I tried to use "2," as a two-cell
variant of ",", and Gforth did not report an error, but interpreted
the "2," in a (by me) totally unexpected way.

As a reaction to that, Gforth now accepts only numbers with "." as
double numbers.  This has not led to any complaints.  My conclusion is
that other double indicators are not just dangerous, but also
unnecessary.

- 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 2015: http://www.rigwit.co.uk/EuroForth2015/

[toc] | [prev] | [next] | [standalone]


#46584

FromRon Aaron <rambamist@gmail.com>
Date2016-04-08 12:00 +0300
Message-ID<ne7rp2$ii6$1@dont-email.me>
In reply to#46583

On 08/04/2016 11:30, Anton Ertl wrote:

> As I already reported, >20 years ago I tried to use "2," as a two-cell
> variant of ",", and Gforth did not report an error, but interpreted
> the "2," in a (by me) totally unexpected way.
> 
> As a reaction to that, Gforth now accepts only numbers with "." as
> double numbers.  This has not led to any complaints.  My conclusion is
> that other double indicators are not just dangerous, but also
> unnecessary.

Why not look up the word first, before trying to interpret it as a
number?  That's what 8th does - so you can indeed do something like:

: 8 "eight" . ;

[toc] | [prev] | [next] | [standalone]


#46586

Fromanton@mips.complang.tuwien.ac.at (Anton Ertl)
Date2016-04-08 10:25 +0000
Message-ID<2016Apr8.122519@mips.complang.tuwien.ac.at>
In reply to#46584
Ron Aaron <rambamist@gmail.com> writes:
>
>
>On 08/04/2016 11:30, Anton Ertl wrote:
>
>> As I already reported, >20 years ago I tried to use "2," as a two-cell
>> variant of ",", and Gforth did not report an error, but interpreted
>> the "2," in a (by me) totally unexpected way.
...
>Why not look up the word first, before trying to interpret it as a
>number?

That's the standard way to do it in Forth.  It does not help if the
word is not there.

- 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 2015: http://www.rigwit.co.uk/EuroForth2015/

[toc] | [prev] | [next] | [standalone]


#46587

FromRon Aaron <rambamist@gmail.com>
Date2016-04-08 13:34 +0300
Message-ID<ne8198$6f6$1@dont-email.me>
In reply to#46586

On 08/04/2016 13:25, Anton Ertl wrote:
> Ron Aaron <rambamist@gmail.com> writes:
>>

>> Why not look up the word first, before trying to interpret it as a
>> number?
> 
> That's the standard way to do it in Forth.  It does not help if the
> word is not there.

Yes, of course; but if someone defines 2, it would be found before being
interpreted as a double.

So the programmer who needs cross-Forth compatibility needs to do
something like

' 2, not [IF] ... [THEN]

[toc] | [prev] | [next] | [standalone]


#46589

Fromanton@mips.complang.tuwien.ac.at (Anton Ertl)
Date2016-04-08 11:46 +0000
Message-ID<2016Apr8.134655@mips.complang.tuwien.ac.at>
In reply to#46587
Ron Aaron <rambamist@gmail.com> writes:
>So the programmer who needs cross-Forth compatibility needs to do
>something like
>
>' 2, not [IF] ... [THEN]

Sure, or define the word unconditionally.  But I did not want
cross-system compatibility at that point, so that was not the problem.

The problem was that I expected that Gforth, after accepting "2,",
would do one thing, and it actually did something completely
different.  This kind of miscommunication between programmer and
compiler does not happen in a well-designed language, and since "," as
double indicator is non-standard, was easy to fix in this case.
Standardized misfeatures along these lines like "." meaning
double-cell when programmers coming from other languages expect it to
mean FP (or, e.g., the meaning of "if (x=y)" in C) are harder nuts to
crack.

- 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 2015: http://www.rigwit.co.uk/EuroForth2015/

[toc] | [prev] | [next] | [standalone]


Page 1 of 5  [1] 2 3 4 5  Next page →

Back to top | Article view | comp.lang.forth


csiph-web