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


Groups > comp.lang.forth > #51331

Re: Essential properties of current standard Forth

From anton@mips.complang.tuwien.ac.at (Anton Ertl)
Newsgroups comp.lang.forth
Subject Re: Essential properties of current standard Forth
Date 2016-09-26 14:04 +0000
Organization Institut fuer Computersprachen, Technische Universitaet Wien
Message-ID <2016Sep26.160453@mips.complang.tuwien.ac.at> (permalink)
References (3 earlier) <8382eca3-ad7a-4e22-8bcd-61bd231b3995@googlegroups.com> <H92dnYnIgd7oGXrKnZ2dnUU7-UXNnZ2d@supernews.com> <e848ccc0-ca59-491e-8ec2-bb517d419782@googlegroups.com> <87mviv8wlh.fsf@jester.gateway.pace.com> <m4qdnYQUnP7nUnXKnZ2dnUU7-dudnZ2d@supernews.com>

Show all headers | View raw


Andrew Haley <andrew29@littlepinkcloud.invalid> writes:
>Paul Rubin <no.email@nospam.invalid> wrote:
>> 
>> Recognizers seem like a good idea, even if there are issues still to
>> work out.
>
>Well, yes, that's the problem.  Lots of things seem like a good idea,
>but have unexpected consequences.  Recognizers are probably the most
>significant change to the Forth language that has (ever?) been
>proposed, so a very high bar should be required for their adoption as
>standard.

On the contrary, recognizers are not a change to the Forth language at
all.  They have been in Forth since day 1.  The very first Forth has
recognized 1 as number.

Ok, you might say, but that does not allow the user to add
recognizers.  However, users have been able to add recognizers of all
kinds to Forth systems for many decades.  E.g., if I look at the
floating point packages of SwiftForth, VFX, and Gforth, I see:

SwiftForth:
: FNUMBER? ( addr len 0 | ... xt -- addr len 0 | ... xt )
   ?DUP ?EXIT  BASE @ 10 = IF
      R-BUF  2DUP R@ PLACE  BL R@ COUNT + C!  R> (REAL) IF
         2DROP ['] FLITERAL  EXIT
   ELSE DROP THEN THEN 0 ;

' FNUMBER? NUMBER-CONVERSION <CHAIN

VFX:
defer old-number?
  action-of number? to-do old-number?

: fnumber?  	\ c-addr -- 0 | n 1 | d 2 | -2 ; F: -- r
\ *G Behaves like the integer version of *\fo{NUMBER?} except
\ ** that if  integer conversion fails, and *\fo{BASE} is decimal,
\ ** a floating point conversion is attempted. If conversion is
\ ** successful, the floating point number is left on the float
\ ** stack and the result code is -2.
  dup >r  old-number? dup 0= if		\ test for integer first
    base @ #10 = if			\ not integer, floats must be in DECIMAL
      drop  r@ count (>float)		\ >FLOAT returns well formed flag
      -2 and				\ good float returns -2,
    then
  then
  r> drop
;

assign fnumber? to-do number?
assign #fliteral to-do c#fliteral

Gforth 0.7.0:
:noname ( c-addr u -- ... xt )
    2dup sfnumber
    IF
	2drop [comp'] FLiteral
    ELSE
	defers compiler-notfound1
    ENDIF ;
IS compiler-notfound1

:noname ( c-addr u -- ... xt )
    2dup sfnumber
    IF
	2drop ['] noop
    ELSE
	defers interpreter-notfound1
    ENDIF ;
IS interpreter-notfound1


And just like the floating point recognizer can be added to these
Forth systems, every other recognizer can be added, too.

What the recognizer proposal does is to add a standardized interface
for adding recognizers and dealing with them, such that portable
libraries can provide recognizers.  But the basic capability has been
there in a non-portable way for decades.  There have been regular
discussions about providing a standardized interface for these
capabilities, demonstrating that there is demand for making such
things portable.  And at one point one of these discussions came up
with an embryonic version of the current recognizer proposal.

If you think that user-defined recognizers are a significant change to
Forth, you should have voiced your concerns when Forth, Inc, added the
NUMBER-CONVERSION chain, MPE made NUMBER? a deferred word (or whatever
it is), and when Gforth added NOTFOUND (the pre-predecessor of
COMPILER-NOTFOUND1 and INTERPRETER-NOTFOUND1).

- 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 2016: http://www.euroforth.org/ef16/

Back to comp.lang.forth | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

Essential properties of current standard Forth anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2016-09-15 14:19 +0000
  Re: Essential properties of current standard Forth hughaguilar96@gmail.com - 2016-09-15 17:58 -0700
    Re: Essential properties of current standard Forth tabcomputing@gmail.com - 2016-09-24 18:48 -0700
      Re: Essential properties of current standard Forth hughaguilar96@gmail.com - 2016-09-24 21:47 -0700
        Re: Essential properties of current standard Forth tabcomputing@gmail.com - 2016-09-25 08:11 -0700
          Re: Essential properties of current standard Forth hughaguilar96@gmail.com - 2016-09-25 20:14 -0700
            Re: Essential properties of current standard Forth albert@cherry.spenarnc.xs4all.nl (Albert van der Horst) - 2016-09-26 11:12 +0200
              Re: Essential properties of current standard Forth Alex <alex@rivadpm.com> - 2016-09-26 12:16 +0100
                Re: Essential properties of current standard Forth albert@cherry.spenarnc.xs4all.nl (Albert van der Horst) - 2016-09-26 14:30 +0200
                Re: Essential properties of current standard Forth Coos Haak <htrofhc@gmail.com> - 2016-09-26 15:10 +0200
                Re: Essential properties of current standard Forth albert@cherry.spenarnc.xs4all.nl (Albert van der Horst) - 2016-09-26 16:07 +0200
                Re: Essential properties of current standard Forth anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2016-09-26 13:43 +0000
                Re: Essential properties of current standard Forth albert@cherry.spenarnc.xs4all.nl (Albert van der Horst) - 2016-09-26 16:36 +0200
        Re: Essential properties of current standard Forth Rod Pemberton <NoHaveNotOne@zxdehrnyya.cam> - 2016-09-25 15:18 -0400
  Re: Essential properties of current standard Forth anotherreepca@gmail.com - 2016-09-18 09:01 -0700
    Re: Essential properties of current standard Forth Cecil Bayona <cbayona@cbayona.com> - 2016-09-18 11:35 -0500
      Re: Essential properties of current standard Forth minforth@arcor.de - 2016-09-19 03:21 -0700
        Re: Essential properties of current standard Forth Andrew Haley <andrew29@littlepinkcloud.invalid> - 2016-09-19 09:49 -0500
          Re: Essential properties of current standard Forth minforth@arcor.de - 2016-09-19 12:38 -0700
            Re: Essential properties of current standard Forth Andrew Haley <andrew29@littlepinkcloud.invalid> - 2016-09-20 11:23 -0500
              Re: Essential properties of current standard Forth lawrencedo99@gmail.com - 2016-09-20 12:55 -0700
                Re: Essential properties of current standard Forth albert@cherry.spenarnc.xs4all.nl (Albert van der Horst) - 2016-09-21 02:24 +0200
              Re: Essential properties of current standard Forth hughaguilar96@gmail.com - 2016-09-20 14:52 -0700
      Re: Essential properties of current standard Forth JUERGEN <epldfpga@aol.com> - 2016-09-19 10:12 -0700
        Re: Essential properties of current standard Forth Cecil Bayona <cbayona@cbayona.com> - 2016-09-19 12:40 -0500
    Re: Essential properties of current standard Forth stephen@mpeforth.com (Stephen Pelc) - 2016-09-21 10:09 +0000
  Re: Essential properties of current standard Forth albert@cherry.spenarnc.xs4all.nl (Albert van der Horst) - 2016-09-19 13:29 +0200
    Re: Essential properties of current standard Forth foxaudioresearch@gmail.com - 2016-09-19 07:16 -0700
    Re: Essential properties of current standard Forth anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2016-09-19 17:10 +0000
  Re: Essential properties of current standard Forth humptydumpty <ouatubi@gmail.com> - 2016-09-20 22:43 -0700
    Re: Essential properties of current standard Forth anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2016-09-21 12:39 +0000
      Re: Essential properties of current standard Forth hughaguilar96@gmail.com - 2016-09-22 11:40 -0700
        Re: Essential properties of current standard Forth humptydumpty <ouatubi@gmail.com> - 2016-09-23 09:28 -0700
      Re: Essential properties of current standard Forth humptydumpty <ouatubi@gmail.com> - 2016-09-23 09:19 -0700
  Re: Essential properties of current standard Forth Paul Rubin <no.email@nospam.invalid> - 2016-09-23 20:11 -0700
    Re: Essential properties of current standard Forth anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2016-09-24 10:55 +0000
      Re: Essential properties of current standard Forth Matthias Trute <matthias.trute@gmail.com> - 2016-09-24 11:14 -0700
        Re: Essential properties of current standard Forth Andrew Haley <andrew29@littlepinkcloud.invalid> - 2016-09-25 03:01 -0500
          Re: Essential properties of current standard Forth Matthias Trute <matthias.trute@gmail.com> - 2016-09-25 02:21 -0700
            Re: Essential properties of current standard Forth lawrencedo99@gmail.com - 2016-09-25 14:01 -0700
            Re: Essential properties of current standard Forth Paul Rubin <no.email@nospam.invalid> - 2016-09-25 15:04 -0700
              Re: Essential properties of current standard Forth lawrencedo99@gmail.com - 2016-09-25 17:39 -0700
                Re: Essential properties of current standard Forth Paul Rubin <no.email@nospam.invalid> - 2016-09-25 17:56 -0700
              Re: Essential properties of current standard Forth Mikael Nordman <oh2aun@gmail.com> - 2016-09-25 20:34 -0700
                Re: Essential properties of current standard Forth Paul Rubin <no.email@nospam.invalid> - 2016-09-25 22:37 -0700
              Re: Essential properties of current standard Forth Andrew Haley <andrew29@littlepinkcloud.invalid> - 2016-09-26 02:34 -0500
                Re: Essential properties of current standard Forth anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2016-09-26 14:04 +0000
                Re: Essential properties of current standard Forth Andrew Haley <andrew29@littlepinkcloud.invalid> - 2016-09-26 10:40 -0500
                Re: Essential properties of current standard Forth anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2016-09-28 06:43 +0000
                Re: Essential properties of current standard Forth Andrew Haley <andrew29@littlepinkcloud.invalid> - 2016-09-28 04:48 -0500
          Re: Essential properties of current standard Forth anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2016-09-26 14:58 +0000
            Re: Essential properties of current standard Forth Andrew Haley <andrew29@littlepinkcloud.invalid> - 2016-09-26 11:02 -0500
              Re: Essential properties of current standard Forth anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2016-09-26 23:28 +0000
                Re: Essential properties of current standard Forth Andrew Haley <andrew29@littlepinkcloud.invalid> - 2016-09-27 03:49 -0500
              Re: Essential properties of current standard Forth Alex <alex@rivadpm.com> - 2016-09-27 11:43 +0100
        Standardization (was: Essential properties of current standard Forth) anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2016-09-26 16:01 +0000
          Re: Standardization (was: Essential properties of current standard Forth) stephen@mpeforth.com (Stephen Pelc) - 2016-09-26 20:06 +0000
            Re: Standardization (was: Essential properties of current standard Forth) anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2016-09-27 14:49 +0000
              Re: Standardization Andrew Haley <andrew29@littlepinkcloud.invalid> - 2016-09-27 11:20 -0500
              Re: Standardization (was: Essential properties of current standard Forth) stephen@mpeforth.com (Stephen Pelc) - 2016-09-28 12:07 +0000
                Re: Standardization (was: Essential properties of current standard Forth) Bernd Paysan <bernd@net2o.de> - 2016-09-29 02:07 +0000
                Re: Standardization (was: Essential properties of current standard Forth) hughaguilar96@gmail.com - 2016-09-28 19:40 -0700
                Re: Standardization (was: Essential properties of current standard Forth) Ilya Tarasov <ilya74.tarasov@gmail.com> - 2016-09-29 15:22 -0700
                Re: Standardization Andrew Haley <andrew29@littlepinkcloud.invalid> - 2016-09-29 04:12 -0500
                Re: Standardization (was: Essential properties of current standard Forth) stephen@mpeforth.com (Stephen Pelc) - 2016-09-29 10:15 +0000
                Re: Standardization (was: Essential properties of current standard Forth) Matthias Trute <matthias.trute@gmail.com> - 2016-09-29 10:38 -0700
      Re: Essential properties of current standard Forth trans <transfire@gmail.com> - 2016-09-26 18:04 -0700
        Re: Essential properties of current standard Forth anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2016-09-27 13:37 +0000
  Re: Essential properties of current standard Forth jim.brakefield@ieee.org - 2016-09-28 13:54 -0700

csiph-web