Rocksolid Light

Welcome to novaBBS (click a section below)

mail  files  register  newsreader  groups  login

Message-ID:  

[FORTRAN] will persist for some time -- probably for at least the next decade. -- T. Cheatham


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
Poll: equivalence for postpone expression

<salij8$m2m$1@dont-email.me>

  copy mid

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

  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: Poll: equivalence for postpone expression
Date: Sat, 19 Jun 2021 23:03:51 +0300
Organization: A noiseless patient Spider
Lines: 70
Message-ID: <salij8$m2m$1@dont-email.me>
Mime-Version: 1.0
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Sat, 19 Jun 2021 20:03:52 -0000 (UTC)
Injection-Info: reader02.eternal-september.org; posting-host="90120187d813c7eff9c2c585dc8f9477";
logging-data="22614"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+YCyoeKM0Q4HnBcx8eZE+K"
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101
Thunderbird/78.11.0
Cancel-Lock: sha1:jpPnQPbbghKLVgJy2fGw8aRqSKs=
Content-Language: en-US
X-Mozilla-News-Host: snews://eternal-september.org:563
 by: Ruvim - Sat, 19 Jun 2021 20:03 UTC

A poll about equivalences for the "postpone x" expression.

Definition: a phrase is a fragment of a program expressed in the Forth
source code form.

Definition: two phrases are equivalent in a given context iff each of
them in this context always produces the same effects as other. By
default, in any given context, each lexeme that is encountered by the
Forth text interpreter is recognized as either a standard word, or a
mentioned word, or a number.

NB: a proposition that contains free variables is true iff it's true for
any possible values for the free variable.

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.

Please evaluate each proposition, according to your understanding/view,
by the following statements:

a. The proposition shall be true in a standard system.

b. It's better if the proposition is true in a system.

c. In a standard system the proposition may be true or false,
depending on the definition "foo".

d. In a standard system the first phrase (the left part of the
equivalency) may throw an exception for any "foo".

Multiple choice is admissible.

It's enough to indicate (separately for the propositions 1 and 2) the
letters where your choice is "yes". E.g. P1: ac, P2: bcd.

--
Ruvim

Re: Poll: equivalence for postpone expression

<16992fda-1751-4c59-bd2d-26a13d29f0ebn@googlegroups.com>

  copy mid

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

  copy link   Newsgroups: comp.lang.forth
X-Received: by 2002:a05:622a:43:: with SMTP id y3mr18214908qtw.247.1624173646865;
Sun, 20 Jun 2021 00:20:46 -0700 (PDT)
X-Received: by 2002:a37:f60a:: with SMTP id y10mr17400605qkj.375.1624173646646;
Sun, 20 Jun 2021 00:20:46 -0700 (PDT)
Path: i2pn2.org!i2pn.org!weretis.net!feeder6.news.weretis.net!news.snarked.org!border2.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: Sun, 20 Jun 2021 00:20:46 -0700 (PDT)
In-Reply-To: <salij8$m2m$1@dont-email.me>
Injection-Info: google-groups.googlegroups.com; posting-host=2a01:2000:2001:ae4e:d5d3:dc6:eb07:c29;
posting-account=ryzhhAoAAAAIqf1uqmG9E4uP1Bagd-k2
NNTP-Posting-Host: 2a01:2000:2001:ae4e:d5d3:dc6:eb07:c29
References: <salij8$m2m$1@dont-email.me>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <16992fda-1751-4c59-bd2d-26a13d29f0ebn@googlegroups.com>
Subject: Re: Poll: equivalence for postpone expression
From: peter.m....@gmail.com (P Falth)
Injection-Date: Sun, 20 Jun 2021 07:20:46 +0000
Content-Type: text/plain; charset="UTF-8"
Lines: 114
 by: P Falth - Sun, 20 Jun 2021 07:20 UTC

On Saturday, 19 June 2021 at 22:03:54 UTC+2, Ruvim wrote:
> A poll about equivalences for the "postpone x" expression.
>
>
> Definition: a phrase is a fragment of a program expressed in the Forth
> source code form.
>
> Definition: two phrases are equivalent in a given context iff each of
> them in this context always produces the same effects as other. By
> default, in any given context, each lexeme that is encountered by the
> Forth text interpreter is recognized as either a standard word, or a
> mentioned word, or a number.
>
> NB: a proposition that contains free variables is true iff it's true for
> any possible values for the free variable.
>
>
>
> 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.
>
This is what I get from lxf

: foo noop ; ok
: compile-foo postpone foo ; ok
: t1 [ compile-foo ] ; ok
: t2 foo ; ok
see t1
A4A2B8 4099BB 5 C80000 5 normal T1

4099BB E9E6FFFFFF jmp FOO
ok
see t2
A4A2CC 4099C0 5 C80000 5 normal T2

4099C0 E9E1FFFFFF jmp FOO
ok
: t3 [ postpone foo ] ; ok
see t3
A4A2E0 4099C5 16 C80000 5 normal T3

4099C5 895DFC mov [ebp-4h] , ebx
4099C8 BBA6994000 mov ebx , # 4099A6h
4099CD 8D6DFC lea ebp , [ebp-4h]
4099D0 E92B668700 jmp COMPILE,
ok
: t4 [ ' foo compile, ] ; ok
see t4
A4A2F4 4099D5 5 C80000 5 normal T4

4099D5 E9CCFFFFFF jmp FOO
ok

>
> Please evaluate each proposition, according to your understanding/view,
> by the following statements:
>
> a. The proposition shall be true in a standard system.
>
> b. It's better if the proposition is true in a system.
>
> c. In a standard system the proposition may be true or false,
> depending on the definition "foo".
>
> d. In a standard system the first phrase (the left part of the
> equivalency) may throw an exception for any "foo".
>
>
> Multiple choice is admissible.
>
> It's enough to indicate (separately for the propositions 1 and 2) the
> letters where your choice is "yes". E.g. P1: ac, P2: bcd.

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.

I really do not understand why you are pursuing this type of coding.

If you want to call foo in a definition why not use foo directly.

: test foo ; will always work!

BR
Peter

> --
> Ruvim

Re: Poll: equivalence for postpone expression

<60cefcaa$0$22692$e4fe514c@news.xs4all.nl>

  copy mid

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

  copy link   Newsgroups: comp.lang.forth
Path: i2pn2.org!i2pn.org!paganini.bofh.team!news.dns-netz.com!news.freedyn.net!newsfeed.xs4all.nl!newsfeed7.news.xs4all.nl!nzpost1.xs4all.net!not-for-mail
Newsgroups: comp.lang.forth
Subject: Re: Poll: equivalence for postpone expression
References: <salij8$m2m$1@dont-email.me>
X-Newsreader: trn 4.0-test77 (Sep 1, 2010)
From: alb...@cherry (none)
Originator: albert@cherry.(none) (albert)
Date: 20 Jun 2021 08:30:34 GMT
Lines: 78
Message-ID: <60cefcaa$0$22692$e4fe514c@news.xs4all.nl>
NNTP-Posting-Host: b9d89b9a.news.xs4all.nl
X-Trace: G=9X3f28hx,C=U2FsdGVkX19LZJb2ZGUebhg2kyzJJkNrxKBMz6nDaTMY0eE3gxqAo3snuJ+l//yc8lkQKuKo1XTwYfkD7fjedJtZAMExi4ttknDFoBSMUWKEGrk+85cnLPrSqZMBnoRK
X-Complaints-To: abuse@xs4all.nl
 by: none - Sun, 20 Jun 2021 08:30 UTC

In article <salij8$m2m$1@dont-email.me>, Ruvim <ruvim.pinka@gmail.com> wrote:
>A poll about equivalences for the "postpone x" expression.
>
>
>Definition: a phrase is a fragment of a program expressed in the Forth
>source code form.
>
>Definition: two phrases are equivalent in a given context iff each of
>them in this context always produces the same effects as other. By
>default, in any given context, each lexeme that is encountered by the
>Forth text interpreter is recognized as either a standard word, or a
>mentioned word, or a number.
>
>NB: a proposition that contains free variables is true iff it's true for
>any possible values for the free variable.
>
>
>
>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.
>
>
>
>
>Please evaluate each proposition, according to your understanding/view,
>by the following statements:
>
> a. The proposition shall be true in a standard system.
>
> b. It's better if the proposition is true in a system.
>
> c. In a standard system the proposition may be true or false,
>depending on the definition "foo".
>
> d. In a standard system the first phrase (the left part of the
>equivalency) may throw an exception for any "foo".
>
e. Avoid POSTPONE like the plague. Always find a way around it.

>
>Multiple choice is admissible.
>
>It's enough to indicate (separately for the propositions 1 and 2) the
>letters where your choice is "yes". E.g. P1: ac, P2: bcd.
>
>
>--
>Ruvim
--
"in our communism country Viet Nam, people are forced to be
alive and in the western country like US, people are free to
die from Covid 19 lol" duc ha
albert@spe&ar&c.xs4all.nl &=n http://home.hccnet.nl/a.w.m.van.der.horst

Re: Poll: equivalence for postpone expression

<san0f1$oge$1@dont-email.me>

  copy mid

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

  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: Sun, 20 Jun 2021 12:06:40 +0300
Organization: A noiseless patient Spider
Lines: 140
Message-ID: <san0f1$oge$1@dont-email.me>
References: <salij8$m2m$1@dont-email.me>
<16992fda-1751-4c59-bd2d-26a13d29f0ebn@googlegroups.com>
Mime-Version: 1.0
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Sun, 20 Jun 2021 09:06:42 -0000 (UTC)
Injection-Info: reader02.eternal-september.org; posting-host="3189b71aa1a993dc3872da37efc1ceb4";
logging-data="25102"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18AHAZ60WOUzQgzlINSMcgx"
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101
Thunderbird/78.11.0
Cancel-Lock: sha1:xYpcydrXl8SqwTKCACuBYbqj+jI=
In-Reply-To: <16992fda-1751-4c59-bd2d-26a13d29f0ebn@googlegroups.com>
Content-Language: en-US
 by: Ruvim - Sun, 20 Jun 2021 09:06 UTC

On 2021-06-20 10:20, P Falth wrote:
> On Saturday, 19 June 2021 at 22:03:54 UTC+2, 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.
>>
> This is what I get from lxf
>
> : foo noop ; ok
> : compile-foo postpone foo ; ok
> : t1 [ compile-foo ] ; ok
> : t2 foo ; ok
> see t1
> A4A2B8 4099BB 5 C80000 5 normal T1
>
> 4099BB E9E6FFFFFF jmp FOO
> ok
> see t2
> A4A2CC 4099C0 5 C80000 5 normal T2
>
> 4099C0 E9E1FFFFFF jmp FOO
> ok

What if "foo" is a dual semantics word? What if "foo" is also an
immediate? Does the system still hold this equivalence for such cases?

> : t3 [ postpone foo ] ; ok
> see t3
> A4A2E0 4099C5 16 C80000 5 normal T3
>
> 4099C5 895DFC mov [ebp-4h] , ebx
> 4099C8 BBA6994000 mov ebx , # 4099A6h
> 4099CD 8D6DFC lea ebp , [ebp-4h]
> 4099D0 E92B668700 jmp COMPILE,
> ok
> : t4 [ ' foo compile, ] ; ok
> see t4
> A4A2F4 4099D5 5 C80000 5 normal T4
>
> 4099D5 E9CCFFFFFF jmp FOO
> ok

Then, you don't support equivalence for "compile," that it is equivalent
to "postpone literal postpone execute", do you?

>>
>> Please evaluate each proposition, according to your understanding/view,
>> by the following statements:
>>
>> a. The proposition shall be true in a standard system.
>>
>> b. It's better if the proposition is true in a system.
>>
>> c. In a standard system the proposition may be true or false,
>> depending on the definition "foo".
>>
>> d. In a standard system the first phrase (the left part of the
>> equivalency) may throw an exception for any "foo".
>>
>>
>> Multiple choice is admissible.
>>
>> It's enough to indicate (separately for the propositions 1 and 2) the
>> letters where your choice is "yes". E.g. P1: ac, P2: bcd.
>
> In my opinion compiling code while not in compilation state should
> not be done in a standard system.

It seems you wanted to say "in a standard program".

Then, you support [a99-027], don't you?

> It might work in some systems but not all.

If you think the standard allows that it doesn't work regardless "foo",
then your choice is the option "d".

>
> I really do not understand why you are pursuing this type of coding.

It's not a type of coding.

It's a problem of the language consistency and equivalences of different
expressions. In what cases the language meets a user's expectations in
this regard, and it what cases it doesn't. And why the language doesn't
meet them, if any. And what are the clear rules in this regard.

[a99-027] provides a clear rule, but many people don't follow it.

Actually, any standard system can support the expected equivalences,
(while they are consistent). But they should be clear verbalized.

>
> If you want to call foo in a definition why not use foo directly.
>
> : test foo ; will always work!

[a99-027] that performing compilation semantics in the interpretation
state is ambiguous.
https://groups.google.com/forum/message/raw?msg=comp.lang.forth/RmsDuen7YkY/xDvW74uzi30J/

--
Ruvim

Re: Poll: equivalence for postpone expression

<san0f4$oge$2@dont-email.me>

  copy mid

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

  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: Sun, 20 Jun 2021 12:06:45 +0300
Organization: A noiseless patient Spider
Lines: 17
Message-ID: <san0f4$oge$2@dont-email.me>
References: <salij8$m2m$1@dont-email.me>
<60cefcaa$0$22692$e4fe514c@news.xs4all.nl>
Mime-Version: 1.0
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Sun, 20 Jun 2021 09:06:45 -0000 (UTC)
Injection-Info: reader02.eternal-september.org; posting-host="3189b71aa1a993dc3872da37efc1ceb4";
logging-data="25102"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/uusMdVM2QqeC/oMKx40pi"
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101
Thunderbird/78.11.0
Cancel-Lock: sha1:Tjy9VZo7+yxRwItQzD4iTarVDUI=
In-Reply-To: <60cefcaa$0$22692$e4fe514c@news.xs4all.nl>
Content-Language: en-US
 by: Ruvim - Sun, 20 Jun 2021 09:06 UTC

On 2021-06-20 11:30, albert wrote:
[...]

> e. Avoid POSTPONE like the plague. Always find a way around it.

It's impossible in too many cases.

For example, how do you define a well known but non standard word "rdrop"?

: rdrop postpone r> postpone drop ; immediate

It's impossible do define "rdrop" without "postpone" in a standard
program. Don't suggest to use "evaluate".

--
Ruvim

Re: Poll: equivalence for postpone expression

<87mtrkrie6.fsf@nightsong.com>

  copy mid

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

  copy link   Newsgroups: comp.lang.forth
Path: i2pn2.org!i2pn.org!eternal-september.org!reader02.eternal-september.org!.POSTED!not-for-mail
From: no.em...@nospam.invalid (Paul Rubin)
Newsgroups: comp.lang.forth
Subject: Re: Poll: equivalence for postpone expression
Date: Sun, 20 Jun 2021 02:32:17 -0700
Organization: A noiseless patient Spider
Lines: 9
Message-ID: <87mtrkrie6.fsf@nightsong.com>
References: <salij8$m2m$1@dont-email.me>
<60cefcaa$0$22692$e4fe514c@news.xs4all.nl>
<san0f4$oge$2@dont-email.me>
Mime-Version: 1.0
Content-Type: text/plain
Injection-Info: reader02.eternal-september.org; posting-host="f9c94c8e3e5ffa3b913a55e5479b6cae";
logging-data="32659"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18EquVec/53rIMfnHUeZ5m+"
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.1 (gnu/linux)
Cancel-Lock: sha1:UjTV5p+m51tMLrY8xXY9BrZI9qY=
sha1:S3P1RYUAYS4pEyLOup9pCai7J6o=
 by: Paul Rubin - Sun, 20 Jun 2021 09:32 UTC

Ruvim <ruvim.pinka@gmail.com> writes:
> : rdrop postpone r> postpone drop ; immediate
>
> It's impossible do define "rdrop" without "postpone" in a standard
> program. Don't suggest to use "evaluate".

Is this nonstandard?

: rdrop r> r> drop ;

Re: Poll: equivalence for postpone expression

<san2io$5bg$1@dont-email.me>

  copy mid

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

  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: Sun, 20 Jun 2021 12:42:47 +0300
Organization: A noiseless patient Spider
Lines: 30
Message-ID: <san2io$5bg$1@dont-email.me>
References: <salij8$m2m$1@dont-email.me>
<60cefcaa$0$22692$e4fe514c@news.xs4all.nl> <san0f4$oge$2@dont-email.me>
<87mtrkrie6.fsf@nightsong.com>
Mime-Version: 1.0
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Sun, 20 Jun 2021 09:42:48 -0000 (UTC)
Injection-Info: reader02.eternal-september.org; posting-host="3189b71aa1a993dc3872da37efc1ceb4";
logging-data="5488"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19VPYXqVjLKenJfmV2gKp8x"
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101
Thunderbird/78.11.0
Cancel-Lock: sha1:nyXoweZXN5RM1MNiK+uCCgc+yrY=
In-Reply-To: <87mtrkrie6.fsf@nightsong.com>
Content-Language: en-US
 by: Ruvim - Sun, 20 Jun 2021 09:42 UTC

On 2021-06-20 12:32, Paul Rubin wrote:
> Ruvim <ruvim.pinka@gmail.com> writes:
>> : rdrop postpone r> postpone drop ; immediate
>>
>> It's impossible do define "rdrop" without "postpone" in a standard
>> program. Don't suggest to use "evaluate".
>
> Is this nonstandard?
>
> : rdrop r> r> drop ;
>

Yes, this code isn't standard.

See 3.2.3.3 Return stack
https://forth-standard.org/standard/usage#usage:returnstack

Two excerpts:

A program shall not access values on the return stack (using "R@",
"R>", "2R@", "2R>" or "NR>") that it did not place there using ">R",
"2>R" or "N>R";

All values placed on the return stack within a definition shall be
removed before the definition is terminated or before EXIT is executed.

--
Ruvim

Re: Poll: equivalence for postpone expression

<2cb70016-06d5-4875-9fb5-e1e5ce8709ben@googlegroups.com>

  copy mid

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

  copy link   Newsgroups: comp.lang.forth
X-Received: by 2002:a0c:8563:: with SMTP id n90mr14461503qva.41.1624186089282; Sun, 20 Jun 2021 03:48:09 -0700 (PDT)
X-Received: by 2002:a37:689:: with SMTP id 131mr17462882qkg.173.1624186089076; Sun, 20 Jun 2021 03:48:09 -0700 (PDT)
Path: i2pn2.org!i2pn.org!paganini.bofh.team!news.dns-netz.com!news.freedyn.net!newsfeed.xs4all.nl!newsfeed8.news.xs4all.nl!tr2.eu1.usenetexpress.com!feeder.usenetexpress.com!tr1.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: Sun, 20 Jun 2021 03:48:08 -0700 (PDT)
In-Reply-To: <san0f1$oge$1@dont-email.me>
Injection-Info: google-groups.googlegroups.com; posting-host=2a01:2000:2001:ae4e:d5d3:dc6:eb07:c29; posting-account=ryzhhAoAAAAIqf1uqmG9E4uP1Bagd-k2
NNTP-Posting-Host: 2a01:2000:2001:ae4e:d5d3:dc6:eb07:c29
References: <salij8$m2m$1@dont-email.me> <16992fda-1751-4c59-bd2d-26a13d29f0ebn@googlegroups.com> <san0f1$oge$1@dont-email.me>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <2cb70016-06d5-4875-9fb5-e1e5ce8709ben@googlegroups.com>
Subject: Re: Poll: equivalence for postpone expression
From: peter.m....@gmail.com (P Falth)
Injection-Date: Sun, 20 Jun 2021 10:48:09 +0000
Content-Type: text/plain; charset="UTF-8"
Lines: 158
 by: P Falth - Sun, 20 Jun 2021 10:48 UTC

On Sunday, 20 June 2021 at 11:06:44 UTC+2, Ruvim wrote:
> On 2021-06-20 10:20, P Falth wrote:
> > On Saturday, 19 June 2021 at 22:03:54 UTC+2, 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.
> >>
> > This is what I get from lxf
> >
> > : foo noop ; ok
> > : compile-foo postpone foo ; ok
> > : t1 [ compile-foo ] ; ok
> > : t2 foo ; ok
> > see t1
> > A4A2B8 4099BB 5 C80000 5 normal T1
> >
> > 4099BB E9E6FFFFFF jmp FOO
> > ok
> > see t2
> > A4A2CC 4099C0 5 C80000 5 normal T2
> >
> > 4099C0 E9E1FFFFFF jmp FOO
> > ok
> What if "foo" is a dual semantics word? What if "foo" is also an
> immediate? Does the system still hold this equivalence for such cases?

: foo1 noop ; immediate ok
: compile-foo1 postpone foo1 ; ok
: t6 [ compile-foo1 ] ; ok
see t6
A4A408 409A3F 1 C80000 5 normal T6

409A3F C3 ret near
ok

:p foo2 ." compiling" ;p ok
:r foo2 ." interpreting" ;r ok
foo2 interpreting ok
: compile-foo2 postpone foo2 ; ok
: t7 [ compile-foo2 ] ; compiling ok
see t7
A4A3D4 409A39 1 C80000 5 normal T7

409A39 C3 ret near
ok

> > : t3 [ postpone foo ] ; ok
> > see t3
> > A4A2E0 4099C5 16 C80000 5 normal T3
> >
> > 4099C5 895DFC mov [ebp-4h] , ebx
> > 4099C8 BBA6994000 mov ebx , # 4099A6h
> > 4099CD 8D6DFC lea ebp , [ebp-4h]
> > 4099D0 E92B668700 jmp COMPILE,
> > ok
> > : t4 [ ' foo compile, ] ; ok
> > see t4
> > A4A2F4 4099D5 5 C80000 5 normal T4
> >
> > 4099D5 E9CCFFFFFF jmp FOO
> > ok
> 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

> >>
> >> Please evaluate each proposition, according to your understanding/view,
> >> by the following statements:
> >>
> >> a. The proposition shall be true in a standard system.
> >>
> >> b. It's better if the proposition is true in a system.
> >>
> >> c. In a standard system the proposition may be true or false,
> >> depending on the definition "foo".
> >>
> >> d. In a standard system the first phrase (the left part of the
> >> equivalency) may throw an exception for any "foo".
> >>
> >>
> >> Multiple choice is admissible.
> >>
> >> It's enough to indicate (separately for the propositions 1 and 2) the
> >> letters where your choice is "yes". E.g. P1: ac, P2: bcd.
> >
> > In my opinion compiling code while not in compilation state should
> > not be done in a standard system.
> It seems you wanted to say "in a standard program".
>
> Then, you support [a99-027], don't you?
> > It might work in some systems but not all.
> If you think the standard allows that it doesn't work regardless "foo",
> then your choice is the option "d".
> >
> > I really do not understand why you are pursuing this type of coding.
> It's not a type of coding.
>
> It's a problem of the language consistency and equivalences of different
> expressions. In what cases the language meets a user's expectations in
> this regard, and it what cases it doesn't. And why the language doesn't
> meet them, if any. And what are the clear rules in this regard.
>
> [a99-027] provides a clear rule, but many people don't follow it.
>
> Actually, any standard system can support the expected equivalences,
> (while they are consistent). But they should be clear verbalized.
> >
> > If you want to call foo in a definition why not use foo directly.
> >
> > : test foo ; will always work!
> [a99-027] that performing compilation semantics in the interpretation
> state is ambiguous.

Yes to this I agree

Peter

> https://groups.google.com/forum/message/raw?msg=comp.lang.forth/RmsDuen7YkY/xDvW74uzi30J/
>
> --
> Ruvim

Re: Poll: equivalence for postpone expression

<60cf2055$0$22692$e4fe514c@news.xs4all.nl>

  copy mid

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

  copy link   Newsgroups: comp.lang.forth
Path: i2pn2.org!i2pn.org!aioe.org!feeder1.feed.usenet.farm!feed.usenet.farm!newsfeed.xs4all.nl!newsfeed9.news.xs4all.nl!nzpost1.xs4all.net!not-for-mail
Newsgroups: comp.lang.forth
References: <salij8$m2m$1@dont-email.me> <60cefcaa$0$22692$e4fe514c@news.xs4all.nl> <san0f4$oge$2@dont-email.me> <87mtrkrie6.fsf@nightsong.com>
Subject: Re: Poll: equivalence for postpone expression
X-Newsreader: trn 4.0-test77 (Sep 1, 2010)
From: alb...@cherry (none)
Originator: albert@cherry.(none) (albert)
Date: 20 Jun 2021 11:02:45 GMT
Lines: 45
Message-ID: <60cf2055$0$22692$e4fe514c@news.xs4all.nl>
NNTP-Posting-Host: 9f9e6c5d.news.xs4all.nl
X-Trace: G=9X3f28hx,C=U2FsdGVkX18J/bM8HdWQUvL2V4N2u4+dE2Y33wU1W3oSiIeBLptoIT/ntKiAjb+yr099vs2EqE7izHRtScyK7Wd2MZMmzqNT7ngqotgJvQGCLNQqpoPzCNsWQi6wEb/D
X-Complaints-To: abuse@xs4all.nl
 by: none - Sun, 20 Jun 2021 11:02 UTC

In article <87mtrkrie6.fsf@nightsong.com>,
Paul Rubin <no.email@nospam.invalid> wrote:
>Ruvim <ruvim.pinka@gmail.com> writes:
>> : rdrop postpone r> postpone drop ; immediate
>>
>> It's impossible do define "rdrop" without "postpone" in a standard
>> program. Don't suggest to use "evaluate".
>
>Is this nonstandard?
>
> : rdrop r> r> drop ;

: rdrop "R> DROP" EVALUATE ;
There, I did it. One could save the search order and establish
forthwordlist as the only wordlist and one would be pretty safe.

Now Ruvim threaten me with ... because it is tabu and not pc.
With what? Problems? I have done some maintenance programming
in my life and face worse problems than those that could be
caused by that.

Alternatively:
If someone forced me to use a Forth without RDROP and I had to compile
a program with RDROP , I just would go to my boss, and say "hey, your
programs are not standard" and propose to replace all occurrences in
the application with the equivalent standard sequence. He would agree.

Alternatively:
CODE RDROP
LEA, SI'| BO| [SI] 8 B,
NEXT,

Alternatively:
: RDROP 'R> , 'DROP , ; IMMEDIATE

Alternatively:
Pseudo PC.
: RDROP ['] R> COMPILE, ['] DROP COMPILE, ; IMMEDIATE

Groetjes Albert
--
"in our communism country Viet Nam, people are forced to be
alive and in the western country like US, people are free to
die from Covid 19 lol" duc ha
albert@spe&ar&c.xs4all.nl &=n http://home.hccnet.nl/a.w.m.van.der.horst

Re: Poll: equivalence for postpone expression

<sanac5$1vvg$1@gioia.aioe.org>

  copy mid

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

  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: Sun, 20 Jun 2021 21:55:50 +1000
Organization: Aioe.org NNTP Server
Lines: 48
Message-ID: <sanac5$1vvg$1@gioia.aioe.org>
References: <salij8$m2m$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 - Sun, 20 Jun 2021 11:55 UTC

On 20/06/2021 06:03, 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.
>
> 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.

DX-Forth 4.45 2021-06-14

Software floating-point (separate stack)

Using FORTH.SCR

: foo noop ; ok
: compile-foo postpone foo ; COMPILE is system ok

: t1 [ compile-foo ] ;
Error: "compile-foo" compilation only

: t2 [ postpone foo ] ;
Error: "foo" compilation only

If POSTPONE is based on COMPILE, it typically can compile inside [ ] ;
if based on COMPILE it typically can not. Under ANS neither POSTPONE
nor COMPILE, is guaranteed to work inside [ ] . Disambigufiers for
them aren't guaranteed to work as they only work at the user level.

AFAICS the rule is: Don't attempt to compile while inside [ ] . Is there
a compelling reason why one should be able to?

Re: Poll: equivalence for postpone expression

<2021Jun20.145357@mips.complang.tuwien.ac.at>

  copy mid

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

  copy link   Newsgroups: comp.lang.forth
Path: i2pn2.org!i2pn.org!eternal-september.org!reader02.eternal-september.org!.POSTED!not-for-mail
From: ant...@mips.complang.tuwien.ac.at (Anton Ertl)
Newsgroups: comp.lang.forth
Subject: Re: Poll: equivalence for postpone expression
Date: Sun, 20 Jun 2021 12:53:57 GMT
Organization: Institut fuer Computersprachen, Technische Universitaet Wien
Lines: 17
Message-ID: <2021Jun20.145357@mips.complang.tuwien.ac.at>
References: <salij8$m2m$1@dont-email.me> <sanac5$1vvg$1@gioia.aioe.org>
Injection-Info: reader02.eternal-september.org; posting-host="9530f4f67fd71ee99c9b968e99e2aa84";
logging-data="3476"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19sjLdxv6LOa9ElLYbiBy8b"
Cancel-Lock: sha1:u6NxFZ69MAfWdPb1T2Y01Lps8+E=
X-newsreader: xrn 10.00-beta-3
 by: Anton Ertl - Sun, 20 Jun 2021 12:53 UTC

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.

- anton
--
M. Anton Ertl http://www.complang.tuwien.ac.at/anton/home.html
comp.lang.forth FAQs: http://www.complang.tuwien.ac.at/forth/faq/toc.html
New standard: http://www.forth200x.org/forth200x.html
EuroForth 2021: https://euro.theforth.net/2021

Re: Poll: equivalence for postpone expression

<sanggc$tp4$1@dont-email.me>

  copy mid

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

  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: Sun, 20 Jun 2021 16:40:28 +0300
Organization: A noiseless patient Spider
Lines: 138
Message-ID: <sanggc$tp4$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>
Mime-Version: 1.0
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Sun, 20 Jun 2021 13:40:28 -0000 (UTC)
Injection-Info: reader02.eternal-september.org; posting-host="3189b71aa1a993dc3872da37efc1ceb4";
logging-data="30500"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/zgUpb7wB4hkQ9X1vNIuAG"
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101
Thunderbird/78.11.0
Cancel-Lock: sha1:t3r78egR7z+f0Pp+FK2UL+9zo6g=
In-Reply-To: <2cb70016-06d5-4875-9fb5-e1e5ce8709ben@googlegroups.com>
Content-Language: en-US
 by: Ruvim - Sun, 20 Jun 2021 13:40 UTC

On 2021-06-20 13:48, P Falth wrote:
> On Sunday, 20 June 2021 at 11:06:44 UTC+2, Ruvim wrote:
>> On 2021-06-20 10:20, P Falth wrote:
>>> On Saturday, 19 June 2021 at 22:03:54 UTC+2, 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.
>>>>
[...]
>> What if "foo" is a dual semantics word? What if "foo" is also an
>> immediate? Does the system still hold this equivalence for such cases?
>
> : foo1 noop ; immediate ok
> : compile-foo1 postpone foo1 ; ok
> : t6 [ compile-foo1 ] ; ok
> see t6
> A4A408 409A3F 1 C80000 5 normal T6
>
> 409A3F C3 ret near
> ok
>
> :p foo2 ." compiling" ;p ok
> :r foo2 ." interpreting" ;r ok
> foo2 interpreting ok
> : compile-foo2 postpone foo2 ; ok
> : t7 [ compile-foo2 ] ; compiling ok
> see t7
> A4A3D4 409A39 1 C80000 5 normal T7
>
> 409A39 C3 ret near
> ok

According to the proposition, the equivalence takes place in compilation
state, so in this case the effects are also the same for:

] foo2 [
and
] [ compile-foo2 ] [

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.

>>> : t3 [ postpone foo ] ; ok
>>> see t3
>>> A4A2E0 4099C5 16 C80000 5 normal T3
>>>
>>> 4099C5 895DFC mov [ebp-4h] , ebx
>>> 4099C8 BBA6994000 mov ebx , # 4099A6h
>>> 4099CD 8D6DFC lea ebp , [ebp-4h]
>>> 4099D0 E92B668700 jmp COMPILE,
>>> ok
>>> : t4 [ ' foo compile, ] ; ok
>>> see t4
>>> A4A2F4 4099D5 5 C80000 5 normal T4
>>>
>>> 4099D5 E9CCFFFFFF jmp FOO
>>> ok
>> 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, ]"

[...]
>>> I really do not understand why you are pursuing this type of coding.
>> >> It's not a type of coding.
>>
>> It's a problem of the language consistency and equivalences of different
>> expressions. In what cases the language meets a user's expectations in
>> this regard, and it what cases it doesn't. And why the language doesn't
>> meet them, if any. And what are the clear rules in this regard.
>>
>> [a99-027] provides a clear rule, but many people don't follow it.
>>
[...]
>> [a99-027] that performing compilation semantics in the interpretation
>> state is ambiguous.
>
> Yes to this I agree

It's good to know!

It looks like more systems rely on a99-027 than it seemed.

--
Ruvim

Re: Poll: equivalence for postpone expression

<sanhvb$94b$1@dont-email.me>

  copy mid

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

  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: Sun, 20 Jun 2021 17:05:30 +0300
Organization: A noiseless patient Spider
Lines: 68
Message-ID: <sanhvb$94b$1@dont-email.me>
References: <salij8$m2m$1@dont-email.me> <sanac5$1vvg$1@gioia.aioe.org>
Mime-Version: 1.0
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Transfer-Encoding: 8bit
Injection-Date: Sun, 20 Jun 2021 14:05:31 -0000 (UTC)
Injection-Info: reader02.eternal-september.org; posting-host="3189b71aa1a993dc3872da37efc1ceb4";
logging-data="9355"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/QnnZWqvzjGr7QfUnlnfzL"
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101
Thunderbird/78.11.0
Cancel-Lock: sha1:XgTt5l5ALiVt7iOLf9/BFXcUohE=
In-Reply-To: <sanac5$1vvg$1@gioia.aioe.org>
Content-Language: en-US
 by: Ruvim - Sun, 20 Jun 2021 14:05 UTC

On 2021-06-20 14:55, dxforth wrote:
> On 20/06/2021 06:03, 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.
>>
>> 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.
>
> DX-Forth 4.45 2021-06-14
>
> Software floating-point (separate stack)
>
> Using FORTH.SCR
>
> : foo noop ; ok
> : compile-foo postpone foo ; COMPILE is system ok
>
> : t1 [ compile-foo ] ;
> Error: "compile-foo" compilation only
>
> : t2 [ postpone foo ] ;
> Error: "foo" compilation only

It's the option "d" in my list.

BTW, a more appropriate error message should mention not "foo" but
"postpone" (perhaps I already said that before :).

> If  POSTPONE  is based on  COMPILE,  it typically can compile inside [ ] ;
> if based on  COMPILE  it typically can not.  Under ANS neither  POSTPONE
> nor  COMPILE,  is guaranteed to work inside  [ ] .  Disambigufiers for
> them aren't guaranteed to work as they only work at the user level.

A standard program can access only the user level. Hence, if you
guarantee that it works on the user level, it's enough. I provided a PoC
for that.

> AFAICS the rule is: Don't attempt to compile while inside [ ] .  Is there
> a compelling reason why one should be able to?

So you as an implementer rely on a99-027, and as a user you follow the
a99-027 rule (both its parts).

--
Ruvim

Re: Poll: equivalence for postpone expression

<sanimf$1enr$1@gioia.aioe.org>

  copy mid

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

  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 00:17:49 +1000
Organization: Aioe.org NNTP Server
Lines: 14
Message-ID: <sanimf$1enr$1@gioia.aioe.org>
References: <salij8$m2m$1@dont-email.me> <sanac5$1vvg$1@gioia.aioe.org>
<2021Jun20.145357@mips.complang.tuwien.ac.at>
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
Content-Language: en-GB
X-Notice: Filtered by postfilter v. 0.9.2
 by: dxforth - Sun, 20 Jun 2021 14:17 UTC

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?

Re: Poll: equivalence for postpone expression

<sanjk3$k6e$1@dont-email.me>

  copy mid

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

  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: Sun, 20 Jun 2021 09:33:38 -0500
Organization: A noiseless patient Spider
Lines: 103
Message-ID: <sanjk3$k6e$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: Sun, 20 Jun 2021 14:33:39 -0000 (UTC)
Injection-Info: reader02.eternal-september.org; posting-host="cbacc5fe6c26d0166aa2db8e560fe31d";
logging-data="20686"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+4JesyODA3/lvpblyHTzAY"
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101
Thunderbird/78.10.1
Cancel-Lock: sha1:8JGfLDA5HVocFr/Gxb+n3dNi9B0=
In-Reply-To: <salij8$m2m$1@dont-email.me>
Content-Language: en-US
 by: Krishna Myneni - Sun, 20 Jun 2021 14:33 UTC

On 6/19/21 3:03 PM, Ruvim wrote:
> A poll about equivalences for the "postpone x" expression.
>
>
> Definition: a phrase is a fragment of a program expressed in the Forth
> source code form.
>
> Definition: two phrases are equivalent in a given context iff each of
> them in this context always produces the same effects as other. By
> default, in any given context, each lexeme that is encountered by the
> Forth text interpreter is recognized as either a standard word, or a
> mentioned word, or a number.
>
> NB: a proposition that contains free variables is true iff it's true for
> any possible values for the free variable.
>
>
>
> 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.
>
>
>
>
> Please evaluate each proposition, according to your understanding/view,
> by the following statements:
>
>  a. The proposition shall be true in a standard system.
>
>  b. It's better if the proposition is true in a system.
>
>  c. In a standard system the proposition may be true or false,
> depending on the definition "foo".
>
>  d. In a standard system the first phrase (the left part of the
> equivalency) may throw an exception for any "foo".
>
>
> Multiple choice is admissible.
>
> It's enough to indicate (separately for the propositions 1 and 2) the
> letters where your choice is "yes". E.g.  P1: ac, P2: bcd.
>
>

I will select position (b) tentatively for now. These phrases in Props 1
and 2 currently do not work in kForth, but I can't see a reason for them
not to work, provided that they are part of a definition.

Alternative ways to accomplish the same thing in kForth are the following:

: foo ." xxxx " ;
ok
: t1 [ ' foo compile, ] ;
ok
t1
xxxx ok
..s
<empty>
ok
: t2 [ ' foo ] literal execute ;
ok
t2
xxxx ok

Using POSTPONE to define RDROP works, of course, as it should per the
standard.

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
bridge too far for some Forth system implementors, but, as a Forth
programmer as well as system implementor, I don't wish to be needlessly
restricted in how to code my problem. The changes required to accomplish
this do not appear to me to be too great a burden.

Krishna

Re: Poll: equivalence for postpone expression

<sanjtu$m42$1@dont-email.me>

  copy mid

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

  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: Sun, 20 Jun 2021 09:38:52 -0500
Organization: A noiseless patient Spider
Lines: 25
Message-ID: <sanjtu$m42$1@dont-email.me>
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>
Mime-Version: 1.0
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Transfer-Encoding: 8bit
Injection-Date: Sun, 20 Jun 2021 14:38:54 -0000 (UTC)
Injection-Info: reader02.eternal-september.org; posting-host="cbacc5fe6c26d0166aa2db8e560fe31d";
logging-data="22658"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/u90PZ4dxFq07hKUs33L/C"
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101
Thunderbird/78.10.1
Cancel-Lock: sha1:Fvml+jhI+TB6bFEFlChhQbtF+Eo=
In-Reply-To: <sanimf$1enr$1@gioia.aioe.org>
Content-Language: en-US
 by: Krishna Myneni - Sun, 20 Jun 2021 14:38 UTC

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.

Krishna

Re: Poll: equivalence for postpone expression

<0a23eee5-ed59-4330-81d7-f1f5df6f3c78n@googlegroups.com>

  copy mid

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

  copy link   Newsgroups: comp.lang.forth
X-Received: by 2002:ac8:6d15:: with SMTP id o21mr19211640qtt.54.1624201242553;
Sun, 20 Jun 2021 08:00:42 -0700 (PDT)
X-Received: by 2002:a37:a38d:: with SMTP id m135mr18441596qke.36.1624201242274;
Sun, 20 Jun 2021 08:00:42 -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: Sun, 20 Jun 2021 08:00:42 -0700 (PDT)
In-Reply-To: <sanggc$tp4$1@dont-email.me>
Injection-Info: google-groups.googlegroups.com; posting-host=2a01:2000:2001:ae4e:d5d3:dc6:eb07:c29;
posting-account=ryzhhAoAAAAIqf1uqmG9E4uP1Bagd-k2
NNTP-Posting-Host: 2a01:2000:2001:ae4e:d5d3:dc6:eb07:c29
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>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <0a23eee5-ed59-4330-81d7-f1f5df6f3c78n@googlegroups.com>
Subject: Re: Poll: equivalence for postpone expression
From: peter.m....@gmail.com (P Falth)
Injection-Date: Sun, 20 Jun 2021 15:00:42 +0000
Content-Type: text/plain; charset="UTF-8"
 by: P Falth - Sun, 20 Jun 2021 15:00 UTC

On Sunday, 20 June 2021 at 15:40:30 UTC+2, Ruvim wrote:
> On 2021-06-20 13:48, P Falth wrote:
> > On Sunday, 20 June 2021 at 11:06:44 UTC+2, Ruvim wrote:
> >> On 2021-06-20 10:20, P Falth wrote:
> >>> On Saturday, 19 June 2021 at 22:03:54 UTC+2, 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.
> >>>>
> [...]
> >> What if "foo" is a dual semantics word? What if "foo" is also an
> >> immediate? Does the system still hold this equivalence for such cases?
> >
> > : foo1 noop ; immediate ok
> > : compile-foo1 postpone foo1 ; ok
> > : t6 [ compile-foo1 ] ; ok
> > see t6
> > A4A408 409A3F 1 C80000 5 normal T6
> >
> > 409A3F C3 ret near
> > ok
> >
> > :p foo2 ." compiling" ;p ok
> > :r foo2 ." interpreting" ;r ok
> > foo2 interpreting ok
> > : compile-foo2 postpone foo2 ; ok
> > : t7 [ compile-foo2 ] ; compiling ok
> > see t7
> > A4A3D4 409A39 1 C80000 5 normal T7
> >
> > 409A39 C3 ret near
> > ok
> According to the proposition, the equivalence takes place in compilation
> state, so in this case the effects are also the same for:
>
> ] foo2 [
> and
> ] [ compile-foo2 ] [

: t8 foo2 ; compiling ok
see t8
A4A41C 409A40 1 C80000 5 normal T8

409A40 C3 ret near
ok

Compiling out side a started definition is not supported in lxf.
only
] foo2 [
might crash the system

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

> >>> : t3 [ postpone foo ] ; ok
> >>> see t3
> >>> A4A2E0 4099C5 16 C80000 5 normal T3
> >>>
> >>> 4099C5 895DFC mov [ebp-4h] , ebx
> >>> 4099C8 BBA6994000 mov ebx , # 4099A6h
> >>> 4099CD 8D6DFC lea ebp , [ebp-4h]
> >>> 4099D0 E92B668700 jmp COMPILE,
> >>> ok
> >>> : t4 [ ' foo compile, ] ; ok
> >>> see t4
> >>> A4A2F4 4099D5 5 C80000 5 normal T4
> >>>
> >>> 4099D5 E9CCFFFFFF jmp FOO
> >>> ok
> >> 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

Peter

> [...]
> >>> I really do not understand why you are pursuing this type of coding.
> >> >> It's not a type of coding.
> >>
> >> It's a problem of the language consistency and equivalences of different
> >> expressions. In what cases the language meets a user's expectations in
> >> this regard, and it what cases it doesn't. And why the language doesn't
> >> meet them, if any. And what are the clear rules in this regard.
> >>
> >> [a99-027] provides a clear rule, but many people don't follow it.
> >>
> [...]
> >> [a99-027] that performing compilation semantics in the interpretation
> >> state is ambiguous.
> >
> > Yes to this I agree
> It's good to know!
>
> It looks like more systems rely on a99-027 than it seemed.
>
>
> --
> Ruvim

Re: Poll: equivalence for postpone expression

<sano6h$1sql$1@gioia.aioe.org>

  copy mid

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

  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 01:51:45 +1000
Organization: Aioe.org NNTP Server
Lines: 73
Message-ID: <sano6h$1sql$1@gioia.aioe.org>
References: <salij8$m2m$1@dont-email.me> <sanac5$1vvg$1@gioia.aioe.org>
<sanhvb$94b$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
Content-Language: en-GB
X-Notice: Filtered by postfilter v. 0.9.2
 by: dxforth - Sun, 20 Jun 2021 15:51 UTC

On 21/06/2021 00:05, Ruvim wrote:
> On 2021-06-20 14:55, dxforth wrote:
>> On 20/06/2021 06:03, 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.
>>>
>>> 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.
>>
>> DX-Forth 4.45 2021-06-14
>>
>> Software floating-point (separate stack)
>>
>> Using FORTH.SCR
>>
>> : foo noop ; ok
>> : compile-foo postpone foo ; COMPILE is system ok
>>
>> : t1 [ compile-foo ] ;
>> Error: "compile-foo" compilation only
>>
>> : t2 [ postpone foo ] ;
>> Error: "foo" compilation only
>
> It's the option "d" in my list.
>
> BTW, a more appropriate error message should mention not "foo" but
> "postpone" (perhaps I already said that before :).
>
>
>
>> If  POSTPONE  is based on  COMPILE,  it typically can compile inside [ ] ;
>> if based on  COMPILE  it typically can not.  Under ANS neither  POSTPONE
>> nor  COMPILE,  is guaranteed to work inside  [ ] .  Disambigufiers for
>> them aren't guaranteed to work as they only work at the user level.
>
> A standard program can access only the user level. Hence, if you
> guarantee that it works on the user level, it's enough. I provided a PoC
> for that.

A disambigufier for COMPILE, at the user level won't fix the COMPILE,
that results in T1 succeeding when the intention was it should fail.

>
>
>> AFAICS the rule is: Don't attempt to compile while inside [ ] .  Is there
>> a compelling reason why one should be able to?
>
> So you as an implementer rely on a99-027, and as a user you follow the
> a99-027 rule (both its parts).

I barely understand it. As an implementer I know about COMPILE and
common practice. As a user I know what turns on interpreting and what
turns it off. I assumed that was enough. Perhaps ANS did too.

Re: Poll: equivalence for postpone expression

<sanqhu$3c5$1@dont-email.me>

  copy mid

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

  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: Sun, 20 Jun 2021 19:31:58 +0300
Organization: A noiseless patient Spider
Lines: 123
Message-ID: <sanqhu$3c5$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>
Mime-Version: 1.0
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Sun, 20 Jun 2021 16:31:58 -0000 (UTC)
Injection-Info: reader02.eternal-september.org; posting-host="3189b71aa1a993dc3872da37efc1ceb4";
logging-data="3461"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/bOCx47HWnWCpqASMs+//R"
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101
Thunderbird/78.11.0
Cancel-Lock: sha1:oLohuSBsGUpop+vU4+Os1Fa62ko=
In-Reply-To: <0a23eee5-ed59-4330-81d7-f1f5df6f3c78n@googlegroups.com>
Content-Language: en-US
 by: Ruvim - Sun, 20 Jun 2021 16:31 UTC

On 2021-06-20 18:00, P Falth wrote:
> On Sunday, 20 June 2021 at 15:40:30 UTC+2, Ruvim wrote:
>> On 2021-06-20 13:48, P Falth wrote:
[...]

>>> :p foo2 ." compiling" ;p ok
>>> :r foo2 ." interpreting" ;r ok

BTW, in my scratch it was:

: foo2 ." interpreting" ;
c: foo2 ." compiling" ;

And in the first version the special ";c" also was used.

Concerning naming conventions. If a word starts new definition and it's
a parsing word, give it a name in the from "xxx:". But if the word
starts new definition and it isn't a parsing word, give it a name in the
form ":xxx" (like in the case of the ":noname" word).

So I chose "c:" over ":c". It also has a slightly better readability.

>>> foo2 interpreting ok
>>> : compile-foo2 postpone foo2 ; ok
>>> : t7 [ compile-foo2 ] ; compiling ok
>>> see t7
>>> A4A3D4 409A39 1 C80000 5 normal T7
>>>
>>> 409A39 C3 ret near
>>> ok
>> According to the proposition, the equivalence takes place in compilation
>> state, so in this case the effects are also the same for:
>>
>> ] foo2 [
>> and
>> ] [ compile-foo2 ] [
>
> : t8 foo2 ; compiling ok
> see t8
> A4A41C 409A40 1 C80000 5 normal T8
>
> 409A40 C3 ret near
> ok
>
> Compiling out side a started definition is not supported in lxf.
> only
> ] foo2 [
> might crash the system

Yes, in the general case. And if it crashes the system, then it should
crash it in the both cases, and then the same effects are shown in both
cases.

OTOH, in this particular case "foo2" doesn't append anything to the
current definition, so it's unclear why it might crash the system?

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

[...]
>>>> 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 :-)

--
Ruvim

Re: Poll: equivalence for postpone expression

<sanqj2$vvh$1@gioia.aioe.org>

  copy mid

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

  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 02:32:34 +1000
Organization: Aioe.org NNTP Server
Lines: 31
Message-ID: <sanqj2$vvh$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>
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 - Sun, 20 Jun 2021 16:32 UTC

On 21/06/2021 00:17, 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?
>

I discovered one. I amended my COMPILE, to include ?COMP.
Recompiling my system it choked on the following:

:noname ... [ ... ( xt) compile, ] ;

To make that work under ANS would require:

:noname ... [ ... ( xt) ] literal execute ;

which is non-optimum.

So was ANS wrong to specify no interpretation for COMPILE, - or did
they have a reason it couldn't? Classically COMPILE, was just , so
it would have to be for reasons other than ITC/DTC.

Re: Poll: equivalence for postpone expression

<sanu6l$se1$1@dont-email.me>

  copy mid

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

  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: Sun, 20 Jun 2021 20:34:12 +0300
Organization: A noiseless patient Spider
Lines: 116
Message-ID: <sanu6l$se1$1@dont-email.me>
References: <salij8$m2m$1@dont-email.me> <sanjk3$k6e$1@dont-email.me>
Mime-Version: 1.0
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Transfer-Encoding: 8bit
Injection-Date: Sun, 20 Jun 2021 17:34:13 -0000 (UTC)
Injection-Info: reader02.eternal-september.org; posting-host="3189b71aa1a993dc3872da37efc1ceb4";
logging-data="29121"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/OMVpSN7N7Mix0H8XKq5Un"
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101
Thunderbird/78.11.0
Cancel-Lock: sha1:pTx9X/tMoDFU74blRWzHv3ZCopU=
In-Reply-To: <sanjk3$k6e$1@dont-email.me>
Content-Language: en-US
 by: Ruvim - Sun, 20 Jun 2021 17:34 UTC

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.
>>
>>
>>
>> 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.
>>
>>
>>
>>
>> Please evaluate each proposition, according to your
>> understanding/view, by the following statements:
>>
>>   a. The proposition shall be true in a standard system.
>>
>>   b. It's better if the proposition is true in a system.
>>
>>   c. In a standard system the proposition may be true or false,
>> depending on the definition "foo".
>>
>>   d. In a standard system the first phrase (the left part of the
>> equivalency) may throw an exception for any "foo".
>>
>>
>> Multiple choice is admissible.
>>
>> It's enough to indicate (separately for the propositions 1 and 2) the
>> letters where your choice is "yes". E.g.  P1: ac, P2: bcd.
>>
>>
>
> 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).

Some excerpts from kForth-64/forth-src/modules.fs
at https://git.io/Jnos8

: module-do-ref ( ... xt 1 | xt -1 -- ...)
-1 = state @ and IF compile, ELSE execute THEN ;

: [m] ( ... "module-name" "word-name" -- ? )
member-find
?dup IF module-do-ref ELSE member-not-found THEN
; immediate

: ∋ postpone [m] ; immediate

If a system holds P2, and the equivalence for "compile,", then "∋" can
be defined as:

: ∋ [ ' [m] compile, ] ; immediate

Also, in this case it's possible to use "synonym".

A compatible way In a syst A compatibile wah

: ∋ postpone [m] ; immediate

[...]
> 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.

It's allowed. I restricted only the semantics for "foo" to have simpler
test cases (the phrases in P1 and P2). These restrictions on "foo" can
be eliminated, by the cost of more complicated test cases.

> That might be a
> bridge too far for some Forth system implementors, but, as a Forth
> programmer as well as system implementor, I don't wish to be needlessly
> restricted in how to code my problem. The changes required to accomplish
> this do not appear to me to be too great a burden.

--
Ruvim

Re: Poll: equivalence for postpone expression

<8db87fb9-1f3d-4d04-bfc2-a864a657bbddn@googlegroups.com>

  copy mid

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

  copy link   Newsgroups: comp.lang.forth
X-Received: by 2002:a05:622a:104:: with SMTP id u4mr2369947qtw.254.1624211662820;
Sun, 20 Jun 2021 10:54:22 -0700 (PDT)
X-Received: by 2002:a37:689:: with SMTP id 131mr19052234qkg.173.1624211662490;
Sun, 20 Jun 2021 10:54:22 -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: Sun, 20 Jun 2021 10:54:22 -0700 (PDT)
In-Reply-To: <sanqhu$3c5$1@dont-email.me>
Injection-Info: google-groups.googlegroups.com; posting-host=2a01:2000:2001:ae4e:f8:d08a:400c:f912;
posting-account=ryzhhAoAAAAIqf1uqmG9E4uP1Bagd-k2
NNTP-Posting-Host: 2a01:2000:2001:ae4e:f8:d08a:400c:f912
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>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <8db87fb9-1f3d-4d04-bfc2-a864a657bbddn@googlegroups.com>
Subject: Re: Poll: equivalence for postpone expression
From: peter.m....@gmail.com (P Falth)
Injection-Date: Sun, 20 Jun 2021 17:54:22 +0000
Content-Type: text/plain; charset="UTF-8"
 by: P Falth - Sun, 20 Jun 2021 17:54 UTC

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:
> >> On 2021-06-20 13:48, P Falth wrote:
> [...]
> >>> :p foo2 ." compiling" ;p ok
> >>> :r foo2 ." interpreting" ;r ok
> BTW, in my scratch it was:
>
> : foo2 ." interpreting" ;
> c: foo2 ." compiling" ;
>
> And in the first version the special ";c" also was used.
>
> Concerning naming conventions. If a word starts new definition and it's
> a parsing word, give it a name in the from "xxx:". But if the word
> starts new definition and it isn't a parsing word, give it a name in the
> form ":xxx" (like in the case of the ":noname" word).

I know that was a mistake done 20 years ago!
having it like p: makes it also easier to search for a definition of a word in a source file.
I do not remember why I chose these words! I think p was for primitive and
r definitely for runtime. The ;p and ;r are needed.
Important for me was that the compile action was defined first and
independently from the interpretation action.

> So I chose "c:" over ":c". It also has a slightly better readability.
> >>> foo2 interpreting ok
> >>> : compile-foo2 postpone foo2 ; ok
> >>> : t7 [ compile-foo2 ] ; compiling ok
> >>> see t7
> >>> A4A3D4 409A39 1 C80000 5 normal T7
> >>>
> >>> 409A39 C3 ret near
> >>> ok
> >> According to the proposition, the equivalence takes place in compilation
> >> state, so in this case the effects are also the same for:
> >>
> >> ] foo2 [
> >> and
> >> ] [ compile-foo2 ] [
> >
> > : t8 foo2 ; compiling ok
> > see t8
> > A4A41C 409A40 1 C80000 5 normal T8
> >
> > 409A40 C3 ret near
> > ok
> >
> > Compiling out side a started definition is not supported in lxf.
> > only
> > ] foo2 [
> > might crash the system
> Yes, in the general case. And if it crashes the system, then it should
> crash it in the both cases, and then the same effects are shown in both
> cases.
>
> OTOH, in this particular case "foo2" doesn't append anything to the
> current definition, so it's unclear why it might crash the system?

In fact it will not, for that reason. But something like ] dup [ will if no definitions
has been done since the start of the system., as the code generator is not
initialized.

> >> 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 will not do that.
In LXF64 I have postexecute that will execute a postponed immediate word
with state set to compiling.

>
>
> [...]
> >>>> 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!

Peter

>
> --
> Ruvim

Re: Poll: equivalence for postpone expression

<sao64v$l60$1@dont-email.me>

  copy mid

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

  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: Sun, 20 Jun 2021 20:49:51 +0100
Organization: A noiseless patient Spider
Lines: 19
Message-ID: <sao64v$l60$1@dont-email.me>
References: <salij8$m2m$1@dont-email.me>
<16992fda-1751-4c59-bd2d-26a13d29f0ebn@googlegroups.com>
Mime-Version: 1.0
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Sun, 20 Jun 2021 19:49:51 -0000 (UTC)
Injection-Info: reader02.eternal-september.org; posting-host="0d30c46c3c0d259ce03b8a9a54b138f1";
logging-data="21696"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19AUS5UfIJXRNHfL1QzCjvznrIe1k28Jyw="
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101
Thunderbird/78.11.0
Cancel-Lock: sha1:fSAgsLx2aIKmiZlh1Vw8buy8YY4=
In-Reply-To: <16992fda-1751-4c59-bd2d-26a13d29f0ebn@googlegroups.com>
Content-Language: en-GB
 by: Gerry Jackson - Sun, 20 Jun 2021 19:49 UTC

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?

As Q99-027 making it ambiguous never made it into the standard it is
irrelevant and so isn't forbidden as are the opinions of people who are
no longer involved with the standard.

--
Gerry

Re: Poll: equivalence for postpone expression

<saoqv2$aah$1@dont-email.me>

  copy mid

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

  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: Sun, 20 Jun 2021 20:45:04 -0500
Organization: A noiseless patient Spider
Lines: 142
Message-ID: <saoqv2$aah$1@dont-email.me>
References: <salij8$m2m$1@dont-email.me> <sanjk3$k6e$1@dont-email.me>
<sanu6l$se1$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 01:45:06 -0000 (UTC)
Injection-Info: reader02.eternal-september.org; posting-host="130d2fd5fda18d8dedd96f1b38ce81f0";
logging-data="10577"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+MsTwsANOWGt+Ifdf4I6oM"
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101
Thunderbird/78.10.1
Cancel-Lock: sha1:56c4eCt4Q+T1pnRBGgg2MgmMSOY=
In-Reply-To: <sanu6l$se1$1@dont-email.me>
Content-Language: en-US
 by: Krishna Myneni - Mon, 21 Jun 2021 01:45 UTC

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.
>>>
>>>
>>>
>>> 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.
>>>
>>>
>>>
>>>
>>> Please evaluate each proposition, according to your
>>> understanding/view, by the following statements:
>>>
>>>   a. The proposition shall be true in a standard system.
>>>
>>>   b. It's better if the proposition is true in a system.
>>>
>>>   c. In a standard system the proposition may be true or false,
>>> depending on the definition "foo".
>>>
>>>   d. In a standard system the first phrase (the left part of the
>>> equivalency) may throw an exception for any "foo".
>>>
>>>
>>> Multiple choice is admissible.
>>>
>>> It's enough to indicate (separately for the propositions 1 and 2) the
>>> letters where your choice is "yes". E.g.  P1: ac, P2: bcd.
>>>
>>>
>>
>> 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):

-------
: foo ." xxx " ; ok
: compile-foo postpone foo ; ok
: t0 foo ; ok
: t1 [ compile-foo ] ; ok

see t0
: t0
foo ; ok
see t1
: t1
foo ; ok

include modules.fs ok
Module: modcheck ok
Begin-Module ok
Public: ok
: foo ." xxxx " ; ok
End-Module ok
Also modcheck ok
[m] modcheck foo xxxx ok
∋ modcheck foo xxxx ok
: test [ ∋ modcheck foo ] ; xxxx ok
------

However, this is in fact the intended behaviour of the module member
reference syntax. The underlying word, MODULE-DO-REF , is state-smart so
that [M] and its graphic equivalent ∋ will always execute the referenced
module member function when in interpretation state. kForth gives the
same behavior as above for the modcheck modules example.

In the use setting of data acquistion and control, it is necessary to be
able to execute module member functions directly from the interpreter.
For such applications, no use cases have come up in which a phrase such
as [ ∋ modcheck foo ] is used inside of a definition, particularly for
the purpose of compiling module member functions. However, it is
certainly possible that there may exist use cases for compilation
behavior of such phrases when used inside of a definition. In such a
case, a different word is needed.

> Some excerpts from kForth-64/forth-src/modules.fs
> at https://git.io/Jnos8
>
>   : module-do-ref ( ... xt 1 | xt -1 -- ...)
>     -1 = state @ and IF  compile, ELSE execute THEN ;
>
>   : [m] ( ... "module-name"  "word-name" -- ? )
>      member-find
>      ?dup IF  module-do-ref  ELSE  member-not-found  THEN
>   ; immediate
>
>   : ∋ postpone [m] ; immediate
>
> If a system holds P2, and the equivalence for "compile,", then "∋" can
> be defined as:
>
>   : ∋ [ ' [m] compile, ] ; immediate
>
>
> Also, in this case it's possible to use "synonym".
>

I believe we will find many cases in which we need to use a different
word to reference a module member function when compilation behavior is
explicitly needed. It is cases like these in which dual-semantics Forth
systems may possess a clear advantage for predicting what source code
will do.

Krishna

Re: Poll: equivalence for postpone expression

<saoua0$t6u$1@dont-email.me>

  copy mid

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

  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: Sun, 20 Jun 2021 21:42:06 -0500
Organization: A noiseless patient Spider
Lines: 137
Message-ID: <saoua0$t6u$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: Mon, 21 Jun 2021 02:42:08 -0000 (UTC)
Injection-Info: reader02.eternal-september.org; posting-host="130d2fd5fda18d8dedd96f1b38ce81f0";
logging-data="29918"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/jK9NmPi0ePZCMhkQmpBvk"
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101
Thunderbird/78.10.1
Cancel-Lock: sha1:TennuWNWAmFm8nTgukZjrSJg7uE=
In-Reply-To: <saoqv2$aah$1@dont-email.me>
Content-Language: en-US
 by: Krishna Myneni - Mon, 21 Jun 2021 02:42 UTC

On 6/20/21 8:45 PM, 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.
>>>>
>>>>
>>>>
>>>> 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.
>>>>
>>>>
>>>>
>>>>
>>>> Please evaluate each proposition, according to your
>>>> understanding/view, by the following statements:
>>>>
>>>>   a. The proposition shall be true in a standard system.
>>>>
>>>>   b. It's better if the proposition is true in a system.
>>>>
>>>>   c. In a standard system the proposition may be true or false,
>>>> depending on the definition "foo".
>>>>
>>>>   d. In a standard system the first phrase (the left part of the
>>>> equivalency) may throw an exception for any "foo".
>>>>
>>>>
>>>> Multiple choice is admissible.
>>>>
>>>> It's enough to indicate (separately for the propositions 1 and 2)
>>>> the letters where your choice is "yes". E.g.  P1: ac, P2: bcd.
>>>>
>>>>
>>>
>>> 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):
>
> -------
> : foo ." xxx " ;  ok
> : compile-foo postpone foo ;  ok
> : t0 foo ;  ok
> : t1 [ compile-foo ] ;  ok
>
> see t0
> : t0
>   foo ; ok
> see t1
> : t1
>   foo ; ok
>
> include modules.fs  ok
> Module: modcheck  ok
> Begin-Module  ok
> Public:  ok
> : foo ." xxxx " ;  ok
> End-Module  ok
> Also modcheck  ok
> [m] modcheck foo xxxx  ok
> ∋ modcheck foo xxxx  ok
> : test [ ∋ modcheck foo ] ; xxxx  ok
> ------
>
> However, this is in fact the intended behaviour of the module member
> reference syntax. The underlying word, MODULE-DO-REF , is state-smart so
> that [M] and its graphic equivalent ∋ will always execute the referenced
> module member function when in interpretation state. kForth gives the
> same behavior as above for the modcheck modules example.
>
> In the use setting of data acquistion and control, it is necessary to be
> able to execute module member functions directly from the interpreter.
> For such applications, no use cases have come up in which a phrase such
> as [ ∋ modcheck foo ] is used inside of a definition, particularly for
> the purpose of compiling module member functions. However, it is
> certainly possible that there may exist use cases for compilation
> behavior of such phrases when used inside of a definition. In such a
> case, a different word is needed.
> ...

Ok, we have the word [M'] to provide compiling behavior, e.g., for the
modcheck module example,

-----
: test [m] modcheck foo ; \ ok
test xxxx ok
: test ∋ modcheck foo ; \ ... ok
test xxxx ok

: test [m'] modcheck foo execute ; \ ... ok
test xxxx ok
: test [ [m'] modcheck foo ] execute ; \ ... ok
test xxxx ok
-----

The last definition of TEST does not work in kForth, owing to the fact
that it does not obey Proposition 1. It does work in Gforth, however.

Krishna

Pages:123
server_pubkey.txt

rocksolid light 0.9.8
clearnet tor