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


Groups > comp.lang.forth > #35425

Re: RFD Recognizer

From anton@mips.complang.tuwien.ac.at (Anton Ertl)
Newsgroups comp.lang.forth
Subject Re: RFD Recognizer
Date 2015-01-03 12:56 +0000
Organization Institut fuer Computersprachen, Technische Universitaet Wien
Message-ID <2015Jan3.135635@mips.complang.tuwien.ac.at> (permalink)
References <de1bad94-b5e9-468b-9673-9fcb963c1622@googlegroups.com> <QrednZcoJNYbSTrJnZ2dnUU7-Q2dnZ2d@supernews.com>

Show all headers | View raw


Andrew Haley <andrew29@littlepinkcloud.invalid> writes:
>3.  I'm not convinced that it makes any sense to invoke the recognizer
>    mechanism for simple dictionary lookups.  It's a big chunk of
>    overhead for such a critical inner loop.

Dictionary lookup is quite heavy-weight already.  I doubt that the
recognizer mechanism adds a lot of overhead.

>4.  How often does it make sense to have a POSTPONE action for a
>    recognizer?  Right now I can think of no use for it at all.

You can write

POSTPONE 5

instead of

5 POSTPONE LITERAL

or

POSTPONE "hello, world"

instead of

"hello, world" POSTPONE SLITERAL

It becomes particularly interesting if you have a postpone mode.
E.g., instead of

postpone ... 5 postpone literal postpone ...

a postpone mode allows you to write

]] ... [[ 5 ]] literal ... [[

If you have a recognizer with a postpone action for recognizers, you
can write these two lines as

postpone ... postpone 5 postpone ...
]] ... 5 ... [[

>I am rather concerned that most of the more exotic uses for this won't
>make Forth programs any easier to read or write, but are more of the
>unnecessarily "cute" syntactical tricks loved by a subset of Forth
>programmers, especially newbies.  (I have this nagging feeling that
>we may be about to repeat the mistakes of Smalltalk-72, where programs
>parsed their own arguments.

Currently we have words like S" that parse their own arguments, and
that are often implemented as STATE-smart words or, alternatively,
special mechanisms for that purpose.  Recognizers are a way to make
that 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 2014: http://www.euroforth.org/ef14/

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


Thread

RFD Recognizer Matthias Trute <matthias.trute@gmail.com> - 2015-01-02 11:56 -0800
  Re: RFD Recognizer Andrew Haley <andrew29@littlepinkcloud.invalid> - 2015-01-03 05:37 -0600
    Re: RFD Recognizer anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2015-01-03 12:56 +0000
      Re: RFD Recognizer Andrew Haley <andrew29@littlepinkcloud.invalid> - 2015-01-04 04:23 -0600
        Re: RFD Recognizer anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2015-01-04 11:25 +0000
          Re: RFD Recognizer Andrew Haley <andrew29@littlepinkcloud.invalid> - 2015-01-05 04:43 -0600
            Re: RFD Recognizer anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2015-01-05 12:35 +0000
              Re: RFD Recognizer Andrew Haley <andrew29@littlepinkcloud.invalid> - 2015-01-06 10:33 -0600
                Re: RFD Recognizer anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2015-01-07 15:29 +0000
                Re: RFD Recognizer Andrew Haley <andrew29@littlepinkcloud.invalid> - 2015-01-07 12:57 -0600
                Re: RFD Recognizer Matthias Trute <matthias.trute@gmail.com> - 2015-01-07 12:27 -0800
                Re: RFD Recognizer Bernd Paysan <bernd.paysan@gmx.de> - 2015-01-09 00:42 +0100
                Re: RFD Recognizer albert@spenarnc.xs4all.nl (Albert van der Horst) - 2015-01-07 20:55 +0000
    Re: RFD Recognizer Matthias Trute <matthias.trute@gmail.com> - 2015-01-03 06:43 -0800
      Re: RFD Recognizer JennyB <jennybrien@googlemail.com> - 2015-01-03 07:54 -0800
        Re: RFD Recognizer Matthias Trute <matthias.trute@gmail.com> - 2015-01-03 08:37 -0800
          Re: RFD Recognizer JennyB <jennybrien@googlemail.com> - 2015-01-03 10:08 -0800
        Re: RFD Recognizer anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2015-01-04 12:15 +0000
          Re: RFD Recognizer JennyB <jennybrien@googlemail.com> - 2015-01-09 10:15 -0800
            Re: RFD Recognizer Matthias Trute <matthias.trute@gmail.com> - 2015-01-09 12:11 -0800
              Re: RFD Recognizer Bernd Paysan <bernd.paysan@gmx.de> - 2015-01-09 22:46 +0100
      Re: RFD Recognizer Andrew Haley <andrew29@littlepinkcloud.invalid> - 2015-01-04 04:37 -0600
        Re: RFD Recognizer Matthias Trute <matthias.trute@gmail.com> - 2015-01-04 06:32 -0800
          Re: RFD Recognizer Andrew Haley <andrew29@littlepinkcloud.invalid> - 2015-01-05 04:55 -0600
            Re: RFD Recognizer Matthias Trute <matthias.trute@gmail.com> - 2015-01-05 10:06 -0800
      Re: RFD Recognizer albert@spenarnc.xs4all.nl (Albert van der Horst) - 2015-01-04 16:02 +0000
        Re: RFD Recognizer Matthias Trute <matthias.trute@gmail.com> - 2015-01-04 11:06 -0800
          Re: RFD Recognizer JennyB <jennybrien@googlemail.com> - 2015-01-05 08:18 -0800
            Re: RFD Recognizer JennyB <jennybrien@googlemail.com> - 2015-01-05 08:59 -0800
            Re: RFD Recognizer Matthias Trute <matthias.trute@gmail.com> - 2015-01-05 10:23 -0800
              Re: RFD Recognizer anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2015-01-08 15:36 +0000
                Re: RFD Recognizer Matthias Trute <matthias.trute@gmail.com> - 2015-01-08 10:54 -0800
                Re: RFD Recognizer Gerry Jackson <gerry@jackson9000.fsnet.co.uk> - 2015-01-08 20:50 +0000
          Re: RFD Recognizer anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2015-01-08 14:24 +0000
            Re: RFD Recognizer albert@spenarnc.xs4all.nl (Albert van der Horst) - 2015-01-08 16:06 +0000
            Re: RFD Recognizer Bernd Paysan <bernd.paysan@gmx.de> - 2015-01-09 01:11 +0100
        Re: RFD Recognizer Matthias Koch <matthias.koch@hot.uni-hannover.de> - 2015-01-05 17:19 +0100
    Re: RFD Recognizer Bernd Paysan <bernd.paysan@gmx.de> - 2015-01-03 16:08 +0100
    Re: RFD Recognizer hughaguilar96@gmail.com - 2015-01-03 16:05 -0800
      Re: RFD Recognizer Andrew Haley <andrew29@littlepinkcloud.invalid> - 2015-01-04 04:42 -0600
      Re: RFD Recognizer stephen@mpeforth.com (Stephen Pelc) - 2015-01-06 18:01 +0000
    Re: RFD Recognizer albert@spenarnc.xs4all.nl (Albert van der Horst) - 2015-01-04 15:11 +0000
      Re: RFD Recognizer Andrew Haley <andrew29@littlepinkcloud.invalid> - 2015-01-05 05:00 -0600
        Re: RFD Recognizer albert@spenarnc.xs4all.nl (Albert van der Horst) - 2015-01-05 13:39 +0000
          Re: RFD Recognizer Andrew Haley <andrew29@littlepinkcloud.invalid> - 2015-01-06 04:57 -0600
            Re: RFD Recognizer albert@spenarnc.xs4all.nl (Albert van der Horst) - 2015-01-06 18:00 +0000
              Re: RFD Recognizer Andrew Haley <andrew29@littlepinkcloud.invalid> - 2015-01-07 05:13 -0600
                Re: RFD Recognizer albert@spenarnc.xs4all.nl (Albert van der Horst) - 2015-01-07 17:18 +0000
                Re: RFD Recognizer Andrew Haley <andrew29@littlepinkcloud.invalid> - 2015-01-07 13:04 -0600
  Re: RFD Recognizer Julian Fondren <julian.fondren@gmail.com> - 2015-01-04 07:48 -0800
    Re: RFD Recognizer JennyB <jennybrien@googlemail.com> - 2015-01-05 06:01 -0800
      Re: RFD Recognizer anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2015-01-05 14:31 +0000
        Re: RFD Recognizer JennyB <jennybrien@googlemail.com> - 2015-01-05 08:43 -0800
          Re: RFD Recognizer anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2015-01-08 15:22 +0000
        Re: RFD Recognizer Bernd Paysan <bernd.paysan@gmx.de> - 2015-01-06 02:48 +0100
          Re: RFD Recognizer albert@spenarnc.xs4all.nl (Albert van der Horst) - 2015-01-06 03:13 +0000
    Re: RFD Recognizer anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2015-01-08 13:45 +0000
  Re: RFD Recognizer Gerry Jackson <gerry@jackson9000.fsnet.co.uk> - 2015-01-08 20:44 +0000
    Re: RFD Recognizer JennyB <jennybrien@googlemail.com> - 2015-01-17 09:26 -0800
      Re: RFD Recognizer Bernd Paysan <bernd.paysan@gmx.de> - 2015-01-17 18:54 +0100
        Re: RFD Recognizer JennyB <jennybrien@googlemail.com> - 2015-01-17 12:35 -0800
      Re: RFD Recognizer Matthias Trute <matthias.trute@gmail.com> - 2015-01-18 04:16 -0800
        Re: RFD Recognizer albert@spenarnc.xs4all.nl (Albert van der Horst) - 2015-01-18 13:38 +0000
          Re: RFD Recognizer anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2015-01-18 13:56 +0000
            Re: RFD Recognizer JennyB <jennybrien@googlemail.com> - 2015-01-18 07:10 -0800
              Re: RFD Recognizer anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2015-01-18 16:14 +0000
      Re: RFD Recognizer Gerry Jackson <gerry@jackson9000.fsnet.co.uk> - 2015-01-20 18:26 +0000
        Re: RFD Recognizer Bernd Paysan <bernd.paysan@gmx.de> - 2015-01-20 23:54 +0100
          Re: RFD Recognizer JennyB <jennybrien@googlemail.com> - 2015-01-21 09:05 -0800
            Re: RFD Recognizer Bernd Paysan <bernd.paysan@gmx.de> - 2015-01-21 20:50 +0100
            Re: RFD Recognizer albert@spenarnc.xs4all.nl (Albert van der Horst) - 2015-01-22 10:55 +0000

csiph-web