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


Groups > comp.lang.forth > #43743

Re: POSTPONE behaviour

From rickman <gnuarm@gmail.com>
Newsgroups comp.lang.forth
Subject Re: POSTPONE behaviour
Date 2015-11-25 03:23 -0500
Organization A noiseless patient Spider
Message-ID <n33r1o$76d$1@dont-email.me> (permalink)
References (3 earlier) <98a20b8e-3531-4d97-9fbb-f16216edca0d@googlegroups.com> <86vb8qv9be.fsf@vps34351.public.cloudvps.com> <b18ae92a-815d-4c01-a570-052215b96346@googlegroups.com> <n33pnt$2tq$1@dont-email.me> <91b7cce8-9779-4ab4-84bf-6f4b04115189@googlegroups.com>

Show all headers | View raw


On 11/25/2015 3:09 AM, Raimond Dragomir wrote:
> miercuri, 25 noiembrie 2015, 10:01:17 UTC+2, rickman a scris:
>> On 11/25/2015 2:38 AM, Raimond Dragomir wrote:
>>> miercuri, 25 noiembrie 2015, 09:15:35 UTC+2, Lars Brinkhoff a scris:
>>>> Raimond Dragomir <raimond.dragomir@gmail.com> writes:
>>>>>> But failing in this case:
>>>>>> T{ : GT1 123 ; -> }T
>>>>>> T{ : GT4 POSTPONE GT1 ; IMMEDIATE -> }T
>>>>>> T{ : GT5 GT4 ; -> }T
>>>>>> T{ GT5 -> 123 }T
>>>>>
>>>>> Well, think about it: GT4 is immediate. It is executed directly when
>>>>> you define GT5. When executed it will call GT1 which leaves 123 on the
>>>>> data stack.
>>>>
>>>> No, in an ANS Forth, GT4 should not call GT1.
>>>
>>> And do what else?
>>> GT4 has GT1 compiled in it. When GT4 is executed, it executes GT1.
>>> When GT4 is executed (not compiled). And this happens when GT5 is defined
>>> because GT4 is immediate.
>>
>> This wasn't clear to me until I read these sections of the standard...
>> well, the 2012 standard.  Is any of this different from the 94 standard
>> that seems to be the one under discussion?
>>
>> 6.1.2033 POSTPONE CORE
>> Interpretation: Interpretation semantics for this word are undefined.
>> Compilation: ( "(spaces)name" -- )
>> Skip leading space delimiters. Parse name delimited by a space. Find
>> name. Append the compilation semantics of name to the current
>> definition. An ambiguous condition exists if name is not found.
>>
>> 3.4.3.3 Compilation semantics
>> Unless otherwise specified in a " Compilation: " section of the glossary
>> entry, the compilation semantics of a Forth definition shall be to
>> append its execution semantics to the execution semantics of the current
>> definition.
>>
>> So postponing a word that is not immediate does nothing special, right?
>>    In essence, for a non-immediate word POSTPONE is a noop.
>>
>> --
>>
>> Rick
>
> Rick, this behaviour is so obvious to so many people, yet the ANS standard
> seems to define it totally different for non-immediate words. I just wonder
> now how much % of the forth programmers really understand the POSTPONE in
> the ANS way.

Hmmm.. At first I thought you were not reading the same standard I was, 
but on reading it again, I think I am mis-interpreting the standard. 
When postpone says, "Append the compilation semantics of name to the 
current definition."  I guess for a non-immediate word that could mean 
to append to the current definition the action of compiling the 
execution semantics of the word postponed.


> One thing is clear to me: ANS document should explain it MUCH better and
> more carefully.

Yeah, I guess you might be right.  The appendix section A.6.1.2033 
POSTPONE talks about how COMPILE and [COMPILE] require the user to know 
if the word affected is immediate or not, but doesn't clarify what 
POSTPONE will do with a non-immediate word.


> As for me personally I don't have a postpone word in my system. It is so
> much mis-understood and hard to understand that I 'm better off.
> I have very few immediate words anyway, and those ones are the obvious ones
> (like IF, BEGIN, WHILE, etc).

So what do standard systems do?

-- 

Rick

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


Thread

POSTPONE behaviour Aliaksei Chapyzhenka <alex.drom@gmail.com> - 2015-11-24 21:18 -0800
  Re: POSTPONE behaviour Raimond Dragomir <raimond.dragomir@gmail.com> - 2015-11-24 22:00 -0800
    Re: POSTPONE behaviour Aliaksei Chapyzhenka <alex.drom@gmail.com> - 2015-11-24 22:15 -0800
      Re: POSTPONE behaviour Raimond Dragomir <raimond.dragomir@gmail.com> - 2015-11-24 22:54 -0800
        Re: POSTPONE behaviour Aliaksei Chapyzhenka <alex.drom@gmail.com> - 2015-11-24 23:09 -0800
        Re: POSTPONE behaviour Lars Brinkhoff <lars.spam@nocrew.org> - 2015-11-25 08:15 +0100
          Re: POSTPONE behaviour Raimond Dragomir <raimond.dragomir@gmail.com> - 2015-11-24 23:38 -0800
            Re: POSTPONE behaviour Lars Brinkhoff <lars.spam@nocrew.org> - 2015-11-25 08:46 +0100
              Re: POSTPONE behaviour Raimond Dragomir <raimond.dragomir@gmail.com> - 2015-11-25 00:04 -0800
            Re: POSTPONE behaviour rickman <gnuarm@gmail.com> - 2015-11-25 03:01 -0500
              Re: POSTPONE behaviour Raimond Dragomir <raimond.dragomir@gmail.com> - 2015-11-25 00:09 -0800
                Re: POSTPONE behaviour rickman <gnuarm@gmail.com> - 2015-11-25 03:23 -0500
                Re: POSTPONE behaviour Raimond Dragomir <raimond.dragomir@gmail.com> - 2015-11-25 01:09 -0800
                Re: POSTPONE behaviour rickman <gnuarm@gmail.com> - 2015-11-25 10:49 -0500
                Re: POSTPONE behaviour "Elizabeth D. Rather" <erather@forth.com> - 2015-11-25 09:10 -1000
                Re: POSTPONE behaviour Gerry Jackson <gerry@jackson9000.fsnet.co.uk> - 2015-11-25 09:18 +0000
                Re: POSTPONE behaviour Raimond Dragomir <raimond.dragomir@gmail.com> - 2015-11-25 02:21 -0800
                Re: POSTPONE behaviour Mark Wills <markwills1970@gmail.com> - 2015-11-25 02:47 -0800
                Re: POSTPONE behaviour Gerry Jackson <gerry@jackson9000.fsnet.co.uk> - 2015-11-25 13:58 +0000
                Re: POSTPONE behaviour Mark Wills <markwills1970@gmail.com> - 2015-11-25 06:35 -0800
                Re: POSTPONE behaviour Bernd Paysan <bernd.paysan@gmx.de> - 2015-11-25 18:45 +0100
                Re: POSTPONE behaviour Raimond Dragomir <raimond.dragomir@gmail.com> - 2015-11-25 22:11 -0800
                Re: POSTPONE behaviour Gerry Jackson <gerry@jackson9000.fsnet.co.uk> - 2015-11-26 07:42 +0000
                Re: POSTPONE behaviour "Rod Pemberton" <boo@fasdfrewar.cdm> - 2015-11-26 05:20 -0500
                Re: POSTPONE behaviour anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2015-11-26 16:50 +0000
                Re: POSTPONE behaviour Gerry Jackson <gerry@jackson9000.fsnet.co.uk> - 2015-11-26 17:59 +0000
                Re: POSTPONE behaviour Bernd Paysan <bernd.paysan@gmx.de> - 2015-11-27 19:07 +0100
                Re: POSTPONE behaviour anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2015-11-28 11:24 +0000
                Re: POSTPONE behaviour hughaguilar96@gmail.com - 2015-11-26 12:29 -0800
                Re: POSTPONE behaviour Gerry Jackson <gerry@jackson9000.fsnet.co.uk> - 2015-11-27 09:53 +0000
                Re: POSTPONE behaviour hughaguilar96@gmail.com - 2015-11-29 21:48 -0800
                Re: POSTPONE behaviour Gerry Jackson <gerry@jackson9000.fsnet.co.uk> - 2015-11-30 12:18 +0000
                Re: POSTPONE behaviour Lars Brinkhoff <lars.spam@nocrew.org> - 2015-11-30 13:41 +0100
                Re: POSTPONE behaviour hughaguilar96@gmail.com - 2015-11-30 19:56 -0800
                Re: POSTPONE behaviour Gerry Jackson <gerry@jackson9000.fsnet.co.uk> - 2015-12-01 09:59 +0000
                Re: POSTPONE behaviour hughaguilar96@gmail.com - 2015-12-01 22:46 -0800
                Re: POSTPONE behaviour Gerry Jackson <gerry@jackson9000.fsnet.co.uk> - 2015-12-02 07:50 +0000
              Re: POSTPONE behaviour anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2015-11-25 13:45 +0000
                Re: POSTPONE behaviour rickman <gnuarm@gmail.com> - 2015-11-25 10:54 -0500
        Re: POSTPONE behaviour Gerry Jackson <gerry@jackson9000.fsnet.co.uk> - 2015-11-25 07:39 +0000
          Re: POSTPONE behaviour Aliaksei Chapyzhenka <alex.drom@gmail.com> - 2015-11-24 23:48 -0800
            Re: POSTPONE behaviour Gerry Jackson <gerry@jackson9000.fsnet.co.uk> - 2015-11-25 08:03 +0000
    Re: POSTPONE behaviour Bernd Paysan <bernd.paysan@gmx.de> - 2015-11-25 18:37 +0100
  Re: POSTPONE behaviour "Rod Pemberton" <boo@fasdfrewar.cdm> - 2015-11-25 01:27 -0500
    Re: POSTPONE behaviour Aliaksei Chapyzhenka <alex.drom@gmail.com> - 2015-11-24 22:51 -0800
  Re: POSTPONE behaviour Aliaksei Chapyzhenka <alex.drom@gmail.com> - 2015-11-25 21:19 -0800

csiph-web