Rocksolid Light

Welcome to novaBBS (click a section below)

mail  files  register  newsreader  groups  login

Message-ID:  

If entropy is increasing, where is it coming from?


devel / comp.lang.forth / Re: Poll: equivalence for postpone expression

SubjectAuthor
* Poll: equivalence for postpone expressionRuvim
+* Re: Poll: equivalence for postpone expressionP Falth
|+* Re: Poll: equivalence for postpone expressionRuvim
||`* Re: Poll: equivalence for postpone expressionP Falth
|| `* Re: Poll: equivalence for postpone expressionRuvim
||  `* Re: Poll: equivalence for postpone expressionP Falth
||   `* Re: Poll: equivalence for postpone expressionRuvim
||    `* Re: Poll: equivalence for postpone expressionP Falth
||     `* Re: Poll: equivalence for postpone expressionRuvim
||      `* Re: Poll: equivalence for postpone expressionP Falth
||       `- Re: Poll: equivalence for postpone expressionRuvim
|`* Re: Poll: equivalence for postpone expressionGerry Jackson
| `* Re: Poll: equivalence for postpone expressiondxforth
|  `* Re: Poll: equivalence for postpone expressionGerry Jackson
|   +* Re: Poll: equivalence for postpone expressiondxforth
|   |`* Re: Poll: equivalence for postpone expressionGerry Jackson
|   | `- Re: Poll: equivalence for postpone expressiondxforth
|   `* Re: Poll: equivalence for postpone expressionRuvim
|    `* Re: Poll: equivalence for postpone expressionGerry Jackson
|     `- Re: Poll: equivalence for postpone expressionRuvim
+* Re: Poll: equivalence for postpone expressionnone
|`* Re: Poll: equivalence for postpone expressionRuvim
| `* Re: Poll: equivalence for postpone expressionPaul Rubin
|  +- Re: Poll: equivalence for postpone expressionRuvim
|  `- Re: Poll: equivalence for postpone expressionnone
+* Re: Poll: equivalence for postpone expressiondxforth
|+* Re: Poll: equivalence for postpone expressionAnton Ertl
||`* Re: Poll: equivalence for postpone expressiondxforth
|| +* Re: Poll: equivalence for postpone expressionKrishna Myneni
|| |`- Re: Poll: equivalence for postpone expressiondxforth
|| `- Re: Poll: equivalence for postpone expressiondxforth
|`* Re: Poll: equivalence for postpone expressionRuvim
| `- Re: Poll: equivalence for postpone expressiondxforth
+* Re: Poll: equivalence for postpone expressionKrishna Myneni
|+* Re: Poll: equivalence for postpone expressionRuvim
||`* Re: Poll: equivalence for postpone expressionKrishna Myneni
|| +- Re: Poll: equivalence for postpone expressionKrishna Myneni
|| `* Re: Poll: equivalence for postpone expressionRuvim
||  `* Re: Poll: equivalence for postpone expressionKrishna Myneni
||   `- Re: Poll: equivalence for postpone expressionRuvim
|`- Re: Poll: equivalence for postpone expressionS Jack
+* Re: Poll: equivalence for postpone expressionKrishna Myneni
|`* Re: Poll: equivalence for postpone expressionRuvim
| `* Re: Poll: equivalence for postpone expressionKrishna Myneni
|  `* Re: Poll: equivalence for postpone expressionRuvim
|   `* Re: Poll: equivalence for postpone expressionP Falth
|    `- Re: Poll: equivalence for postpone expressionRuvim
`* Re: Poll: equivalence for postpone expressionRuvim
 `* Re: Poll: equivalence for postpone expressiondxforth
  `* Re: Poll: equivalence for postpone expressionRuvim
   `* Re: Poll: equivalence for postpone expressiondxforth
    `* Re: Poll: equivalence for postpone expressionRuvim
     +* Re: Poll: equivalence for postpone expressionP Falth
     |`* Re: Poll: equivalence for postpone expressionRuvim
     | `* Re: Poll: equivalence for postpone expressiondxforth
     |  `* Re: Poll: equivalence for postpone expressionRuvim
     |   +* Re: Poll: equivalence for postpone expressionP Falth
     |   |`* Re: Poll: equivalence for postpone expressionRuvim
     |   | `* Re: Poll: equivalence for postpone expressionP Falth
     |   |  `- Re: Poll: equivalence for postpone expressionRuvim
     |   `- Re: Poll: equivalence for postpone expressiondxforth
     `- Re: Poll: equivalence for postpone expressiondxforth

Pages:123
Re: Poll: equivalence for postpone expression

<saovv7$1go4$1@gioia.aioe.org>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=13668&group=comp.lang.forth#13668

  copy link   Newsgroups: comp.lang.forth
Path: i2pn2.org!i2pn.org!aioe.org!xrnZ5uanw3pSzK+Ytx4Jfg.user.gioia.aioe.org.POSTED!not-for-mail
From: dxfo...@gmail.com (dxforth)
Newsgroups: comp.lang.forth
Subject: Re: Poll: equivalence for postpone expression
Date: Mon, 21 Jun 2021 13:10:31 +1000
Organization: Aioe.org NNTP Server
Lines: 27
Message-ID: <saovv7$1go4$1@gioia.aioe.org>
References: <salij8$m2m$1@dont-email.me> <sanac5$1vvg$1@gioia.aioe.org>
<2021Jun20.145357@mips.complang.tuwien.ac.at> <sanimf$1enr$1@gioia.aioe.org>
<sanjtu$m42$1@dont-email.me>
NNTP-Posting-Host: xrnZ5uanw3pSzK+Ytx4Jfg.user.gioia.aioe.org
Mime-Version: 1.0
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Transfer-Encoding: 8bit
X-Complaints-To: abuse@aioe.org
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101
Thunderbird/78.11.0
X-Notice: Filtered by postfilter v. 0.9.2
Content-Language: en-GB
 by: dxforth - Mon, 21 Jun 2021 03:10 UTC

On 21/06/2021 00:38, Krishna Myneni wrote:
> On 6/20/21 9:17 AM, dxforth wrote:
>> On 20/06/2021 22:53, Anton Ertl wrote:
>>> dxforth <dxforth@gmail.com> writes:
>>>> : t1 [ compile-foo ] ;
>>>> Error: "compile-foo" compilation only
>>> ...
>>>> AFAICS the rule is: Don't attempt to compile while inside [ ] .  Is
>>>> there
>>>> a compelling reason why one should be able to?
>>>
>>> If I want to lay down code in interpret state, it's not the Forth
>>> system's job to tell me I can't.  Just delete ?COMP from your system.
>>> Not only will your system work better, it will also be smaller.
>>
>> I know how to save memory.  What are your reasons for compiling code
>> in interpret state given ANS saw none?
>
> The old saying about "penny-wise but pound-foolish" comes to mind. There
> are problems where coding with nested anonymous definitions can make the
> application more understandable and factorable. One way to implement
> such definitions is to switch to interpretation state within a
> definition and then begin compiling an anonymous definition.

Elizabeth's comment re nested anonymous definitions still resonates with me.
AFAIK to compile an anonymous definition requires executing :NONAME which
sets compilation state.

Re: Poll: equivalence for postpone expression

<sap1jm$1vae$1@gioia.aioe.org>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=13669&group=comp.lang.forth#13669

  copy link   Newsgroups: comp.lang.forth
Path: i2pn2.org!i2pn.org!aioe.org!xrnZ5uanw3pSzK+Ytx4Jfg.user.gioia.aioe.org.POSTED!not-for-mail
From: dxfo...@gmail.com (dxforth)
Newsgroups: comp.lang.forth
Subject: Re: Poll: equivalence for postpone expression
Date: Mon, 21 Jun 2021 13:38:29 +1000
Organization: Aioe.org NNTP Server
Lines: 16
Message-ID: <sap1jm$1vae$1@gioia.aioe.org>
References: <salij8$m2m$1@dont-email.me>
<16992fda-1751-4c59-bd2d-26a13d29f0ebn@googlegroups.com>
<sao64v$l60$1@dont-email.me>
NNTP-Posting-Host: xrnZ5uanw3pSzK+Ytx4Jfg.user.gioia.aioe.org
Mime-Version: 1.0
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Transfer-Encoding: 7bit
X-Complaints-To: abuse@aioe.org
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101
Thunderbird/78.11.0
X-Notice: Filtered by postfilter v. 0.9.2
Content-Language: en-GB
 by: dxforth - Mon, 21 Jun 2021 03:38 UTC

On 21/06/2021 05:49, Gerry Jackson wrote:
> On 20/06/2021 08:20, P Falth wrote:
>> In my opinion compiling code while not in compilation state should
>> not be done in a standard system. It might work in some systems
>> but not all.
>
> If [ ... ] is in the middle of a colon definition I don't see any
> problem with the code in interpretation mode compiling code into the
> incomplete colon definition.
>
> Executing immediate code during compilation is part of the standard and
> has always been in Forth. Why is compiling code when interpreting
> regarded as wrong?

Why is it right? Implicit in compiling code is the notion one is no
longer interpreting.

Re: Poll: equivalence for postpone expression

<sap856$9tl$1@dont-email.me>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=13670&group=comp.lang.forth#13670

  copy link   Newsgroups: comp.lang.forth
Path: i2pn2.org!i2pn.org!eternal-september.org!reader02.eternal-september.org!.POSTED!not-for-mail
From: ruvim.pi...@gmail.com (Ruvim)
Newsgroups: comp.lang.forth
Subject: Re: Poll: equivalence for postpone expression
Date: Mon, 21 Jun 2021 08:30:14 +0300
Organization: A noiseless patient Spider
Lines: 129
Message-ID: <sap856$9tl$1@dont-email.me>
References: <salij8$m2m$1@dont-email.me>
<16992fda-1751-4c59-bd2d-26a13d29f0ebn@googlegroups.com>
<san0f1$oge$1@dont-email.me>
<2cb70016-06d5-4875-9fb5-e1e5ce8709ben@googlegroups.com>
<sanggc$tp4$1@dont-email.me>
<0a23eee5-ed59-4330-81d7-f1f5df6f3c78n@googlegroups.com>
<sanqhu$3c5$1@dont-email.me>
<8db87fb9-1f3d-4d04-bfc2-a864a657bbddn@googlegroups.com>
Mime-Version: 1.0
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Mon, 21 Jun 2021 05:30:14 -0000 (UTC)
Injection-Info: reader02.eternal-september.org; posting-host="3fb0dd310c92139238e1ed15b6608154";
logging-data="10165"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX193WXi8nEjmHoprTOVe7kET"
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101
Thunderbird/78.11.0
Cancel-Lock: sha1:Rkm2HWIg17jACgDsmNiaXXJlPeg=
In-Reply-To: <8db87fb9-1f3d-4d04-bfc2-a864a657bbddn@googlegroups.com>
Content-Language: en-US
X-Mozilla-News-Host: news://nntp.aioe.org
 by: Ruvim - Mon, 21 Jun 2021 05:30 UTC

On 2021-06-20 20:54, P Falth wrote:
> On Sunday, 20 June 2021 at 18:32:00 UTC+2, Ruvim wrote:
>> On 2021-06-20 18:00, P Falth wrote:
>>> On Sunday, 20 June 2021 at 15:40:30 UTC+2, Ruvim wrote:
[...]
>>>> So, P1 is held for a single-semantics immediate word, and for a
>>>> dual-semantics word that is not immediate.
>>>>
>>>> I suspect, P1 in your system is not held for a dual-semantics immediate
>>>> word. I.e., if you make foo2 STATE-dependent.
>>>
>>> This is correct.
>> If P1 is not held for some words (from the given domain), then P1 is
>> false (in the given conditions) in your system.
>>
>> It's OK if you rely on a99-027, but it's a problem otherwise.
> It is a problem for someone writing state smart words.

I consider non-fulfilment of P1 as an inconsistency in the Forth
language/implementation, and as any inconsistency, this inconsistency
leads to some problems, depending on particular twists. And the problems
with "state smart" words is a result of this inconsistency too.

A method to define a dual semantics word via two definitions (and even
removing the "STATE" word) doesn't solve this inconsistency, but just
buries it deeper. It's possible to show this inconsistency anyway.

a99-027 also doesn't solve the problem, but makes a workaround: it
declares that any code that can detect this inconsistency, is ambiguous.

> I will not do that.

It also just a workaround. You know a problem, and avoid it. But the
language/implementation itself still contains this inconsistency.

> In LXF64 I have postexecute that will execute a postponed immediate word
> with state set to compiling.

There is a nuance. What if a request to enter into compilation state is
a part of some compilation semantics. At the moment, such behavior may
be a part of a standard program (see the "]" word). So, I don't revert
the state in such case (see: https://git.io/JnoHY ).

Maybe it makes sense to declare that such behavior is ambiguous.

>> [...]
>>>>>> Then, you don't support equivalence for "compile," that it is equivalent
>>>>>> to "postpone literal postpone execute", do you?
>>>>>
>>>>> : t5 [ ' foo ] literal execute ; ok
>>>>> see t5
>>>>> A4A308 4099DA 8 C80000 5 normal T5
>>>>>
>>>>> 4099DA B8A6994000 mov eax , # 4099A6h
>>>>> 4099DF FFD0 call eax
>>>>> 4099E1 C3 ret near
>>>>> ok
>>>>>
>>>>> Looks to do the same thing but using 3 more bytes
>>>> Yes, but in this example you replace the phrase:
>>>> compile, ]
>>>> by the phrase:
>>>> ] literal execute
>>>>
>>>> So, you show equivalence not for "compile," but for "compile, ]"
>>>
>>> : comp, postpone literal postpone execute ; ok
>>> : t9 [ ' foo comp, ] ; ok
>>> see t9
>>> A4A448 409A4B 8 C80000 5 normal T9
>>>
>>> 409A4B B8A6994000 mov eax , # 4099A6h
>>> 409A50 FFD0 call eax
>>> 409A52 C3 ret near
>>> ok
>>>
>>> works also in that case
>> Yes. It means that "compile," is equivalent to "comp,", that is defined
>> as shown. It's useful equivalency too.
>>
>> But it still doesn't show that:
>> compile,
>> is equivalent to:
>> postpone literal postpone execute
>> by the definition of equivalency that I provided in the starting post :-)
>
> But how could I do that?
> : T9 [ ' foo postpone literal postpone execute ] ;
> will produce a completely different result!

Yes, in your system. It just means that in you system this equivalency
for "compile," is not held in interpretation state, but possibly it's
held in compilation state.

That is, the phrase:

compile,

is equivalent to the phrase:

postpone literal postpone execute

in any such context where these phrases are encountered by the Forth
text interpreter in *compilation state*.

(I don't sure that your system holds this in edge cases, but this is the
idea)

To also hold this equivalency in interpretation state, you have to
define the following interpretation semantics for "postpone".

"POSTPONE" Interpretation: Skip leading space delimiters. Parse
/name/ delimited by a space. Find /name/. Perform the compilation
semantics of /name/.

But it opposes to the conception that a program is not allowed to
perform compilation semantics in interpretation state.

--
Ruvim

Re: Poll: equivalence for postpone expression

<sapih4$4ue$1@dont-email.me>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=13671&group=comp.lang.forth#13671

  copy link   Newsgroups: comp.lang.forth
Path: i2pn2.org!i2pn.org!eternal-september.org!reader02.eternal-september.org!.POSTED!not-for-mail
From: do-not-...@swldwa.uk (Gerry Jackson)
Newsgroups: comp.lang.forth
Subject: Re: Poll: equivalence for postpone expression
Date: Mon, 21 Jun 2021 09:27:17 +0100
Organization: A noiseless patient Spider
Lines: 34
Message-ID: <sapih4$4ue$1@dont-email.me>
References: <salij8$m2m$1@dont-email.me>
<16992fda-1751-4c59-bd2d-26a13d29f0ebn@googlegroups.com>
<sao64v$l60$1@dont-email.me> <sap1jm$1vae$1@gioia.aioe.org>
Mime-Version: 1.0
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Transfer-Encoding: 8bit
Injection-Date: Mon, 21 Jun 2021 08:27:16 -0000 (UTC)
Injection-Info: reader02.eternal-september.org; posting-host="7b74a77aed53d6bb20e9b25ffa44e45e";
logging-data="5070"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+II2l50eKzQsCrstcsf0B/t3V9YUz2iHc="
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101
Thunderbird/78.11.0
Cancel-Lock: sha1:DSbaL01g24m57fdGcx3zP7xASmg=
In-Reply-To: <sap1jm$1vae$1@gioia.aioe.org>
Content-Language: en-GB
 by: Gerry Jackson - Mon, 21 Jun 2021 08:27 UTC

On 21/06/2021 04:38, dxforth wrote:
> On 21/06/2021 05:49, Gerry Jackson wrote:
>> On 20/06/2021 08:20, P Falth wrote:
>>> In my opinion compiling code while not in compilation state should
>>> not be done in a standard system. It might work in some systems
>>> but not all.
>>
>> If [ ... ] is in the middle of a colon definition I don't see any
>> problem with the code in interpretation mode compiling code into the
>> incomplete colon definition.
>>
>> Executing immediate code during compilation is part of the standard and
>> has always been in Forth. Why is compiling code when interpreting
>> regarded as wrong?
>
> Why is it right?  Implicit in compiling code is the notion one is no
> longer interpreting.

Perhaps I asked the wrong question. There is no absolute right and wrong
answer, just whether we should stick to purity and say do we want to
interpret while compiling. Purity is already blurred by the existence of
immediacy and built-in immediate words like IF. Immediacy is largely an
unnecessary convenience because there is an easy work around.

The question is what is the objection to compiling in interpreter mode
if it works and is harmless apart from possibly being wasteful if not in
the middle of a colon definition. The fact that it works in several, if
not all systems, seems to indicate that it requires a bit of extra code
to prevent it. I would have thought that all you KISS, 'don't like
ambiguity', 'don't like being told what to do', anti standard people
would approve :)

--
Gerry

Re: Poll: equivalence for postpone expression

<sapp5m$149k$1@gioia.aioe.org>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=13672&group=comp.lang.forth#13672

  copy link   Newsgroups: comp.lang.forth
Path: i2pn2.org!i2pn.org!aioe.org!xrnZ5uanw3pSzK+Ytx4Jfg.user.gioia.aioe.org.POSTED!not-for-mail
From: dxfo...@gmail.com (dxforth)
Newsgroups: comp.lang.forth
Subject: Re: Poll: equivalence for postpone expression
Date: Mon, 21 Jun 2021 20:20:37 +1000
Organization: Aioe.org NNTP Server
Lines: 53
Message-ID: <sapp5m$149k$1@gioia.aioe.org>
References: <salij8$m2m$1@dont-email.me>
<16992fda-1751-4c59-bd2d-26a13d29f0ebn@googlegroups.com>
<sao64v$l60$1@dont-email.me> <sap1jm$1vae$1@gioia.aioe.org>
<sapih4$4ue$1@dont-email.me>
NNTP-Posting-Host: xrnZ5uanw3pSzK+Ytx4Jfg.user.gioia.aioe.org
Mime-Version: 1.0
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Transfer-Encoding: 8bit
X-Complaints-To: abuse@aioe.org
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101
Thunderbird/78.11.0
X-Notice: Filtered by postfilter v. 0.9.2
Content-Language: en-GB
 by: dxforth - Mon, 21 Jun 2021 10:20 UTC

On 21/06/2021 18:27, Gerry Jackson wrote:
> On 21/06/2021 04:38, dxforth wrote:
>> On 21/06/2021 05:49, Gerry Jackson wrote:
>>> On 20/06/2021 08:20, P Falth wrote:
>>>> In my opinion compiling code while not in compilation state should
>>>> not be done in a standard system. It might work in some systems
>>>> but not all.
>>>
>>> If [ ... ] is in the middle of a colon definition I don't see any
>>> problem with the code in interpretation mode compiling code into the
>>> incomplete colon definition.
>>>
>>> Executing immediate code during compilation is part of the standard and
>>> has always been in Forth. Why is compiling code when interpreting
>>> regarded as wrong?
>>
>> Why is it right?  Implicit in compiling code is the notion one is no
>> longer interpreting.
>
> Perhaps I asked the wrong question. There is no absolute right and wrong
> answer, just whether we should stick to purity and say do we want to
> interpret while compiling. Purity is already blurred by the existence of
> immediacy and built-in immediate words like IF. Immediacy is largely an
> unnecessary convenience because there is an easy work around.
>
> The question is what is the objection to compiling in interpreter mode
> if it works and is harmless apart from possibly being wasteful if not in
> the middle of a colon definition. The fact that it works in several, if
> not all systems, seems to indicate that it requires a bit of extra code
> to prevent it. I would have thought that all you KISS, 'don't like
> ambiguity', 'don't like being told what to do', anti standard people
> would approve :)
>

It benefits us all to be clear what we're doing and why. As I see it:

a) For a definition, compilation mode is entered by executing : and
remains so until ; is encountered. Words within : ; are compiled
by default. The exception is immediate words which do something
immediately and compile the result as executable code. [ ] plays
no part in compilation - rather it allows something to be put on
the data stack at compile-time for a compiling word to use.
Because compiling words are typically immediate (LITERAL POSTPONE
etc) there is no need to execute them within [ ]. More importantly,
nothing is gained by doing so. ANS has marked all code compiling
words as having 'no interpretation semantics' for that reason.

b) Outside a definition there's no reason to compile code and no way
to execute it even if one did. So no need to consider further.

c) ANS has included COMPILE, among the words having no interpretation
semantics. While it could be useful to execute COMPILE, within [ ]
it is not essential e.g. VFX will optimize: [ xt ] LITERAL EXECUTE

Re: Poll: equivalence for postpone expression

<saptvl$jia$1@dont-email.me>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=13673&group=comp.lang.forth#13673

  copy link   Newsgroups: comp.lang.forth
Path: i2pn2.org!i2pn.org!eternal-september.org!reader02.eternal-september.org!.POSTED!not-for-mail
From: krishna....@ccreweb.org (Krishna Myneni)
Newsgroups: comp.lang.forth
Subject: Re: Poll: equivalence for postpone expression
Date: Mon, 21 Jun 2021 06:42:42 -0500
Organization: A noiseless patient Spider
Lines: 34
Message-ID: <saptvl$jia$1@dont-email.me>
References: <salij8$m2m$1@dont-email.me>
Mime-Version: 1.0
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Transfer-Encoding: 8bit
Injection-Date: Mon, 21 Jun 2021 11:42:45 -0000 (UTC)
Injection-Info: reader02.eternal-september.org; posting-host="130d2fd5fda18d8dedd96f1b38ce81f0";
logging-data="20042"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/SXL3+VxW4AYLkSk4m2meL"
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101
Thunderbird/78.10.1
Cancel-Lock: sha1:NoA2D1OpV970xhSVjyZjTE+9768=
In-Reply-To: <salij8$m2m$1@dont-email.me>
Content-Language: en-US
 by: Krishna Myneni - Mon, 21 Jun 2021 11:42 UTC

On 6/19/21 3:03 PM, Ruvim wrote:
....
>
> Let "foo" is a word that doesn't perform any parsing, doesn't access the
> parse area, and doesn't enter into compilation or interpretation state
> (i.e., any such behavior is not a part of any semantics for "foo").
>
> Let the word "compile-foo" is defined as:
>   : compile-foo postpone foo ;
> and it has the same scope as the word "foo".
>
>
>
> Proposition 1.
>   The phrase:
>     [ compile-foo ]
>   is equivalent to the phrase:
>       foo
>   in any such context when the phrase is encountered by the Forth
>   text interpreter in compilation state.
>
>

What is your expectation for use of the phrase "[ COMPILE-FOO ]" inside
of a definition, when COMPILE-FOO is tagged as an immediate word?

: compile-foo postpone foo ; immediate

In this case the compilation semantics of COMPILE-FOO should be the same
as its runtime semantics.

Krishna

Re: Poll: equivalence for postpone expression

<13acc03a-0a97-4048-b734-e65781ca76d4n@googlegroups.com>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=13674&group=comp.lang.forth#13674

  copy link   Newsgroups: comp.lang.forth
X-Received: by 2002:ac8:6d15:: with SMTP id o21mr23712809qtt.54.1624284574307;
Mon, 21 Jun 2021 07:09:34 -0700 (PDT)
X-Received: by 2002:a05:6214:5b1:: with SMTP id by17mr18526832qvb.7.1624284574169;
Mon, 21 Jun 2021 07:09:34 -0700 (PDT)
Path: i2pn2.org!i2pn.org!news.swapon.de!news.mixmin.net!proxad.net!feeder1-2.proxad.net!209.85.160.216.MISMATCH!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.forth
Date: Mon, 21 Jun 2021 07:09:33 -0700 (PDT)
In-Reply-To: <sanjk3$k6e$1@dont-email.me>
Injection-Info: google-groups.googlegroups.com; posting-host=2600:1700:3f7a:20d0:34a0:841a:c0f6:1532;
posting-account=V5nGoQoAAAC_P2U0qnxm2kC0s1jNJXJa
NNTP-Posting-Host: 2600:1700:3f7a:20d0:34a0:841a:c0f6:1532
References: <salij8$m2m$1@dont-email.me> <sanjk3$k6e$1@dont-email.me>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <13acc03a-0a97-4048-b734-e65781ca76d4n@googlegroups.com>
Subject: Re: Poll: equivalence for postpone expression
From: sdwjac...@gmail.com (S Jack)
Injection-Date: Mon, 21 Jun 2021 14:09:34 +0000
Content-Type: text/plain; charset="UTF-8"
 by: S Jack - Mon, 21 Jun 2021 14:09 UTC

On Sunday, June 20, 2021 at 9:33:41 AM UTC-5, Krishna Myneni wrote:
> I might go a bit further than you in suggesting that FOO is allowed to
> be a definition which contains anonymous definitions (quotations or
> nested :NONAME definitions), for greater applicability. That might be a

Anonymous compile in on-going definition:

: foo ." FOO "
[ smudge csp @
' branch compile, ahead
anon ." BOO " ;
swap resolve
swap csp !
] ." BAR " literal enter ;

foo \ => FOO BAR BOO

It seems I can but I won't.

--
me

Re: Poll: equivalence for postpone expression

<saq6qf$min$1@dont-email.me>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=13675&group=comp.lang.forth#13675

  copy link   Newsgroups: comp.lang.forth
Path: i2pn2.org!i2pn.org!eternal-september.org!reader02.eternal-september.org!.POSTED!not-for-mail
From: do-not-...@swldwa.uk (Gerry Jackson)
Newsgroups: comp.lang.forth
Subject: Re: Poll: equivalence for postpone expression
Date: Mon, 21 Jun 2021 15:13:37 +0100
Organization: A noiseless patient Spider
Lines: 74
Message-ID: <saq6qf$min$1@dont-email.me>
References: <salij8$m2m$1@dont-email.me>
<16992fda-1751-4c59-bd2d-26a13d29f0ebn@googlegroups.com>
<sao64v$l60$1@dont-email.me> <sap1jm$1vae$1@gioia.aioe.org>
<sapih4$4ue$1@dont-email.me> <sapp5m$149k$1@gioia.aioe.org>
Mime-Version: 1.0
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Transfer-Encoding: 8bit
Injection-Date: Mon, 21 Jun 2021 14:13:35 -0000 (UTC)
Injection-Info: reader02.eternal-september.org; posting-host="7b74a77aed53d6bb20e9b25ffa44e45e";
logging-data="23127"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18LuA7ZLBK/hvPPJvosW0+egzpSoihwwYU="
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101
Thunderbird/78.11.0
Cancel-Lock: sha1:6UcnzveGCK3vR6Raz23fd7JzMBk=
In-Reply-To: <sapp5m$149k$1@gioia.aioe.org>
Content-Language: en-GB
 by: Gerry Jackson - Mon, 21 Jun 2021 14:13 UTC

On 21/06/2021 11:20, dxforth wrote:
> On 21/06/2021 18:27, Gerry Jackson wrote:
>> On 21/06/2021 04:38, dxforth wrote:
>>> On 21/06/2021 05:49, Gerry Jackson wrote:
>>>> On 20/06/2021 08:20, P Falth wrote:
>>>>> In my opinion compiling code while not in compilation state should
>>>>> not be done in a standard system. It might work in some systems
>>>>> but not all.
>>>>
>>>> If [ ... ] is in the middle of a colon definition I don't see any
>>>> problem with the code in interpretation mode compiling code into the
>>>> incomplete colon definition.
>>>>
>>>> Executing immediate code during compilation is part of the standard and
>>>> has always been in Forth. Why is compiling code when interpreting
>>>> regarded as wrong?
>>>
>>> Why is it right?  Implicit in compiling code is the notion one is no
>>> longer interpreting.
>>
>> Perhaps I asked the wrong question. There is no absolute right and wrong
>> answer, just whether we should stick to purity and say do we want to
>> interpret while compiling. Purity is already blurred by the existence of
>> immediacy and built-in immediate words like IF. Immediacy is largely an
>> unnecessary convenience because there is an easy work around.
>>
>> The question is what is the objection to compiling in interpreter mode
>> if it works and is harmless apart from possibly being wasteful if not in
>> the middle of a colon definition. The fact that it works in several, if
>> not all systems, seems to indicate that it requires a bit of extra code
>> to prevent it. I would have thought that all you KISS, 'don't like
>> ambiguity', 'don't like being told what to do', anti standard people
>> would approve :)
>>
>
> It benefits us all to be clear what we're doing and why.  As I see it:
>
> a) For a definition, compilation mode is entered by executing : and
>    remains so until ; is encountered.  Words within : ; are compiled
>    by default.  The exception is immediate words which do something
>    immediately and compile the result as executable code.  [ ] plays
>    no part in compilation - rather it allows something to be put on
>    the data stack at compile-time for a compiling word to use.
>    Because compiling words are typically immediate (LITERAL POSTPONE
>    etc) there is no need to execute them within [ ]

It would be silly to execute them directly because their behaviour is
undefined in interpretation mode, but they can be executed by a call to
a colon definition that uses them.

>  More importantly, nothing is gained by doing so.

Never say never, someone may find it useful.

>  ANS has marked all code compiling
>    words as having 'no interpretation semantics' for that reason.

Not just for that reason, more likely for preventing execution of
compiling words outside a colon definition.

>
> b) Outside a definition there's no reason to compile code and no way
>    to execute it even if one did.  So no need to consider further.

Quite, it would silly to do so.

>
> c) ANS has included COMPILE, among the words having no interpretation
>    semantics.  While it could be useful to execute COMPILE, within [ ]
>    it is not essential e.g. VFX will optimize:  [ xt ] LITERAL EXECUTE

In general, the fact that one system optimises something proves nothing.
--
Gerry

Re: Poll: equivalence for postpone expression

<saqbd3$bgu$1@gioia.aioe.org>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=13677&group=comp.lang.forth#13677

  copy link   Newsgroups: comp.lang.forth
Path: i2pn2.org!i2pn.org!aioe.org!xrnZ5uanw3pSzK+Ytx4Jfg.user.gioia.aioe.org.POSTED!not-for-mail
From: dxfo...@gmail.com (dxforth)
Newsgroups: comp.lang.forth
Subject: Re: Poll: equivalence for postpone expression
Date: Tue, 22 Jun 2021 01:31:47 +1000
Organization: Aioe.org NNTP Server
Lines: 63
Message-ID: <saqbd3$bgu$1@gioia.aioe.org>
References: <salij8$m2m$1@dont-email.me>
<16992fda-1751-4c59-bd2d-26a13d29f0ebn@googlegroups.com>
<sao64v$l60$1@dont-email.me> <sap1jm$1vae$1@gioia.aioe.org>
<sapih4$4ue$1@dont-email.me> <sapp5m$149k$1@gioia.aioe.org>
<saq6qf$min$1@dont-email.me>
NNTP-Posting-Host: xrnZ5uanw3pSzK+Ytx4Jfg.user.gioia.aioe.org
Mime-Version: 1.0
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Transfer-Encoding: 8bit
X-Complaints-To: abuse@aioe.org
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101
Thunderbird/78.11.0
X-Notice: Filtered by postfilter v. 0.9.2
Content-Language: en-GB
 by: dxforth - Mon, 21 Jun 2021 15:31 UTC

On 22/06/2021 00:13, Gerry Jackson wrote:
> On 21/06/2021 11:20, dxforth wrote:
>> On 21/06/2021 18:27, Gerry Jackson wrote:
>>> On 21/06/2021 04:38, dxforth wrote:
>>>> On 21/06/2021 05:49, Gerry Jackson wrote:
>>>>> On 20/06/2021 08:20, P Falth wrote:
>>>>>> In my opinion compiling code while not in compilation state should
>>>>>> not be done in a standard system. It might work in some systems
>>>>>> but not all.
>>>>>
>>>>> If [ ... ] is in the middle of a colon definition I don't see any
>>>>> problem with the code in interpretation mode compiling code into the
>>>>> incomplete colon definition.
>>>>>
>>>>> Executing immediate code during compilation is part of the standard and
>>>>> has always been in Forth. Why is compiling code when interpreting
>>>>> regarded as wrong?
>>>>
>>>> Why is it right?  Implicit in compiling code is the notion one is no
>>>> longer interpreting.
>>>
>>> Perhaps I asked the wrong question. There is no absolute right and wrong
>>> answer, just whether we should stick to purity and say do we want to
>>> interpret while compiling. Purity is already blurred by the existence of
>>> immediacy and built-in immediate words like IF. Immediacy is largely an
>>> unnecessary convenience because there is an easy work around.
>>>
>>> The question is what is the objection to compiling in interpreter mode
>>> if it works and is harmless apart from possibly being wasteful if not in
>>> the middle of a colon definition. The fact that it works in several, if
>>> not all systems, seems to indicate that it requires a bit of extra code
>>> to prevent it. I would have thought that all you KISS, 'don't like
>>> ambiguity', 'don't like being told what to do', anti standard people
>>> would approve :)
>>>
>>
>> It benefits us all to be clear what we're doing and why.  As I see it:
>>
>> a) For a definition, compilation mode is entered by executing : and
>>    remains so until ; is encountered.  Words within : ; are compiled
>>    by default.  The exception is immediate words which do something
>>    immediately and compile the result as executable code.  [ ] plays
>>    no part in compilation - rather it allows something to be put on
>>    the data stack at compile-time for a compiling word to use.
>>    Because compiling words are typically immediate (LITERAL POSTPONE
>>    etc) there is no need to execute them within [ ]
>
> It would be silly to execute them directly because their behaviour is
> undefined in interpretation mode, but they can be executed by a call to
> a colon definition that uses them.

Their behaviour is undefined any time STATE=0. That didn't stop Ruvim
conducting a poll asking what different systems do in that instance:

https://groups.google.com/g/comp.lang.forth/c/QY-XBI8e3AE/m/Rn7EGtSuBAAJ

>
>>  More importantly, nothing is gained by doing so.
>
> Never say never, someone may find it useful.

When I'm shown something that doesn't flout ANS' rules on compiling words
then we can discuss whether it's useful.

Re: Poll: equivalence for postpone expression

<63fc97c0-0310-44ed-bd2c-a2b2fa218aa1n@googlegroups.com>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=13680&group=comp.lang.forth#13680

  copy link   Newsgroups: comp.lang.forth
X-Received: by 2002:ae9:e407:: with SMTP id q7mr24826928qkc.410.1624300454055; Mon, 21 Jun 2021 11:34:14 -0700 (PDT)
X-Received: by 2002:a05:6214:5b1:: with SMTP id by17mr19765568qvb.7.1624300453832; Mon, 21 Jun 2021 11:34:13 -0700 (PDT)
Path: i2pn2.org!i2pn.org!aioe.org!news.uzoreto.com!tr1.eu1.usenetexpress.com!feeder.usenetexpress.com!tr2.iad1.usenetexpress.com!border1.nntp.dca1.giganews.com!nntp.giganews.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.forth
Date: Mon, 21 Jun 2021 11:34:13 -0700 (PDT)
In-Reply-To: <sap856$9tl$1@dont-email.me>
Injection-Info: google-groups.googlegroups.com; posting-host=2a01:2000:2001:e78c:e567:edf3:69fe:e280; posting-account=ryzhhAoAAAAIqf1uqmG9E4uP1Bagd-k2
NNTP-Posting-Host: 2a01:2000:2001:e78c:e567:edf3:69fe:e280
References: <salij8$m2m$1@dont-email.me> <16992fda-1751-4c59-bd2d-26a13d29f0ebn@googlegroups.com> <san0f1$oge$1@dont-email.me> <2cb70016-06d5-4875-9fb5-e1e5ce8709ben@googlegroups.com> <sanggc$tp4$1@dont-email.me> <0a23eee5-ed59-4330-81d7-f1f5df6f3c78n@googlegroups.com> <sanqhu$3c5$1@dont-email.me> <8db87fb9-1f3d-4d04-bfc2-a864a657bbddn@googlegroups.com> <sap856$9tl$1@dont-email.me>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <63fc97c0-0310-44ed-bd2c-a2b2fa218aa1n@googlegroups.com>
Subject: Re: Poll: equivalence for postpone expression
From: peter.m....@gmail.com (P Falth)
Injection-Date: Mon, 21 Jun 2021 18:34:14 +0000
Content-Type: text/plain; charset="UTF-8"
Lines: 133
 by: P Falth - Mon, 21 Jun 2021 18:34 UTC

On Monday, 21 June 2021 at 07:30:16 UTC+2, Ruvim wrote:
> On 2021-06-20 20:54, P Falth wrote:
> > On Sunday, 20 June 2021 at 18:32:00 UTC+2, Ruvim wrote:
> >> On 2021-06-20 18:00, P Falth wrote:
> >>> On Sunday, 20 June 2021 at 15:40:30 UTC+2, Ruvim wrote:
> [...]
> >>>> So, P1 is held for a single-semantics immediate word, and for a
> >>>> dual-semantics word that is not immediate.
> >>>>
> >>>> I suspect, P1 in your system is not held for a dual-semantics immediate
> >>>> word. I.e., if you make foo2 STATE-dependent.
> >>>
> >>> This is correct.
> >> If P1 is not held for some words (from the given domain), then P1 is
> >> false (in the given conditions) in your system.
> >>
> >> It's OK if you rely on a99-027, but it's a problem otherwise.
> > It is a problem for someone writing state smart words.
> I consider non-fulfilment of P1 as an inconsistency in the Forth
> language/implementation, and as any inconsistency, this inconsistency
> leads to some problems, depending on particular twists. And the problems
> with "state smart" words is a result of this inconsistency too.
>
> A method to define a dual semantics word via two definitions (and even
> removing the "STATE" word) doesn't solve this inconsistency, but just
> buries it deeper. It's possible to show this inconsistency anyway.
>
> a99-027 also doesn't solve the problem, but makes a workaround: it
> declares that any code that can detect this inconsistency, is ambiguous.
> > I will not do that.
> It also just a workaround. You know a problem, and avoid it. But the
> language/implementation itself still contains this inconsistency.
> > In LXF64 I have postexecute that will execute a postponed immediate word
> > with state set to compiling.
> There is a nuance. What if a request to enter into compilation state is
> a part of some compilation semantics. At the moment, such behavior may
> be a part of a standard program (see the "]" word). So, I don't revert
> the state in such case (see: https://git.io/JnoHY ).
>
> Maybe it makes sense to declare that such behavior is ambiguous.
> >> [...]
> >>>>>> Then, you don't support equivalence for "compile," that it is equivalent
> >>>>>> to "postpone literal postpone execute", do you?
> >>>>>
> >>>>> : t5 [ ' foo ] literal execute ; ok
> >>>>> see t5
> >>>>> A4A308 4099DA 8 C80000 5 normal T5
> >>>>>
> >>>>> 4099DA B8A6994000 mov eax , # 4099A6h
> >>>>> 4099DF FFD0 call eax
> >>>>> 4099E1 C3 ret near
> >>>>> ok
> >>>>>
> >>>>> Looks to do the same thing but using 3 more bytes
> >>>> Yes, but in this example you replace the phrase:
> >>>> compile, ]
> >>>> by the phrase:
> >>>> ] literal execute
> >>>>
> >>>> So, you show equivalence not for "compile," but for "compile, ]"
> >>>
> >>> : comp, postpone literal postpone execute ; ok
> >>> : t9 [ ' foo comp, ] ; ok
> >>> see t9
> >>> A4A448 409A4B 8 C80000 5 normal T9
> >>>
> >>> 409A4B B8A6994000 mov eax , # 4099A6h
> >>> 409A50 FFD0 call eax
> >>> 409A52 C3 ret near
> >>> ok
> >>>
> >>> works also in that case
> >> Yes. It means that "compile," is equivalent to "comp,", that is defined
> >> as shown. It's useful equivalency too.
> >>
> >> But it still doesn't show that:
> >> compile,
> >> is equivalent to:
> >> postpone literal postpone execute
> >> by the definition of equivalency that I provided in the starting post :-)
> >
> > But how could I do that?
> > : T9 [ ' foo postpone literal postpone execute ] ;
> > will produce a completely different result!
> Yes, in your system. It just means that in you system this equivalency
> for "compile," is not held in interpretation state, but possibly it's
> held in compilation state.
>
> That is, the phrase:
>
> compile,
> is equivalent to the phrase:
> postpone literal postpone execute
>
> in any such context where these phrases are encountered by the Forth
> text interpreter in *compilation state*.
>
> (I don't sure that your system holds this in edge cases, but this is the
> idea)
>
>
>
> To also hold this equivalency in interpretation state, you have to
> define the following interpretation semantics for "postpone".
>
> "POSTPONE" Interpretation: Skip leading space delimiters. Parse
> /name/ delimited by a space. Find /name/. Perform the compilation
> semantics of /name/.
So you want to make postpone a dual semantics words or state-smart word!

Maybe it is better to give it a new name as the behavior changed
maybe [POSTPONE] or ]POSTPONE[

But I think I see what you want to achieve, will you suggest similar behavior for
other compile only words like IF etc.

I can see an alternative instead by changing [ and ]
[ suspends compilation and sets up a temporary code space and continues compilation
] ends the temporary definition, restores the suspended definition and executes
the code just compiled

I can't say it it is usefully. But neither I think it s useful to compile in interpret state!

BR
Peter

> But it opposes to the conception that a program is not allowed to
> perform compilation semantics in interpretation state.
>
>
>
> --
> Ruvim

Re: Poll: equivalence for postpone expression

<sasht1$3a2$1@dont-email.me>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=13687&group=comp.lang.forth#13687

  copy link   Newsgroups: comp.lang.forth
Path: i2pn2.org!i2pn.org!eternal-september.org!reader02.eternal-september.org!.POSTED!not-for-mail
From: ruvim.pi...@gmail.com (Ruvim)
Newsgroups: comp.lang.forth
Subject: Re: Poll: equivalence for postpone expression
Date: Tue, 22 Jun 2021 14:34:56 +0300
Organization: A noiseless patient Spider
Lines: 54
Message-ID: <sasht1$3a2$1@dont-email.me>
References: <salij8$m2m$1@dont-email.me> <sanjk3$k6e$1@dont-email.me>
<sanu6l$se1$1@dont-email.me> <saoqv2$aah$1@dont-email.me>
Mime-Version: 1.0
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Transfer-Encoding: 8bit
Injection-Date: Tue, 22 Jun 2021 11:34:57 -0000 (UTC)
Injection-Info: reader02.eternal-september.org; posting-host="324b4375008f02b29a3688873c821f52";
logging-data="3394"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/g/NNFNP8sczs65AxZVcTC"
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101
Thunderbird/78.11.0
Cancel-Lock: sha1:lXPU082NyxmuaFkjHg5ln9nHAPg=
In-Reply-To: <saoqv2$aah$1@dont-email.me>
Content-Language: en-US
X-Mozilla-News-Host: news://nntp.aioe.org
 by: Ruvim - Tue, 22 Jun 2021 11:34 UTC

On 2021-06-21 04:45, Krishna Myneni wrote:
> On 6/20/21 12:34 PM, Ruvim wrote:
>> On 2021-06-20 17:33, Krishna Myneni wrote:
>>> On 6/19/21 3:03 PM, Ruvim wrote:
>>>> A poll about equivalences for the "postpone x" expression.
>>>>
>> [...]
>>>>
>>>> Let "foo" is a word that doesn't perform any parsing, doesn't access
>>>> the parse area, and doesn't enter into compilation or interpretation
>>>> state (i.e., any such behavior is not a part of any semantics for
>>>> "foo").
>>>>
>>>> Let the word "compile-foo" is defined as:
>>>>    : compile-foo postpone foo ;
>>>> and it has the same scope as the word "foo".
>>>>
>>>>
>>>>
>>>> Proposition 1.
>>>>    The phrase:
>>>>      [ compile-foo ]
>>>>    is equivalent to the phrase:
>>>>        foo
>>>>    in any such context when the phrase is encountered by the Forth
>>>>    text interpreter in compilation state.
>>>>
[...]
>>>>
>>>>   b. It's better if the proposition is true in a system.
>>>>
[...]

>>> I will select position (b) tentatively for now.
>>
>> I also on this side.
>>
>> But some programs assume that P1 is not held in some specific cases.
>>
>> For example, your definition for "∋" is not compatible with a system
>> that holds P1 (and its generalization).
>>
>
> Ok, I see what you mean.

> Gforth holds to proposition 1 (P1):

No, it doesn't.

In some cases — yes. But in general, Gforth doesn't hold P1.

--
Ruvim

Re: Poll: equivalence for postpone expression

<saskp4$o7q$1@dont-email.me>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=13689&group=comp.lang.forth#13689

  copy link   Newsgroups: comp.lang.forth
Path: i2pn2.org!i2pn.org!eternal-september.org!reader02.eternal-september.org!.POSTED!not-for-mail
From: krishna....@ccreweb.org (Krishna Myneni)
Newsgroups: comp.lang.forth
Subject: Re: Poll: equivalence for postpone expression
Date: Tue, 22 Jun 2021 07:24:03 -0500
Organization: A noiseless patient Spider
Lines: 59
Message-ID: <saskp4$o7q$1@dont-email.me>
References: <salij8$m2m$1@dont-email.me> <sanjk3$k6e$1@dont-email.me>
<sanu6l$se1$1@dont-email.me> <saoqv2$aah$1@dont-email.me>
<sasht1$3a2$1@dont-email.me>
Mime-Version: 1.0
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Transfer-Encoding: 8bit
Injection-Date: Tue, 22 Jun 2021 12:24:04 -0000 (UTC)
Injection-Info: reader02.eternal-september.org; posting-host="ac1d39c21cc87b0e95b8666b951a0ecb";
logging-data="24826"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+ZTXXK308rwEgmYXL6ygwm"
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101
Thunderbird/78.10.1
Cancel-Lock: sha1:qADAqNyT9/UZLWLCi+27L3hXKkg=
In-Reply-To: <sasht1$3a2$1@dont-email.me>
Content-Language: en-US
 by: Krishna Myneni - Tue, 22 Jun 2021 12:24 UTC

On 6/22/21 6:34 AM, Ruvim wrote:
> On 2021-06-21 04:45, Krishna Myneni wrote:
>> On 6/20/21 12:34 PM, Ruvim wrote:
>>> On 2021-06-20 17:33, Krishna Myneni wrote:
>>>> On 6/19/21 3:03 PM, Ruvim wrote:
>>>>> A poll about equivalences for the "postpone x" expression.
>>>>>
>>> [...]
>>>>>
>>>>> Let "foo" is a word that doesn't perform any parsing, doesn't
>>>>> access the parse area, and doesn't enter into compilation or
>>>>> interpretation state (i.e., any such behavior is not a part of any
>>>>> semantics for "foo").
>>>>>
>>>>> Let the word "compile-foo" is defined as:
>>>>>    : compile-foo postpone foo ;
>>>>> and it has the same scope as the word "foo".
>>>>>
>>>>>
>>>>>
>>>>> Proposition 1.
>>>>>    The phrase:
>>>>>      [ compile-foo ]
>>>>>    is equivalent to the phrase:
>>>>>        foo
>>>>>    in any such context when the phrase is encountered by the Forth
>>>>>    text interpreter in compilation state.
>>>>>
> [...]
>>>>>
>>>>>   b. It's better if the proposition is true in a system.
>>>>>
> [...]
>
>>>> I will select position (b) tentatively for now.
>>>
>>> I also on this side.
>>>
>>> But some programs assume that P1 is not held in some specific cases.
>>>
>>> For example, your definition for "∋" is not compatible with a system
>>> that holds P1 (and its generalization).
>>>
>>
>> Ok, I see what you mean.
>
>> Gforth holds to proposition 1 (P1):
>
> No, it doesn't.
>
> In some cases — yes. But in general, Gforth doesn't hold P1.

Perhaps you can provide some test code for checking whether or not P1 or
P2 holds for a Forth system. Without test code, it is difficult to
understand exactly what you are aiming for.

Krishna

Re: Poll: equivalence for postpone expression

<saso1b$r0r$1@dont-email.me>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=13690&group=comp.lang.forth#13690

  copy link   Newsgroups: comp.lang.forth
Path: i2pn2.org!i2pn.org!eternal-september.org!reader02.eternal-september.org!.POSTED!not-for-mail
From: ruvim.pi...@gmail.com (Ruvim)
Newsgroups: comp.lang.forth
Subject: Re: Poll: equivalence for postpone expression
Date: Tue, 22 Jun 2021 16:19:40 +0300
Organization: A noiseless patient Spider
Lines: 112
Message-ID: <saso1b$r0r$1@dont-email.me>
References: <salij8$m2m$1@dont-email.me>
<16992fda-1751-4c59-bd2d-26a13d29f0ebn@googlegroups.com>
<san0f1$oge$1@dont-email.me>
<2cb70016-06d5-4875-9fb5-e1e5ce8709ben@googlegroups.com>
<sanggc$tp4$1@dont-email.me>
<0a23eee5-ed59-4330-81d7-f1f5df6f3c78n@googlegroups.com>
<sanqhu$3c5$1@dont-email.me>
<8db87fb9-1f3d-4d04-bfc2-a864a657bbddn@googlegroups.com>
<sap856$9tl$1@dont-email.me>
<63fc97c0-0310-44ed-bd2c-a2b2fa218aa1n@googlegroups.com>
Mime-Version: 1.0
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Tue, 22 Jun 2021 13:19:39 -0000 (UTC)
Injection-Info: reader02.eternal-september.org; posting-host="324b4375008f02b29a3688873c821f52";
logging-data="27675"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/f8ZyfP+JD2DAgRmlMuYnL"
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101
Thunderbird/78.11.0
Cancel-Lock: sha1:NaYIKdD1s4WBqZkyyIV/uPb903Q=
In-Reply-To: <63fc97c0-0310-44ed-bd2c-a2b2fa218aa1n@googlegroups.com>
Content-Language: en-US
 by: Ruvim - Tue, 22 Jun 2021 13:19 UTC

On 2021-06-21 21:34, P Falth wrote:
> On Monday, 21 June 2021 at 07:30:16 UTC+2, Ruvim wrote:
>> On 2021-06-20 20:54, P Falth wrote:
[...]
>>> But how could I do that?
>>> : T9 [ ' foo postpone literal postpone execute ] ;
>>> will produce a completely different result!
>> Yes, in your system. It just means that in you system this equivalency
>> for "compile," is not held in interpretation state, but possibly it's
>> held in compilation state.
>>
>> That is, the phrase:
>>
>> compile,
>>
>> is equivalent to the phrase:
>>
>> postpone literal postpone execute
>>
>> in any such context where these phrases are encountered by the Forth
>> text interpreter in *compilation state*.
>>
>> (I don't sure that your system holds this in edge cases, but this is the
>> idea)
>>
>>
>> To also hold this equivalency in interpretation state, you have to
>> define the following interpretation semantics for "postpone".
>>
>> "POSTPONE" Interpretation: Skip leading space delimiters. Parse
>> /name/ delimited by a space. Find /name/. Perform the compilation
>> semantics of /name/.
>
> So you want to make postpone a dual semantics words or state-smart word!

I don't talk about standardization at the moment (see [1] below).

It's just a solution, how to hold the given equivalency in
interpretation state (NB: it's another one, neither P1 nor P2, but it's
connected with P2).

> Maybe it is better to give it a new name as the behavior changed
> maybe [POSTPONE] or ]POSTPONE[

A standard system is allowed to provide the given interpretation
semantics for "POSTPONE". Such "POSTPONE" can break nothing, why do we
need another name?

> But I think I see what you want to achieve, will you suggest similar behavior for
> other compile only words like IF etc.
>
> I can see an alternative instead by changing [ and ]
> [ suspends compilation and sets up a temporary code space and continues compilation
> ] ends the temporary definition, restores the suspended definition and executes
> the code just compiled

It's a nice idea!

But it's isn't compliant.
E.g., it fails on the following:

[ char | parse any text | 2drop ]

So in this case we need other names for these words.

> I can't say it it is usefully. But neither I think it s useful to compile in interpret state!

What about a Forth-assembler? It compiles in interpretation state. And
it seems, it very useful. Isn't it?

When we write something like:

[ ' x compile, ]

it can be considered as a kind of a Forth assembler, when you compile
something in interpretation state.

-----

[1] Concerning dual-semantics words.

According to the definition for the "dual-semantics word" term [2], if
you see the different effects when a non ordinary word is encountered by
the Forth text interpreter in interpretation state, and when it's
encountered in compilation state, then this word is a dual-semantics
word (by implementation).

So, if a system throws an exception when interpreting "postpone", then
"postpone" is implemented as a dual-semantics word.

It's a common case that the words for which the standard undefines
interpretation semantics are implemented as dual-semantics words.

[2] "Problem of FIND, rethinking", 2021-05-19
news:s81ftp$geg$1@dont-email.me
http://al.howardknight.net/?ID=162255657000

A dual-semantics word is a non ordinary word, for which the
interpretation semantics are not equivalent to the compilation semantics.

--
Ruvim

Re: Poll: equivalence for postpone expression

<sasorm$arq$1@dont-email.me>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=13691&group=comp.lang.forth#13691

  copy link   Newsgroups: comp.lang.forth
Path: i2pn2.org!i2pn.org!eternal-september.org!reader02.eternal-september.org!.POSTED!not-for-mail
From: ruvim.pi...@gmail.com (Ruvim)
Newsgroups: comp.lang.forth
Subject: Re: Poll: equivalence for postpone expression
Date: Tue, 22 Jun 2021 16:33:42 +0300
Organization: A noiseless patient Spider
Lines: 21
Message-ID: <sasorm$arq$1@dont-email.me>
References: <salij8$m2m$1@dont-email.me>
<16992fda-1751-4c59-bd2d-26a13d29f0ebn@googlegroups.com>
<sao64v$l60$1@dont-email.me> <sap1jm$1vae$1@gioia.aioe.org>
<sapih4$4ue$1@dont-email.me>
Mime-Version: 1.0
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Tue, 22 Jun 2021 13:33:42 -0000 (UTC)
Injection-Info: reader02.eternal-september.org; posting-host="324b4375008f02b29a3688873c821f52";
logging-data="11130"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18Ye8mLJ/OQobnGbElMQATv"
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101
Thunderbird/78.11.0
Cancel-Lock: sha1:l/tNtaetTMLtuAjhhSUIUAdXwXs=
In-Reply-To: <sapih4$4ue$1@dont-email.me>
Content-Language: en-US
X-Mozilla-News-Host: news://nntp.aioe.org
 by: Ruvim - Tue, 22 Jun 2021 13:33 UTC

On 2021-06-21 11:27, Gerry Jackson wrote:

> Purity is already blurred by the existence of
> immediacy and built-in immediate words like IF.

The standard doesn't require to implement "IF" as an immediate word.

Perhaps you mean by "immediacy" something different.

> Immediacy is largely an
> unnecessary convenience because there is an easy work around.

What a work around do you mean?

By my understanding, immediacy (in the standard notion) is just a way to
implement non default compilation semantics and dual-semantics words.

--
Ruvim

Re: Poll: equivalence for postpone expression

<sat3pp$7m9$1@dont-email.me>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=13692&group=comp.lang.forth#13692

  copy link   Newsgroups: comp.lang.forth
Path: i2pn2.org!i2pn.org!eternal-september.org!reader02.eternal-september.org!.POSTED!not-for-mail
From: ruvim.pi...@gmail.com (Ruvim)
Newsgroups: comp.lang.forth
Subject: Re: Poll: equivalence for postpone expression
Date: Tue, 22 Jun 2021 19:40:24 +0300
Organization: A noiseless patient Spider
Lines: 135
Message-ID: <sat3pp$7m9$1@dont-email.me>
References: <salij8$m2m$1@dont-email.me> <sanjk3$k6e$1@dont-email.me>
<sanu6l$se1$1@dont-email.me> <saoqv2$aah$1@dont-email.me>
<sasht1$3a2$1@dont-email.me> <saskp4$o7q$1@dont-email.me>
Mime-Version: 1.0
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Transfer-Encoding: 8bit
Injection-Date: Tue, 22 Jun 2021 16:40:25 -0000 (UTC)
Injection-Info: reader02.eternal-september.org; posting-host="324b4375008f02b29a3688873c821f52";
logging-data="7881"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/EkXaDDXQujN39wH2j4nE+"
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101
Thunderbird/78.11.0
Cancel-Lock: sha1:cOThvOUwLlH/nlxe5kzBa4MVAyA=
In-Reply-To: <saskp4$o7q$1@dont-email.me>
Content-Language: en-US
 by: Ruvim - Tue, 22 Jun 2021 16:40 UTC

On 2021-06-22 15:24, Krishna Myneni wrote:
> On 6/22/21 6:34 AM, Ruvim wrote:
>> On 2021-06-21 04:45, Krishna Myneni wrote:
>>> On 6/20/21 12:34 PM, Ruvim wrote:
>>>> On 2021-06-20 17:33, Krishna Myneni wrote:
>>>>> On 6/19/21 3:03 PM, Ruvim wrote:
>>>>>> A poll about equivalences for the "postpone x" expression.
>>>>>>
>>>> [...]
>>>>>>
>>>>>> Let "foo" is a word that doesn't perform any parsing, doesn't
>>>>>> access the parse area, and doesn't enter into compilation or
>>>>>> interpretation state (i.e., any such behavior is not a part of any
>>>>>> semantics for "foo").
>>>>>>
>>>>>> Let the word "compile-foo" is defined as:
>>>>>>    : compile-foo postpone foo ;
>>>>>> and it has the same scope as the word "foo".
>>>>>>
>>>>>>
>>>>>>
>>>>>> Proposition 1.
>>>>>>    The phrase:
>>>>>>      [ compile-foo ]
>>>>>>    is equivalent to the phrase:
>>>>>>        foo
>>>>>>    in any such context when the phrase is encountered by the Forth
>>>>>>    text interpreter in compilation state.
>>>>>>
>> [...]
>>>>>>
>>>>>>   b. It's better if the proposition is true in a system.
>>>>>>
>> [...]
>>
>>>>> I will select position (b) tentatively for now.
>>>>
>>>> I also on this side.
>>>>
>>>> But some programs assume that P1 is not held in some specific cases.
>>>>
>>>> For example, your definition for "∋" is not compatible with a system
>>>> that holds P1 (and its generalization).
>>>>
>>>
>>> Ok, I see what you mean.
>>
>>> Gforth holds to proposition 1 (P1):
>>
>> No, it doesn't.
>>
>> In some cases — yes. But in general, Gforth doesn't hold P1.
>
> Perhaps you can provide some test code for checking whether or not P1 or
> P2 holds for a Forth system. Without test code, it is difficult to
> understand exactly what you are aiming for.

A test code cannot prove that these propositions are held. In some
cases, by a chance, a test code can prove that they are not held.

So for these propositions, a test code either shows that a proposition
isn't held, or shows nothing.

The test cases are following.

\ some helpers
: execute-balance ( i*x xt -- j*x n )
depth 1- >r execute depth r> -
;
: qe{ ( i*x "ccc }" -- j*x n-balance-compiling )
\ Parse the input buffer up to "}",
\ create a quotation (one-liner), execute it,
\ place on the stack the difference in the depth during compilation.
\ CS: not implemented (abort)
\ qe{ [ 10 20 ] 30 } ( -- 10 20 30 2 )
state @ abort" not implemented"
['] :noname execute-balance n>r [char] } parse
['] evaluate execute-balance 2 +
nr> drop postpone ; swap >r execute r>
; immediate

\ some "foo" words for testing

: foo1 ( -- x ) 1 ;
: foo2 ( -- x ) 2 ; immediate
: foo3 ( -- x ) state @ 0<> ; immediate

\ testing some "foo"

: compile-foo1 postpone foo1 ;
t{
qe{ foo1 }
->
qe{ [ compile-foo1 ] }
}t

: compile-foo2 postpone foo2 ;
t{
qe{ foo2 }
->
qe{ [ compile-foo2 ] }
}t

: compile-foo3 postpone foo3 ;
t{
qe{ foo3 }
->
qe{ [ compile-foo3 ] }
}t

: compile-if postpone if ;
t{
0 1 qe{ if 10 or then }
->
0 1 qe{ [ compile-if ] 10 or then }
}t

Take into account that testing is blind concerning how "foo" is defined,
what its semantics, what its behavior in the different conditions, etc.

NB: a polyfill can be loaded into any standard system so the system will
pass this test.

--
Ruvim

Re: Poll: equivalence for postpone expression

<satavh$jcn$1@dont-email.me>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=13694&group=comp.lang.forth#13694

  copy link   Newsgroups: comp.lang.forth
Path: i2pn2.org!i2pn.org!eternal-september.org!reader02.eternal-september.org!.POSTED!not-for-mail
From: do-not-...@swldwa.uk (Gerry Jackson)
Newsgroups: comp.lang.forth
Subject: Re: Poll: equivalence for postpone expression
Date: Tue, 22 Jun 2021 19:43:00 +0100
Organization: A noiseless patient Spider
Lines: 37
Message-ID: <satavh$jcn$1@dont-email.me>
References: <salij8$m2m$1@dont-email.me>
<16992fda-1751-4c59-bd2d-26a13d29f0ebn@googlegroups.com>
<sao64v$l60$1@dont-email.me> <sap1jm$1vae$1@gioia.aioe.org>
<sapih4$4ue$1@dont-email.me> <sasorm$arq$1@dont-email.me>
Mime-Version: 1.0
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Tue, 22 Jun 2021 18:42:57 -0000 (UTC)
Injection-Info: reader02.eternal-september.org; posting-host="d4d2bb70437d69f101aa33809042dbab";
logging-data="19863"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+SFAz9AHBLEBVj4yPXq8yjbYrygZaA01o="
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101
Thunderbird/78.11.0
Cancel-Lock: sha1:1u/bxzMf1NDZ3jjwLwcMa3CLDbE=
In-Reply-To: <sasorm$arq$1@dont-email.me>
Content-Language: en-GB
 by: Gerry Jackson - Tue, 22 Jun 2021 18:43 UTC

On 22/06/2021 14:33, Ruvim wrote:
> On 2021-06-21 11:27, Gerry Jackson wrote:
>
>> Purity is already blurred by the existence of immediacy and built-in
>> immediate words like IF.
>
> The standard doesn't require to implement "IF" as an immediate word.
>
> Perhaps you mean by "immediacy" something different.

I qualified immediacy by 'built in' but I agree it's poorly worded

>
>
>> Immediacy is largely an unnecessary convenience because there is an
>> easy work around.
>
> What a work around do you mean?

: foo ... ; immediate
: bar ... foo ... ;
can be replaced by
: foo ... ;
: bar ... [ foo ] ... ;

unless FOO is state smart which is why I wrote 'largely'. Also if FOO
does things like POSTPONEing or COMPILE,ing I assume that will work.

>
> By my understanding, immediacy (in the standard notion) is just a way to
> implement non default compilation semantics and dual-semantics words.
>
>

--
Gerry

Re: Poll: equivalence for postpone expression

<sath1n$8c7$1@dont-email.me>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=13695&group=comp.lang.forth#13695

  copy link   Newsgroups: comp.lang.forth
Path: i2pn2.org!i2pn.org!weretis.net!feeder8.news.weretis.net!eternal-september.org!reader02.eternal-september.org!.POSTED!not-for-mail
From: ruvim.pi...@gmail.com (Ruvim)
Newsgroups: comp.lang.forth
Subject: Re: Poll: equivalence for postpone expression
Date: Tue, 22 Jun 2021 23:26:31 +0300
Organization: A noiseless patient Spider
Lines: 82
Message-ID: <sath1n$8c7$1@dont-email.me>
References: <salij8$m2m$1@dont-email.me>
<16992fda-1751-4c59-bd2d-26a13d29f0ebn@googlegroups.com>
<sao64v$l60$1@dont-email.me> <sap1jm$1vae$1@gioia.aioe.org>
<sapih4$4ue$1@dont-email.me> <sasorm$arq$1@dont-email.me>
<satavh$jcn$1@dont-email.me>
Mime-Version: 1.0
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Tue, 22 Jun 2021 20:26:31 -0000 (UTC)
Injection-Info: reader02.eternal-september.org; posting-host="324b4375008f02b29a3688873c821f52";
logging-data="8583"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+2w4EfuiCjw2Qv5Jj/0qaH"
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101
Thunderbird/78.11.0
Cancel-Lock: sha1:1Z7yNSDzDEzjCbJfBQLOcM5yzV8=
In-Reply-To: <satavh$jcn$1@dont-email.me>
Content-Language: en-US
 by: Ruvim - Tue, 22 Jun 2021 20:26 UTC

On 2021-06-22 21:43, Gerry Jackson wrote:
> On 22/06/2021 14:33, Ruvim wrote:
>> On 2021-06-21 11:27, Gerry Jackson wrote:
>>
>>> Purity is already blurred by the existence of immediacy and built-in
>>> immediate words like IF.
>>
>> The standard doesn't require to implement "IF" as an immediate word.
>>
>> Perhaps you mean by "immediacy" something different.
>
> I qualified immediacy by 'built in' but I agree it's poorly worded
>
>>
>>
>>> Immediacy is largely an unnecessary convenience because there is an
>>> easy work around.
>>
>> What a work around do you mean?
>
> : foo ... ; immediate
> : bar ... foo ... ;
> can be replaced by
> : foo ... ;
> : bar ... [ foo ] ... ;

Yes, it's just a convenience. But it's a useful and demanded convenience.

Without that a control flow can look as:

: bar [ if, ] baz [ then, ] qux [ ;

> unless FOO is state smart which is why I wrote 'largely'.

Instead of a dual-semantics word we have to use two ordinary words.

To compile a string literal, we can do:

[ s" test" slit, ]
or
[ s" test", ]

To compile a character 'x':

[ char x lit, ]

To compile "to x":

[ to x, ]

> Also if FOO
> does things like POSTPONEing or COMPILE,ing I assume that will work.

Yes, it's an expected behavior.

But if we don't have such a thing like non default compilation
semantics, then "postpone x" is equivalent to "['] x compile," that is
equivalent to "[ ' x lit, ] compile,"

That is,
: foo postpone x ; immediate
: bar foo ;
<=>
: foo postpone x ;
: bar [ foo ] ;
<=>
: foo [ ' x lit, ] compile, ;
: bar [ foo ] ;
<=>
: bar [ ' x compile, ] ;

>>
>> By my understanding, immediacy (in the standard notion) is just a way
>> to implement non default compilation semantics and dual-semantics words.
>>

--
Ruvim

Re: Poll: equivalence for postpone expression

<sb24c1$jr$2@dont-email.me>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=13718&group=comp.lang.forth#13718

  copy link   Newsgroups: comp.lang.forth
Path: i2pn2.org!i2pn.org!eternal-september.org!reader02.eternal-september.org!.POSTED!not-for-mail
From: ruvim.pi...@gmail.com (Ruvim)
Newsgroups: comp.lang.forth
Subject: Re: Poll: equivalence for postpone expression
Date: Thu, 24 Jun 2021 17:20:49 +0300
Organization: A noiseless patient Spider
Lines: 66
Message-ID: <sb24c1$jr$2@dont-email.me>
References: <salij8$m2m$1@dont-email.me>
Mime-Version: 1.0
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Transfer-Encoding: 8bit
Injection-Date: Thu, 24 Jun 2021 14:20:49 -0000 (UTC)
Injection-Info: reader02.eternal-september.org; posting-host="ef88ae0670af25fde2c6a6e02b2e56bc";
logging-data="635"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18gZz/7S57MCTSTkZMdH5dw"
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101
Thunderbird/78.11.0
Cancel-Lock: sha1:RPwKN9g5sOAuWa3+MgD+q8sdHU8=
In-Reply-To: <salij8$m2m$1@dont-email.me>
Content-Language: en-US
X-Mozilla-News-Host: news://nntp.aioe.org
 by: Ruvim - Thu, 24 Jun 2021 14:20 UTC

On 2021-06-19 23:03, Ruvim wrote:
> A poll about equivalences for the "postpone x" expression.
>
[...]
>
> Let "foo" is a word that doesn't perform any parsing, doesn't access the
> parse area, and doesn't enter into compilation or interpretation state
> (i.e., any such behavior is not a part of any semantics for "foo").
>
> Let the word "compile-foo" is defined as:
>   : compile-foo postpone foo ;
> and it has the same scope as the word "foo".
>
>
>
> Proposition 1.
>   The phrase:
>     [ compile-foo ]
>   is equivalent to the phrase:
>       foo
>   in any such context when the phrase is encountered by the Forth
>   text interpreter in compilation state.
>
>
>
> Proposition 2.
>   The phrase:
>     [ postpone foo ]
>   is equivalent to the phrase:
>       foo
>   in any such context when the phrase is encountered by the Forth
>   text interpreter in compilation state.
>

Proposition 3.
The phrase:
postpone literal postpone execute
is equivalent to the phrase:
compile,
in any context.

Rationale.

1. Creating a definition programmatically has nothing to do with
compilation state and STATE. So, it should be possible regardless of the
STATE.

2. The "code ... end-code" construct works in interpretation state.

3. Then "compile," can also work in interpretation state.

4. Then "compile-foo" (defined as it's shown above) should also work in
interpretation state, and P1 should be held.

5. Assuming that P3 (an equivalence for "compile,") is held, P2 should
be held too.

--
Ruvim

Re: Poll: equivalence for postpone expression

<sb325d$91d$1@gioia.aioe.org>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=13729&group=comp.lang.forth#13729

  copy link   Newsgroups: comp.lang.forth
Path: i2pn2.org!i2pn.org!aioe.org!xrnZ5uanw3pSzK+Ytx4Jfg.user.gioia.aioe.org.POSTED!not-for-mail
From: dxfo...@gmail.com (dxforth)
Newsgroups: comp.lang.forth
Subject: Re: Poll: equivalence for postpone expression
Date: Fri, 25 Jun 2021 08:49:18 +1000
Organization: Aioe.org NNTP Server
Lines: 71
Message-ID: <sb325d$91d$1@gioia.aioe.org>
References: <salij8$m2m$1@dont-email.me> <sb24c1$jr$2@dont-email.me>
NNTP-Posting-Host: xrnZ5uanw3pSzK+Ytx4Jfg.user.gioia.aioe.org
Mime-Version: 1.0
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Transfer-Encoding: 8bit
X-Complaints-To: abuse@aioe.org
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101
Thunderbird/78.11.0
Content-Language: en-GB
X-Notice: Filtered by postfilter v. 0.9.2
 by: dxforth - Thu, 24 Jun 2021 22:49 UTC

On 25/06/2021 00:20, Ruvim wrote:
> On 2021-06-19 23:03, Ruvim wrote:
>> A poll about equivalences for the "postpone x" expression.
>>
> [...]
>>
>> Let "foo" is a word that doesn't perform any parsing, doesn't access the
>> parse area, and doesn't enter into compilation or interpretation state
>> (i.e., any such behavior is not a part of any semantics for "foo").
>>
>> Let the word "compile-foo" is defined as:
>>   : compile-foo postpone foo ;
>> and it has the same scope as the word "foo".
>>
>>
>>
>> Proposition 1.
>>   The phrase:
>>     [ compile-foo ]
>>   is equivalent to the phrase:
>>       foo
>>   in any such context when the phrase is encountered by the Forth
>>   text interpreter in compilation state.
>>
>>
>>
>> Proposition 2.
>>   The phrase:
>>     [ postpone foo ]
>>   is equivalent to the phrase:
>>       foo
>>   in any such context when the phrase is encountered by the Forth
>>   text interpreter in compilation state.
>>
>
>
> Proposition 3.
> The phrase:
> postpone literal postpone execute
> is equivalent to the phrase:
> compile,
> in any context.
>
>
>
>
> Rationale.
>
> 1. Creating a definition programmatically has nothing to do with
> compilation state and STATE. So, it should be possible regardless of the
> STATE.
>
> 2. The "code ... end-code" construct works in interpretation state.
>
> 3. Then "compile," can also work in interpretation state.
>
> 4. Then "compile-foo" (defined as it's shown above) should also work in
> interpretation state, and P1 should be held.
>
> 5. Assuming that P3 (an equivalence for "compile,") is held, P2 should
> be held too.
>

"code ... end-code" 'comma in' data as opposed to compiling a high-level
forth definition which sets 'compilation mode' and therefore STATE. It's
comparing apples and oranges.

If the proposition is compiling words should be usable inside [ ] which
AFAIK currently isn't permitted in standard programs, it would be more
convincing to argue this from a needs/benefit basis rather than equivalence
(same result obtained differently) or dubious comparisons (assembler).

Re: Poll: equivalence for postpone expression

<sb4eg2$4bm$1@dont-email.me>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=13735&group=comp.lang.forth#13735

  copy link   Newsgroups: comp.lang.forth
Path: i2pn2.org!i2pn.org!eternal-september.org!reader02.eternal-september.org!.POSTED!not-for-mail
From: ruvim.pi...@gmail.com (Ruvim)
Newsgroups: comp.lang.forth
Subject: Re: Poll: equivalence for postpone expression
Date: Fri, 25 Jun 2021 14:25:52 +0300
Organization: A noiseless patient Spider
Lines: 122
Message-ID: <sb4eg2$4bm$1@dont-email.me>
References: <salij8$m2m$1@dont-email.me> <sb24c1$jr$2@dont-email.me>
<sb325d$91d$1@gioia.aioe.org>
Mime-Version: 1.0
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Transfer-Encoding: 8bit
Injection-Date: Fri, 25 Jun 2021 11:25:54 -0000 (UTC)
Injection-Info: reader02.eternal-september.org; posting-host="0a7f16f14e31497b8241f0f4fd6254c8";
logging-data="4470"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+J0x86NMI52J3SGuiQsGDo"
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101
Thunderbird/78.11.0
Cancel-Lock: sha1:1OOf05NMc/jxVWy2sgahFNem1Rs=
In-Reply-To: <sb325d$91d$1@gioia.aioe.org>
Content-Language: en-US
X-Mozilla-News-Host: news://nntp.aioe.org
 by: Ruvim - Fri, 25 Jun 2021 11:25 UTC

On 2021-06-25 01:49, dxforth wrote:
> On 25/06/2021 00:20, Ruvim wrote:
>> On 2021-06-19 23:03, Ruvim wrote:
>>> A poll about equivalences for the "postpone x" expression.
>>>
>> [...]
>>>
>>> Let "foo" is a word that doesn't perform any parsing, doesn't access
>>> the parse area, and doesn't enter into compilation or interpretation
>>> state (i.e., any such behavior is not a part of any semantics for
>>> "foo").
>>>
>>> Let the word "compile-foo" is defined as:
>>>    : compile-foo postpone foo ;
>>> and it has the same scope as the word "foo".
>>>
>>>
>>>
>>> Proposition 1.
>>>    The phrase:
>>>      [ compile-foo ]
>>>    is equivalent to the phrase:
>>>        foo
>>>    in any such context when the phrase is encountered by the Forth
>>>    text interpreter in compilation state.
>>>
>>>
>>>
>>> Proposition 2.
>>>    The phrase:
>>>      [ postpone foo ]
>>>    is equivalent to the phrase:
>>>        foo
>>>    in any such context when the phrase is encountered by the Forth
>>>    text interpreter in compilation state.
>>>
>>
>>
>> Proposition 3.
>>     The phrase:
>>       postpone literal postpone execute
>>     is equivalent to the phrase:
>>       compile,
>>     in any context.
>>
>>
>>
>>
>> Rationale.
>>
>> 1. Creating a definition programmatically has nothing to do with
>> compilation state and STATE. So, it should be possible regardless of the
>> STATE.
>>
>> 2. The "code ... end-code" construct works in interpretation state.
>>
>> 3. Then "compile," can also work in interpretation state.
>>
>> 4. Then "compile-foo" (defined as it's shown above) should also work in
>> interpretation state, and P1 should be held.
>>
>> 5. Assuming that P3 (an equivalence for "compile,") is held, P2 should
>> be held too.
>>
>
> "code ... end-code" 'comma in' data as opposed to compiling a high-level
> forth definition which sets 'compilation mode' and therefore STATE.  It's
> comparing apples and oranges.

What is wrong to incrementally build a high-level forth definition in
interpretation state?

Well, what if we redefine "compile," and "postpone" in the following way:

: state-on ] ;
: state-off postpone [ ;

: execute-compiling ( ... xt -- ... )
state @ if execute exit then
state-on execute state-off
;
\ NB: the edge cases are not considered
\ for the sake of this example simplicity.

: compile, ( xt -- )
['] compile, execute-compiling
;
: postpone ( "name" -- )
postpone [: postpone postpone postpone ;]
postpone execute-compiling
; immediate

Now "compile," can be used interpretively, and a postponed code can be
started in interpretation state — from a program point of view. But from
the system's point of view (and the postponed code point of view), they
are performed in compilation state.

What a problem do you see now?

> If the proposition is compiling words should be usable inside [ ] which
> AFAIK currently isn't permitted in standard programs, it would be more
> convincing to argue this from a needs/benefit basis rather than equivalence
> (same result obtained differently) or dubious comparisons (assembler).

If we talk about consistency of a system, needs or benefits don't matter
at all.

But equivalency is a fundamental mechanism.

Why, in arithmetic, x^0 = 1 (for any x <> 0 ) ?

Since x^0 = x^(-1 + 1) = x^(-1) * x^(1) = 1/x * x = x/x = 1

It's just a consequence of equivalences that shall be held.

--
Ruvim

Re: Poll: equivalence for postpone expression

<sb4jon$pdp$1@gioia.aioe.org>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=13737&group=comp.lang.forth#13737

  copy link   Newsgroups: comp.lang.forth
Path: i2pn2.org!i2pn.org!aioe.org!xrnZ5uanw3pSzK+Ytx4Jfg.user.gioia.aioe.org.POSTED!not-for-mail
From: dxfo...@gmail.com (dxforth)
Newsgroups: comp.lang.forth
Subject: Re: Poll: equivalence for postpone expression
Date: Fri, 25 Jun 2021 22:55:52 +1000
Organization: Aioe.org NNTP Server
Lines: 137
Message-ID: <sb4jon$pdp$1@gioia.aioe.org>
References: <salij8$m2m$1@dont-email.me> <sb24c1$jr$2@dont-email.me>
<sb325d$91d$1@gioia.aioe.org> <sb4eg2$4bm$1@dont-email.me>
NNTP-Posting-Host: xrnZ5uanw3pSzK+Ytx4Jfg.user.gioia.aioe.org
Mime-Version: 1.0
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Transfer-Encoding: 8bit
X-Complaints-To: abuse@aioe.org
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101
Thunderbird/78.11.0
X-Notice: Filtered by postfilter v. 0.9.2
Content-Language: en-GB
 by: dxforth - Fri, 25 Jun 2021 12:55 UTC

On 25/06/2021 21:25, Ruvim wrote:
> On 2021-06-25 01:49, dxforth wrote:
>> On 25/06/2021 00:20, Ruvim wrote:
>>> On 2021-06-19 23:03, Ruvim wrote:
>>>> A poll about equivalences for the "postpone x" expression.
>>>>
>>> [...]
>>>>
>>>> Let "foo" is a word that doesn't perform any parsing, doesn't access
>>>> the parse area, and doesn't enter into compilation or interpretation
>>>> state (i.e., any such behavior is not a part of any semantics for
>>>> "foo").
>>>>
>>>> Let the word "compile-foo" is defined as:
>>>>    : compile-foo postpone foo ;
>>>> and it has the same scope as the word "foo".
>>>>
>>>>
>>>>
>>>> Proposition 1.
>>>>    The phrase:
>>>>      [ compile-foo ]
>>>>    is equivalent to the phrase:
>>>>        foo
>>>>    in any such context when the phrase is encountered by the Forth
>>>>    text interpreter in compilation state.
>>>>
>>>>
>>>>
>>>> Proposition 2.
>>>>    The phrase:
>>>>      [ postpone foo ]
>>>>    is equivalent to the phrase:
>>>>        foo
>>>>    in any such context when the phrase is encountered by the Forth
>>>>    text interpreter in compilation state.
>>>>
>>>
>>>
>>> Proposition 3.
>>>     The phrase:
>>>       postpone literal postpone execute
>>>     is equivalent to the phrase:
>>>       compile,
>>>     in any context.
>>>
>>>
>>>
>>>
>>> Rationale.
>>>
>>> 1. Creating a definition programmatically has nothing to do with
>>> compilation state and STATE. So, it should be possible regardless of the
>>> STATE.
>>>
>>> 2. The "code ... end-code" construct works in interpretation state.
>>>
>>> 3. Then "compile," can also work in interpretation state.
>>>
>>> 4. Then "compile-foo" (defined as it's shown above) should also work in
>>> interpretation state, and P1 should be held.
>>>
>>> 5. Assuming that P3 (an equivalence for "compile,") is held, P2 should
>>> be held too.
>>>
>>
>> "code ... end-code" 'comma in' data as opposed to compiling a high-level
>> forth definition which sets 'compilation mode' and therefore STATE.  It's
>> comparing apples and oranges.
>
> What is wrong to incrementally build a high-level forth definition in
> interpretation state?

: ', ' ] compile, postpone [ ;

: foo [ ', >r ', * ', r> ', / ] ;

vs.

: foo >r * r> / ;

>
>
> Well, what if we redefine "compile," and "postpone" in the following way:
>
> : state-on ] ;
> : state-off postpone [ ;
>
> : execute-compiling ( ... xt -- ... )
> state @ if execute exit then
> state-on execute state-off
> ;
> \ NB: the edge cases are not considered
> \ for the sake of this example simplicity.
>
> : compile, ( xt -- )
> ['] compile, execute-compiling
> ;
> : postpone ( "name" -- )
> postpone [: postpone postpone postpone ;]
> postpone execute-compiling
> ; immediate
>
>
> Now "compile," can be used interpretively, and a postponed code can be
> started in interpretation state — from a program point of view. But from
> the system's point of view (and the postponed code point of view), they
> are performed in compilation state.
>
> What a problem do you see now?
>
>
>
>> If the proposition is compiling words should be usable inside [ ] which
>> AFAIK currently isn't permitted in standard programs, it would be more
>> convincing to argue this from a needs/benefit basis rather than equivalence
>> (same result obtained differently) or dubious comparisons (assembler).
>
> If we talk about consistency of a system, needs or benefits don't matter
> at all.
>
> But equivalency is a fundamental mechanism.
>
> Why, in arithmetic, x^0 = 1 (for any x <> 0 ) ?
>
> Since x^0 = x^(-1 + 1) = x^(-1) * x^(1) = 1/x * x = x/x = 1
>
> It's just a consequence of equivalences that shall be held.

confusion <-- contravention

>
>
> --
> Ruvim
>

Re: Poll: equivalence for postpone expression

<sb4l9a$49n$1@dont-email.me>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=13738&group=comp.lang.forth#13738

  copy link   Newsgroups: comp.lang.forth
Path: i2pn2.org!i2pn.org!eternal-september.org!reader02.eternal-september.org!.POSTED!not-for-mail
From: ruvim.pi...@gmail.com (Ruvim)
Newsgroups: comp.lang.forth
Subject: Re: Poll: equivalence for postpone expression
Date: Fri, 25 Jun 2021 16:21:45 +0300
Organization: A noiseless patient Spider
Lines: 86
Message-ID: <sb4l9a$49n$1@dont-email.me>
References: <salij8$m2m$1@dont-email.me> <sb24c1$jr$2@dont-email.me>
<sb325d$91d$1@gioia.aioe.org> <sb4eg2$4bm$1@dont-email.me>
<sb4jon$pdp$1@gioia.aioe.org>
Mime-Version: 1.0
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Transfer-Encoding: 8bit
Injection-Date: Fri, 25 Jun 2021 13:21:46 -0000 (UTC)
Injection-Info: reader02.eternal-september.org; posting-host="0a7f16f14e31497b8241f0f4fd6254c8";
logging-data="4407"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+tRSg9WK1IhCaLpy/DioTX"
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101
Thunderbird/78.11.0
Cancel-Lock: sha1:icdhvucjRSjRqCnokt0fgbHjgO8=
In-Reply-To: <sb4jon$pdp$1@gioia.aioe.org>
Content-Language: en-US
 by: Ruvim - Fri, 25 Jun 2021 13:21 UTC

On 2021-06-25 15:55, dxforth wrote:
> On 25/06/2021 21:25, Ruvim wrote:
>> On 2021-06-25 01:49, dxforth wrote:
>>> On 25/06/2021 00:20, Ruvim wrote:
[...]
>>>> Rationale.
>>>>
>>>> 1. Creating a definition programmatically has nothing to do with
>>>> compilation state and STATE. So, it should be possible regardless of
>>>> the
>>>> STATE.
>>>>
>>>> 2. The "code ... end-code" construct works in interpretation state.
>>>>
>>>> 3. Then "compile," can also work in interpretation state.
>>>>
>>>> 4. Then "compile-foo" (defined as it's shown above) should also work in
>>>> interpretation state, and P1 should be held.
>>>>
>>>> 5. Assuming that P3 (an equivalence for "compile,") is held, P2 should
>>>> be held too.
>>>>
>>>
>>> "code ... end-code" 'comma in' data as opposed to compiling a high-level
>>> forth definition which sets 'compilation mode' and therefore STATE.
>>> It's
>>> comparing apples and oranges.
>>
>> What is wrong to incrementally build a high-level forth definition in
>> interpretation state?
>
> : ',  ' ] compile, postpone [ ;
>
> : foo  [ ', >r  ', *  ', r>  ', / ] ;
>
> vs.
>
> : foo  >r * r> / ;

As I can see, nothing wrong. It just works. Yes, it has more size. But
"compilation state" was introduced to make code shorter, I think. So
compilation state doesn't abolish incremental compilation in
interpretation state in principle.

BTW colorForth also compiles in interpretation state (it doesn't have
compilation state). In this sense, it's a kind of a Forth-assembler.

Your "'," prefix could be also a part of a colorless colorForth.

[...]
>> Now "compile," can be used interpretively, and a postponed code can be
>> started in interpretation state — from a program point of view. But from
>> the system's point of view (and the postponed code point of view), they
>> are performed in compilation state.
>>
>> What a problem do you see now?

>>> If the proposition is compiling words should be usable inside [ ] which
>>> AFAIK currently isn't permitted in standard programs, it would be more
>>> convincing to argue this from a needs/benefit basis rather than
>>> equivalence
>>> (same result obtained differently) or dubious comparisons (assembler).
>>
>> If we talk about consistency of a system, needs or benefits don't matter
>> at all.
>>
>> But equivalency is a fundamental mechanism.
>>
>> Why, in arithmetic, x^0 = 1 (for any x <> 0 ) ?
>>
>> Since x^0 = x^(-1 + 1) = x^(-1) * x^(1) = 1/x * x = x/x = 1
>>
>> It's just a consequence of equivalences that shall be held.
>
> confusion <-- contravention

What do you mean?

--
Ruvim

Re: Poll: equivalence for postpone expression

<f9be9772-c4fd-4257-8a61-e0816094b8fbn@googlegroups.com>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=13739&group=comp.lang.forth#13739

  copy link   Newsgroups: comp.lang.forth
X-Received: by 2002:a37:65c3:: with SMTP id z186mr3172078qkb.481.1624636687784;
Fri, 25 Jun 2021 08:58:07 -0700 (PDT)
X-Received: by 2002:a37:f60a:: with SMTP id y10mr12150851qkj.375.1624636687555;
Fri, 25 Jun 2021 08:58:07 -0700 (PDT)
Path: i2pn2.org!i2pn.org!weretis.net!feeder8.news.weretis.net!proxad.net!feeder1-2.proxad.net!209.85.160.216.MISMATCH!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.forth
Date: Fri, 25 Jun 2021 08:58:07 -0700 (PDT)
In-Reply-To: <sb4l9a$49n$1@dont-email.me>
Injection-Info: google-groups.googlegroups.com; posting-host=2a01:2000:2001:e78c:c51e:8ce3:de2a:7421;
posting-account=ryzhhAoAAAAIqf1uqmG9E4uP1Bagd-k2
NNTP-Posting-Host: 2a01:2000:2001:e78c:c51e:8ce3:de2a:7421
References: <salij8$m2m$1@dont-email.me> <sb24c1$jr$2@dont-email.me>
<sb325d$91d$1@gioia.aioe.org> <sb4eg2$4bm$1@dont-email.me>
<sb4jon$pdp$1@gioia.aioe.org> <sb4l9a$49n$1@dont-email.me>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <f9be9772-c4fd-4257-8a61-e0816094b8fbn@googlegroups.com>
Subject: Re: Poll: equivalence for postpone expression
From: peter.m....@gmail.com (P Falth)
Injection-Date: Fri, 25 Jun 2021 15:58:07 +0000
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
 by: P Falth - Fri, 25 Jun 2021 15:58 UTC

On Friday, 25 June 2021 at 15:21:48 UTC+2, Ruvim wrote:
> On 2021-06-25 15:55, dxforth wrote:
> > On 25/06/2021 21:25, Ruvim wrote:
> >> On 2021-06-25 01:49, dxforth wrote:
> >>> On 25/06/2021 00:20, Ruvim wrote:
> [...]
> >>>> Rationale.
> >>>>
> >>>> 1. Creating a definition programmatically has nothing to do with
> >>>> compilation state and STATE. So, it should be possible regardless of
> >>>> the
> >>>> STATE.
> >>>>
> >>>> 2. The "code ... end-code" construct works in interpretation state.
> >>>>
> >>>> 3. Then "compile," can also work in interpretation state.
> >>>>
> >>>> 4. Then "compile-foo" (defined as it's shown above) should also work in
> >>>> interpretation state, and P1 should be held.
> >>>>
> >>>> 5. Assuming that P3 (an equivalence for "compile,") is held, P2 should
> >>>> be held too.
> >>>>
> >>>
> >>> "code ... end-code" 'comma in' data as opposed to compiling a high-level
> >>> forth definition which sets 'compilation mode' and therefore STATE.
> >>> It's
> >>> comparing apples and oranges.
> >>
> >> What is wrong to incrementally build a high-level forth definition in
> >> interpretation state?
> >
> > : ', ' ] compile, postpone [ ;
> >
> > : foo [ ', >r ', * ', r> ', / ] ;
> >
> > vs.
> >
> > : foo >r * r> / ;
> As I can see, nothing wrong. It just works. Yes, it has more size. But
> "compilation state" was introduced to make code shorter, I think. So
> compilation state doesn't abolish incremental compilation in
> interpretation state in principle.

on lxf

: ', ' ] compile, postpone [ ; ok
: foo [ ', >r ', * ', r> ', / ] ; FOO redefined ok
: foo1 >r * r> / ; FOO1 redefined ok
see foo
A4A4E8 409AB3 20 C80000 5 normal FOO

409AB3 E8062C8800 call >R
409AB8 E8FA4E8800 call *
409ABD E8212C8800 call R>
409AC2 E91A4F8800 jmp /
ok
see foo1
A4A4FC 409AC7 16 C80000 5 normal FOO1

409AC7 8B4504 mov eax , [ebp+4h]
409ACA 0FAF4500 imul eax , dword [ebp]
409ACE 99 cdq
409ACF F7FB idiv ebx
409AD1 8BD8 mov ebx , eax
409AD3 8D6D08 lea ebp , [ebp+8h]
409AD6 C3 ret near
ok
10 2 5 foo1 . 4 ok
10 2 5 foo . 1 ok

more size, less efficient and wrong result.
I have some difficulty seeing the benefit!

To get the correct result

: foo [ >r ', * r> ', / ] ; FOO redefined ok
see foo
A4A514 409AD7 37 C80000 5 normal FOO

409AD7 895C24FC mov [esp-4h] , ebx
409ADB 8B5D00 mov ebx , [ebp]
409ADE 8D6D04 lea ebp , [ebp+4h]
409AE1 8D6424FC lea esp , [esp-4h]
409AE5 E8CD4E8800 call *
409AEA 895DFC mov [ebp-4h] , ebx
409AED 8B1C24 mov ebx , [esp]
409AF0 8D6DFC lea ebp , [ebp-4h]
409AF3 8D642404 lea esp , [esp+4h]
409AF7 E9E54E8800 jmp /
ok
10 2 5 foo . 4 ok

BR
Peter
>
> BTW colorForth also compiles in interpretation state (it doesn't have
> compilation state). In this sense, it's a kind of a Forth-assembler.
>
> Your "'," prefix could be also a part of a colorless colorForth.
>
>
>
> [...]
> >> Now "compile," can be used interpretively, and a postponed code can be
> >> started in interpretation state — from a program point of view.. But from
> >> the system's point of view (and the postponed code point of view), they
> >> are performed in compilation state.
> >>
> >> What a problem do you see now?
>
>
>
> >>> If the proposition is compiling words should be usable inside [ ] which
> >>> AFAIK currently isn't permitted in standard programs, it would be more
> >>> convincing to argue this from a needs/benefit basis rather than
> >>> equivalence
> >>> (same result obtained differently) or dubious comparisons (assembler)..
> >>
> >> If we talk about consistency of a system, needs or benefits don't matter
> >> at all.
> >>
> >> But equivalency is a fundamental mechanism.
> >>
> >> Why, in arithmetic, x^0 = 1 (for any x <> 0 ) ?
> >>
> >> Since x^0 = x^(-1 + 1) = x^(-1) * x^(1) = 1/x * x = x/x = 1
> >>
> >> It's just a consequence of equivalences that shall be held.
> >
> > confusion <-- contravention
> What do you mean?
>
>
> --
> Ruvim

Re: Poll: equivalence for postpone expression

<sb5eio$cvm$1@dont-email.me>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=13743&group=comp.lang.forth#13743

  copy link   Newsgroups: comp.lang.forth
Path: i2pn2.org!i2pn.org!eternal-september.org!reader02.eternal-september.org!.POSTED!not-for-mail
From: ruvim.pi...@gmail.com (Ruvim)
Newsgroups: comp.lang.forth
Subject: Re: Poll: equivalence for postpone expression
Date: Fri, 25 Jun 2021 23:33:27 +0300
Organization: A noiseless patient Spider
Lines: 106
Message-ID: <sb5eio$cvm$1@dont-email.me>
References: <salij8$m2m$1@dont-email.me> <sb24c1$jr$2@dont-email.me>
<sb325d$91d$1@gioia.aioe.org> <sb4eg2$4bm$1@dont-email.me>
<sb4jon$pdp$1@gioia.aioe.org> <sb4l9a$49n$1@dont-email.me>
<f9be9772-c4fd-4257-8a61-e0816094b8fbn@googlegroups.com>
Mime-Version: 1.0
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Fri, 25 Jun 2021 20:33:28 -0000 (UTC)
Injection-Info: reader02.eternal-september.org; posting-host="0a7f16f14e31497b8241f0f4fd6254c8";
logging-data="13302"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/+9oW/zegM917IbLUled6y"
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101
Thunderbird/78.11.0
Cancel-Lock: sha1:CV02c9Qn2uh2aAoMRnXX22vW+J4=
In-Reply-To: <f9be9772-c4fd-4257-8a61-e0816094b8fbn@googlegroups.com>
Content-Language: en-US
 by: Ruvim - Fri, 25 Jun 2021 20:33 UTC

On 2021-06-25 18:58, P Falth wrote:
> On Friday, 25 June 2021 at 15:21:48 UTC+2, Ruvim wrote:
>> On 2021-06-25 15:55, dxforth wrote:
>>> On 25/06/2021 21:25, Ruvim wrote:
>>>> On 2021-06-25 01:49, dxforth wrote:
>>>>> On 25/06/2021 00:20, Ruvim wrote:
>> [...]
>>>>>> Rationale.
>>>>>>
>>>>>> 1. Creating a definition programmatically has nothing to do with
>>>>>> compilation state and STATE. So, it should be possible regardless of
>>>>>> the
>>>>>> STATE.
>>>>>>
>>>>>> 2. The "code ... end-code" construct works in interpretation state.
>>>>>>
>>>>>> 3. Then "compile," can also work in interpretation state.
>>>>>>
>>>>>> 4. Then "compile-foo" (defined as it's shown above) should also work in
>>>>>> interpretation state, and P1 should be held.
>>>>>>
>>>>>> 5. Assuming that P3 (an equivalence for "compile,") is held, P2 should
>>>>>> be held too.
>>>>>>
>>>>>
>>>>> "code ... end-code" 'comma in' data as opposed to compiling a high-level
>>>>> forth definition which sets 'compilation mode' and therefore STATE.
>>>>> It's
>>>>> comparing apples and oranges.
>>>>
>>>> What is wrong to incrementally build a high-level forth definition in
>>>> interpretation state?
>>>
>>> : ', ' ] compile, postpone [ ;
>>>
>>> : foo [ ', >r ', * ', r> ', / ] ;
>>>
>>> vs.
>>>
>>> : foo >r * r> / ;
>> As I can see, nothing wrong. It just works. Yes, it has more size. But
>> "compilation state" was introduced to make code shorter, I think. So
>> compilation state doesn't abolish incremental compilation in
>> interpretation state in principle.
>
> on lxf
>
> : ', ' ] compile, postpone [ ; ok
> : foo [ ', >r ', * ', r> ', / ] ; FOO redefined ok
> : foo1 >r * r> / ; FOO1 redefined ok
> see foo
> A4A4E8 409AB3 20 C80000 5 normal FOO
>
> 409AB3 E8062C8800 call >R
> 409AB8 E8FA4E8800 call *
> 409ABD E8212C8800 call R>
> 409AC2 E91A4F8800 jmp /
> ok
> see foo1
> A4A4FC 409AC7 16 C80000 5 normal FOO1
>
> 409AC7 8B4504 mov eax , [ebp+4h]
> 409ACA 0FAF4500 imul eax , dword [ebp]
> 409ACE 99 cdq
> 409ACF F7FB idiv ebx
> 409AD1 8BD8 mov ebx , eax
> 409AD3 8D6D08 lea ebp , [ebp+8h]
> 409AD6 C3 ret near
> ok
> 10 2 5 foo1 . 4 ok
> 10 2 5 foo . 1 ok
>
> more size, less efficient and wrong result.

It's obvious, this "foo" is not standard. A standard program cannot tick
">r". It's a system specific definition, namely it's compliant with only
the systems where ">r" and "r>" are implemented as ordinary words. lxf
is not such a system.

> I have some difficulty seeing the benefit!

Compiling some (or all) parts of a definition in interpretation state
can benefit for debugging or learning purposes, or for meta programming
in rare cases.

Another possible application is bootstrapping of a system, but it isn't
standard compliant, in any case.

>
> To get the correct result
>
> : foo [ >r ', * r> ', / ] ; FOO redefined ok

This code is also system specific.

However, "'," can be implemented via "find" or via "find-name", in such
a way that the "foo" by dxforth will be standard compliant:

: foo [ ', >r ', * ', r> ', / ] ;

--
Ruvim

Re: Poll: equivalence for postpone expression

<sb5v92$v85$1@gioia.aioe.org>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=13745&group=comp.lang.forth#13745

  copy link   Newsgroups: comp.lang.forth
Path: i2pn2.org!i2pn.org!aioe.org!xrnZ5uanw3pSzK+Ytx4Jfg.user.gioia.aioe.org.POSTED!not-for-mail
From: dxfo...@gmail.com (dxforth)
Newsgroups: comp.lang.forth
Subject: Re: Poll: equivalence for postpone expression
Date: Sat, 26 Jun 2021 11:18:28 +1000
Organization: Aioe.org NNTP Server
Lines: 23
Message-ID: <sb5v92$v85$1@gioia.aioe.org>
References: <salij8$m2m$1@dont-email.me> <sb24c1$jr$2@dont-email.me>
<sb325d$91d$1@gioia.aioe.org> <sb4eg2$4bm$1@dont-email.me>
<sb4jon$pdp$1@gioia.aioe.org> <sb4l9a$49n$1@dont-email.me>
NNTP-Posting-Host: xrnZ5uanw3pSzK+Ytx4Jfg.user.gioia.aioe.org
Mime-Version: 1.0
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Transfer-Encoding: 8bit
X-Complaints-To: abuse@aioe.org
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101
Thunderbird/78.11.0
X-Notice: Filtered by postfilter v. 0.9.2
Content-Language: en-GB
 by: dxforth - Sat, 26 Jun 2021 01:18 UTC

On 25/06/2021 23:21, Ruvim wrote:
> On 2021-06-25 15:55, dxforth wrote:
>> On 25/06/2021 21:25, Ruvim wrote:
>>> ...
>>> What is wrong to incrementally build a high-level forth definition in
>>> interpretation state?
>>
>> : ',  ' ] compile, postpone [ ;
>>
>> : foo  [ ', >r  ', *  ', r>  ', / ] ;
>>
>> vs.
>>
>> : foo  >r * r> / ;
>
> As I can see, nothing wrong. It just works. Yes, it has more size. But
> "compilation state" was introduced to make code shorter, I think. So
> compilation state doesn't abolish incremental compilation in
> interpretation state in principle.

Turning off compiling bypasses the compile, in the forth interpreter
requiring one to do it manually. It's a strange principle that breaks
what the interpreter was designed to do.

Pages:123
server_pubkey.txt

rocksolid light 0.9.8
clearnet tor