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


Groups > comp.lang.forth > #41145

Re: RFD: Quotations V2 update

From anton@mips.complang.tuwien.ac.at (Anton Ertl)
Newsgroups comp.lang.forth
Subject Re: RFD: Quotations V2 update
Date 2015-08-06 13:46 +0000
Organization Institut fuer Computersprachen, Technische Universitaet Wien
Message-ID <2015Aug6.154634@mips.complang.tuwien.ac.at> (permalink)
References (2 earlier) <mprds9$pp7$1@dont-email.me> <mpssge$30m$1@dont-email.me> <mpt07i$hpm$1@dont-email.me> <2015Aug5.144641@mips.complang.tuwien.ac.at> <mpu8n6$nr9$1@dont-email.me>

Show all headers | View raw


Bernd Paysan <bernd.paysan@gmx.de> writes:
>Anton Ertl wrote:
>> When I made the suggestion, I thought that it is possible, but on more
>> thought, I don't think it is, because the compilation semantics of [:
>> ... ;] appends the xt to the current definition, and we would not want
>> that as interpretation semantics; instead, we want the interpretation
>> semantics to push the xt on the stack.  The solution in other such
>> cases is to use a recognizer, but I am not sure if that can work here;
>> the recognizer would have to call the text interpreter and consume
>> several lines.
>
>No, that's too ugly for a recognizer... a recognizer should not do REFILL.

My intuition certainly is that recognizers should be for what is
lexically one word, but already strings defeat this, and maybe we want
to support multi-line strings, too.

Anyway, a recognizer for [: ... ;] does not feel right, but for me the
call to the text interpreter is more of a problem than the REFILL; it
would subvert the Forth-94 principle of not nesting text interpreters
when interpreting from one input source (unlike "]" in some Forth
systems).

One could have just [: as a recognizer, to make use of its combination
of parse-time and run-time actions, but that does not feel right,
either.  My idea of a recognizer is that it acts as an automatically
defined word, and somehow [: does not quite fit that; maybe an
implicit literal with the additional effect of starting the
definition.

>Unlike :noname ; IMHO an interpretative [: ;] should revert the previous 
>definition to be current.  I.e.
>
>: bla do something ;
>[: compile something ;] set-compiler
>
>should assign the quotation to bla, not to itself, which :noname ... ; 
>should do.

Should :NONAME do that?  SET-COMPILER is not standardized, so one
could easily have :NONAME preserve the state that SET-COMPILER relies
on.  Two cases involving standard words are:

: foo does> ... ;
create x
:noname ... ; foo

is an ambiguous condition, so a system could decide to let DOES> act
on the last non-:NONAME word.

:noname ... ; immediate

Here the IMMEDIATE has no effect, so this probably does not occur in
real-world programs.

So we can probably change :NONAME ... ; to behave as you want
interpretive [: ... ;] to behave.  Alternatively, have something like
[{ ... }] to explicitly save and restore that state.

- 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.mpeforth.com/euroforth2015/euroforth2015.htm

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


Thread

RFD: Quotations V2 update "Alex McDonald" <blog@rivadpm.com> - 2015-08-04 11:05 +0100
  Re: RFD: Quotations V2 update Mark Wills <markwills1970@gmail.com> - 2015-08-04 04:09 -0700
    Re: RFD: Quotations V2 update Lars Brinkhoff <lars.spam@nocrew.org> - 2015-08-04 13:35 +0200
      Re: RFD: Quotations V2 update "Alex McDonald" <blog@rivadpm.com> - 2015-08-04 13:54 +0100
        Re: RFD: Quotations V2 update "Alex McDonald" <blog@rivadpm.com> - 2015-08-04 14:01 +0100
    Re: RFD: Quotations V2 update "Alex McDonald" <blog@rivadpm.com> - 2015-08-04 13:38 +0100
      Re: RFD: Quotations V2 update Mark Wills <markwills1970@gmail.com> - 2015-08-04 07:37 -0700
  Re: RFD: Quotations V2 update anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2015-08-04 14:23 +0000
    Re: RFD: Quotations V2 update "Alex McDonald" <blog@rivadpm.com> - 2015-08-04 16:09 +0100
      Re: RFD: Quotations V2 update anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2015-08-04 15:38 +0000
        Re: RFD: Quotations V2 update Bernd Paysan <bernd.paysan@gmx.de> - 2015-08-04 22:30 +0200
          Re: RFD: Quotations V2 update "Alex McDonald" <blog@rivadpm.com> - 2015-08-04 23:09 +0100
            Re: RFD: Quotations V2 update Bernd Paysan <bernd.paysan@gmx.de> - 2015-08-05 01:45 +0200
              Re: RFD: Quotations V2 update anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2015-08-05 07:23 +0000
                Re: RFD: Quotations V2 update "Alex McDonald" <blog@rivadpm.com> - 2015-08-05 09:55 +0100
          Re: RFD: Quotations V2 update Gerry Jackson <gerry@jackson9000.fsnet.co.uk> - 2015-08-05 12:03 +0100
            Re: RFD: Quotations V2 update "Alex McDonald" <blog@rivadpm.com> - 2015-08-05 13:50 +0100
              Re: RFD: Quotations V2 update anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2015-08-05 16:07 +0000
              Re: RFD: Quotations V2 update Gerry Jackson <gerry@jackson9000.fsnet.co.uk> - 2015-08-05 20:23 +0100
  Re: RFD: Quotations V2 update Bernd Paysan <bernd.paysan@gmx.de> - 2015-08-04 22:00 +0200
    Re: RFD: Quotations V2 update "Alex McDonald" <blog@rivadpm.com> - 2015-08-04 21:07 +0100
  Re: RFD: Quotations V2 update Gerry Jackson <gerry@jackson9000.fsnet.co.uk> - 2015-08-04 21:53 +0100
    Re: RFD: Quotations V2 update "Alex McDonald" <blog@rivadpm.com> - 2015-08-04 23:22 +0100
      Re: RFD: Quotations V2 update Gerry Jackson <gerry@jackson9000.fsnet.co.uk> - 2015-08-05 12:38 +0100
        Re: RFD: Quotations V2 update "Alex McDonald" <blog@rivadpm.com> - 2015-08-05 13:41 +0100
          Re: RFD: Quotations V2 update anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2015-08-05 12:46 +0000
            Re: RFD: Quotations V2 update Bernd Paysan <bernd.paysan@gmx.de> - 2015-08-06 02:12 +0200
              Re: RFD: Quotations V2 update "Alex McDonald" <blog@rivadpm.com> - 2015-08-06 14:16 +0100
              Re: RFD: Quotations V2 update anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2015-08-06 13:46 +0000
    Re: RFD: Quotations V2 update anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2015-08-05 08:15 +0000
      Re: RFD: Quotations V2 update Gerry Jackson <gerry@jackson9000.fsnet.co.uk> - 2015-08-05 20:31 +0100
        Re: RFD: Quotations V2 update peter.m.falth@gmail.com - 2015-08-05 14:41 -0700
          Re: RFD: Quotations V2 update "Elizabeth D. Rather" <erather@forth.com> - 2015-08-05 18:39 -1000
            Re: RFD: Quotations V2 update peter.m.falth@gmail.com - 2015-08-05 23:22 -0700
        Re: RFD: Quotations V2 update anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2015-08-06 13:19 +0000
          Re: RFD: Quotations V2 update Gerry Jackson <gerry@jackson9000.fsnet.co.uk> - 2015-08-07 22:28 +0100
            Re: RFD: Quotations V2 update Gerry Jackson <gerry@jackson9000.fsnet.co.uk> - 2015-08-07 22:34 +0100
              Re: RFD: Quotations V2 update anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2015-08-08 15:53 +0000
                Re: RFD: Quotations V2 update Gerry Jackson <gerry@jackson9000.fsnet.co.uk> - 2015-08-11 21:16 +0100
            Re: RFD: Quotations V2 update anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2015-08-08 15:39 +0000
              Re: RFD: Quotations V2 update Gerry Jackson <gerry@jackson9000.fsnet.co.uk> - 2015-08-10 12:55 +0100
                Re: RFD: Quotations V2 update anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2015-08-10 12:08 +0000
  Re: RFD: Quotations V2 update hughaguilar96@gmail.com - 2015-08-04 18:09 -0700
    Re: RFD: Quotations V2 update "Alex McDonald" <blog@rivadpm.com> - 2015-08-05 09:22 +0100
    Re: RFD: Quotations V2 update "Alex McDonald" <blog@rivadpm.com> - 2015-08-05 09:53 +0100

csiph-web