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


Groups > comp.lang.forth > #43755

Re: description of Forth-2012's `synonym`

From anton@mips.complang.tuwien.ac.at (Anton Ertl)
Newsgroups comp.lang.forth
Subject Re: description of Forth-2012's `synonym`
Date 2015-11-25 13:13 +0000
Organization Institut fuer Computersprachen, Technische Universitaet Wien
Message-ID <2015Nov25.141310@mips.complang.tuwien.ac.at> (permalink)
References <n2vu0t$pa0$1@speranza.aioe.org> <n301ri$rkf$1@dont-email.me> <n326pk$3dd$1@speranza.aioe.org> <n333pi$g34$2@dont-email.me> <3a2d26eb-f11d-43b7-b601-6a005da5c763@googlegroups.com>

Show all headers | View raw


Raimond Dragomir <raimond.dragomir@gmail.com> writes:
>> 
>> All the corner cases Anton mentions in his "why state smart is evil" paper.
>> 
>> http://www.complang.tuwien.ac.at/anton/euroforth/ef98/ertl98.pdf
>> 
>
>If you have a clean system where every word has an xt and it is either immediate 
>or non-immediate, there is  no "evil".
>
>My system has the same "problem" with your (Anton's) paper: it just works. 
>And I use state smart words everywhere.
>
>You and Anton just don't want to admit that. That people happen to have
>simple and clean systems that don't have problems with your corner cases...

Let's look at a relatively clean system that has state-smart words not
everywhere, but has implemented S" in a state-smart way; here are some
corner cases where this S" does not work as specified in the standard:

\ for you with [COMPILE] :-)
: ]execute[ ] execute [compile] [ ;
' s" ]execute[ bla" cr type \ should output "bla"
: [s]" [compile] s" ;
: foo [ [s]" bla" ] type ; cr .s \ stack should be empty
0 cr foo drop \ should print "bla"

Here's what happens on this system with the state-smart S":

SwiftForth i386-Linux 3.4.4 31-Jul-2012 
\ for you with [COMPILE] :-)  ok
: ]execute[ ] execute [compile] [ ;  ok
' s" ]execute[ bla" cr type \ should output "bla" 
Stack underflow
: [s]" [compile] s" ;  ok
: foo [ [s]" bla" ] type ; cr .s \ stack should be empty 

134589581 3 <-Top  ok
0 cr foo drop \ should print "bla" 

Some people say that these are only corner cases, and that in practice
these corner cases don't occur, but your claim that such
implementations have no problems even when confronted with corner
cases is new (and wrong).

>I always
>wondered how is it possible that IF to not be immediate?

In the sense of the section 2.1 of the standard, IF is not specified
as immediate word, because no execution semantics is specified for IF,
and the compilation semantics of IF are specified directly without
reference to execution semantics.

In the sense of what FIND returns for IF, a standard system has to
return 1 (immediate) for IF, or one cannot implement a user-defined
text interpreter with this system.  VFX returns -1 (non-immediate),
but allows to implement a user-defined text interpreter by providing a
non-standard COMPILE, (VFX's COMPILE, does not have the stack effect
( xt -- ) for all xts).

- 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/

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


Thread

description of Forth-2012's `synonym` Marcos Cruz <use_the_contact_page@programandala.net> - 2015-11-23 20:47 +0000
  Re: description of Forth-2012's `synonym` Bernd Paysan <bernd.paysan@gmx.de> - 2015-11-23 22:55 +0100
    Re: description of Forth-2012's `synonym` Marcos Cruz <use_the_contact_page@programandala.net> - 2015-11-23 22:20 +0000
      Re: description of Forth-2012's `synonym` anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2015-11-24 05:12 +0000
    Re: description of Forth-2012's `synonym` Marcos Cruz <use_the_contact_page@programandala.net> - 2015-11-24 17:29 +0000
      Re: description of Forth-2012's `synonym` Bernd Paysan <bernd.paysan@gmx.de> - 2015-11-25 02:46 +0100
        Re: description of Forth-2012's `synonym` Raimond Dragomir <raimond.dragomir@gmail.com> - 2015-11-24 22:46 -0800
          Re: description of Forth-2012's `synonym` Mark Wills <markwills1970@gmail.com> - 2015-11-25 01:39 -0800
            Re: description of Forth-2012's `synonym` Raimond Dragomir <raimond.dragomir@gmail.com> - 2015-11-25 02:37 -0800
          Re: description of Forth-2012's `synonym` anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2015-11-25 13:13 +0000
            Re: description of Forth-2012's `synonym` Raimond Dragomir <raimond.dragomir@gmail.com> - 2015-11-25 09:06 -0800
              Re: description of Forth-2012's `synonym` anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2015-11-25 18:33 +0000
                Re: description of Forth-2012's `synonym` Raimond Dragomir <raimond.dragomir@gmail.com> - 2015-11-25 23:01 -0800
                Re: description of Forth-2012's `synonym` anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2015-11-26 07:15 +0000
                Re: description of Forth-2012's `synonym` Raimond Dragomir <raimond.dragomir@gmail.com> - 2015-11-26 02:30 -0800
                Re: description of Forth-2012's `synonym` anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2015-11-26 13:44 +0000
            Re: description of Forth-2012's `synonym` Gerry Jackson <gerry@jackson9000.fsnet.co.uk> - 2015-11-25 17:27 +0000
              Re: description of Forth-2012's `synonym` anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2015-11-26 07:56 +0000
                Re: description of Forth-2012's `synonym` Albert van der Horst <albert@spenarnc.xs4all.nl> - 2015-11-26 11:25 +0000
                Re: description of Forth-2012's `synonym` Bernd Paysan <bernd.paysan@gmx.de> - 2015-11-27 01:36 +0100
                Re: description of Forth-2012's `synonym` Albert van der Horst <albert@spenarnc.xs4all.nl> - 2015-11-27 16:57 +0000
                Re: description of Forth-2012's `synonym` Gerry Jackson <gerry@jackson9000.fsnet.co.uk> - 2015-11-27 19:18 +0000
                Re: description of Forth-2012's `synonym` Gerry Jackson <gerry@jackson9000.fsnet.co.uk> - 2015-11-27 19:22 +0000
                Re: description of Forth-2012's `synonym` Mark Wills <markwills1970@gmail.com> - 2015-11-27 11:48 -0800
                Re: description of Forth-2012's `synonym` anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2015-11-28 11:07 +0000
                Re: description of Forth-2012's `synonym` Matthias Trute <matthias.trute@gmail.com> - 2015-11-28 12:34 -0800
      Re: description of Forth-2012's `synonym` hughaguilar96@gmail.com - 2015-11-26 18:43 -0800
        Re: description of Forth-2012's `synonym` Marcos Cruz <use_the_contact_page@programandala.net> - 2015-12-05 03:35 +0000
    Re: description of Forth-2012's `synonym` hughaguilar96@gmail.com - 2015-11-26 14:39 -0800

csiph-web