Rocksolid Light

Welcome to novaBBS (click a section below)

mail  files  register  newsreader  groups  login

Message-ID:  

Experience varies directly with equipment ruined.


devel / comp.lang.forth / Re: POSTPONEing literals?

SubjectAuthor
* POSTPONEing literals?dxforth
`* Re: POSTPONEing literals?Hugh Aguilar
 +* Re: POSTPONEing literals?dxforth
 |+* Re: POSTPONEing literals?Anton Ertl
 ||`* Re: POSTPONEing literals?dxforth
 || `* Re: POSTPONEing literals?Anton Ertl
 ||  `* Re: POSTPONEing literals?dxforth
 ||   +- Re: POSTPONEing literals?dxforth
 ||   +* Re: POSTPONEing literals?Ruvim
 ||   |`* Re: POSTPONEing literals?dxforth
 ||   | `- Re: POSTPONEing literals?Ruvim
 ||   `- Re: POSTPONEing literals?Anton Ertl
 |`* Re: POSTPONEing literals?dxforth
 | `* Re: POSTPONEing literals?dxforth
 |  `* Re: POSTPONEing literals?Anton Ertl
 |   +* Re: POSTPONEing literals?dxforth
 |   |`* Re: POSTPONEing literals?Anton Ertl
 |   | +* Re: POSTPONEing literals?Ruvim
 |   | |`* Re: POSTPONEing literals?dxforth
 |   | | `* Re: POSTPONEing literals?Ruvim
 |   | |  +* Re: POSTPONEing literals?none
 |   | |  |`* Re: POSTPONEing literals?Ruvim
 |   | |  | `* Re: POSTPONEing literals?none
 |   | |  |  `* Re: POSTPONEing literals?Ruvim
 |   | |  |   `- Re: POSTPONEing literals?none
 |   | |  `* Re: POSTPONEing literals?dxforth
 |   | |   `* Re: POSTPONEing literals?Ruvim
 |   | |    `* Re: POSTPONEing literals?dxforth
 |   | |     +* Re: POSTPONEing literals?Ruvim
 |   | |     |+* Re: POSTPONEing literals?Hugh Aguilar
 |   | |     ||`- Re: POSTPONEing literals?dxforth
 |   | |     |`* Re: POSTPONEing literals?dxforth
 |   | |     | +* Re: POSTPONEing literals?Ruvim
 |   | |     | |+- VFX bug in COMPILE, (was: POSTPONEing literals?)Ruvim
 |   | |     | |+* Re: POSTPONEing literals?Stephen Pelc
 |   | |     | ||+* Re: POSTPONEing literals?Anton Ertl
 |   | |     | |||`* Re: POSTPONEing literals?Stephen Pelc
 |   | |     | ||| +* Re: POSTPONEing literals?Ruvim
 |   | |     | ||| |`* Re: POSTPONEing literals?Stephen Pelc
 |   | |     | ||| | `* Fix VFX FIND (was: POSTPONEing literals?)Ruvim
 |   | |     | ||| |  +- Re: Fix VFX FIND (was: POSTPONEing literals?)Ruvim
 |   | |     | ||| |  `* Re: Fix VFX FIND (was: POSTPONEing literals?)Stephen Pelc
 |   | |     | ||| |   +* Re: Fix VFX FINDRuvim
 |   | |     | ||| |   |`* Re: Fix VFX FINDStephen Pelc
 |   | |     | ||| |   | `- Re: Fix VFX FINDRuvim
 |   | |     | ||| |   +* Re: Fix VFX FIND (was: POSTPONEing literals?)Paul Liles
 |   | |     | ||| |   |+* Re: Fix VFX FIND (was: POSTPONEing literals?)Ruvim
 |   | |     | ||| |   ||`* Re: Fix VFX FIND (was: POSTPONEing literals?)Paul Liles
 |   | |     | ||| |   || +* Re: Fix VFX FIND (was: POSTPONEing literals?)Anton Ertl
 |   | |     | ||| |   || |`* Re: Fix VFX FIND (was: POSTPONEing literals?)minf...@arcor.de
 |   | |     | ||| |   || | +- Re: Fix VFX FIND (was: POSTPONEing literals?)Paul Liles
 |   | |     | ||| |   || | +* Re: Fix VFX FIND (was: POSTPONEing literals?)Krishna Myneni
 |   | |     | ||| |   || | |`* Re: Fix VFX FIND (was: POSTPONEing literals?)minf...@arcor.de
 |   | |     | ||| |   || | | `* Re: Fix VFX FIND (was: POSTPONEing literals?)Anton Ertl
 |   | |     | ||| |   || | |  +- Re: Fix VFX FIND (was: POSTPONEing literals?)minf...@arcor.de
 |   | |     | ||| |   || | |  +- Re: Fix VFX FIND (was: POSTPONEing literals?)minf...@arcor.de
 |   | |     | ||| |   || | |  +- Re: Fix VFX FIND (was: POSTPONEing literals?)dxforth
 |   | |     | ||| |   || | |  `* single-xt and dual-xt approaches (was: Fix VFX FIND)Ruvim
 |   | |     | ||| |   || | |   +- Re: single-xt and dual-xt approaches (was: Fix VFX FIND)none
 |   | |     | ||| |   || | |   `- Re: single-xt and dual-xt approaches (was: Fix VFX FIND)dxforth
 |   | |     | ||| |   || | `- Re: Fix VFX FIND (was: POSTPONEing literals?)dxforth
 |   | |     | ||| |   || `- Re: Fix VFX FIND (was: POSTPONEing literals?)Ruvim
 |   | |     | ||| |   |`* Re: Fix VFX FIND (was: POSTPONEing literals?)Stephen Pelc
 |   | |     | ||| |   | `* Re: Fix VFX FIND (was: POSTPONEing literals?)Paul Liles
 |   | |     | ||| |   |  +- Re: Fix VFX FIND (was: POSTPONEing literals?)Stephen Pelc
 |   | |     | ||| |   |  `- Re: Fix VFX FIND (was: POSTPONEing literals?)Anton Ertl
 |   | |     | ||| |   `- Re: Fix VFX FIND (was: POSTPONEing literals?)none
 |   | |     | ||| `* Re: POSTPONEing literals?Anton Ertl
 |   | |     | |||  +* Re: POSTPONEing literals?Ruvim
 |   | |     | |||  |+- FIND clarification rationale (was: POSTPONEing literals?)Ruvim
 |   | |     | |||  |+- Re: POSTPONEing literals?Anton Ertl
 |   | |     | |||  |`* Re: POSTPONEing literals?Stephen Pelc
 |   | |     | |||  | +- Re: POSTPONEing literals?Ruvim
 |   | |     | |||  | `* Re: POSTPONEing literals?dxforth
 |   | |     | |||  |  +- Re: POSTPONEing literals?none
 |   | |     | |||  |  +* Re: POSTPONEing literals?Ruvim
 |   | |     | |||  |  |+* Re: POSTPONEing literals?none
 |   | |     | |||  |  ||`- Re: POSTPONEing literals?Ruvim
 |   | |     | |||  |  |`* Re: POSTPONEing literals?dxforth
 |   | |     | |||  |  | +* Re: POSTPONEing literals?Stephen Pelc
 |   | |     | |||  |  | |`- Re: POSTPONEing literals?dxforth
 |   | |     | |||  |  | `- Re: POSTPONEing literals?Ruvim
 |   | |     | |||  |  `- Re: POSTPONEing literals?Doug Hoffman
 |   | |     | |||  `* Re: POSTPONEing literals?Marcel Hendrix
 |   | |     | |||   +- Re: POSTPONEing literals?Ruvim
 |   | |     | |||   `- Re: POSTPONEing literals?Anton Ertl
 |   | |     | ||`- Re: POSTPONEing literals?Ruvim
 |   | |     | |`* Re: POSTPONEing literals?dxforth
 |   | |     | | `* Re: POSTPONEing literals?Anton Ertl
 |   | |     | |  `* Re: POSTPONEing literals?dxforth
 |   | |     | |   `* Re: POSTPONEing literals?Ruvim
 |   | |     | |    `* Re: POSTPONEing literals?dxforth
 |   | |     | |     `* Re: POSTPONEing literals?P Falth
 |   | |     | |      `* Re: POSTPONEing literals?Ruvim
 |   | |     | |       +* Alternative to FIND (was: POSTPONEing literals?)Ruvim
 |   | |     | |       |`* Re: Alternative to FIND (was: POSTPONEing literals?)P Falth
 |   | |     | |       | +* Re: Alternative to FIND (was: POSTPONEing literals?)Anton Ertl
 |   | |     | |       | |`- Re: Alternative to FIND (was: POSTPONEing literals?)P Falth
 |   | |     | |       | `* Re: Alternative to FINDRuvim
 |   | |     | |       |  `* Re: Alternative to FINDP Falth
 |   | |     | |       |   +- Re: Alternative to FINDminf...@arcor.de
 |   | |     | |       |   +* Re: Alternative to FINDRuvim
 |   | |     | |       |   `* Re: Alternative to FINDStephen Pelc
 |   | |     | |       `* Re: POSTPONEing literals?P Falth
 |   | |     | `- Re: POSTPONEing literals?Stephen Pelc
 |   | |     `* Re: POSTPONEing literals?Anton Ertl
 |   | `- Re: POSTPONEing literals?dxforth
 |   `- Re: POSTPONEing literals?none
 `* Re: POSTPONEing literals?azathot...@gmail.com

Pages:123456789
POSTPONEing literals?

<s6a8o8$va3$1@gioia.aioe.org>

  copy mid

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

  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: POSTPONEing literals?
Date: Wed, 28 Apr 2021 10:03:21 +1000
Organization: Aioe.org NNTP Server
Lines: 3
Message-ID: <s6a8o8$va3$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.10.0
Content-Language: en-GB
X-Mozilla-News-Host: snews://nntp.aioe.org:563
X-Notice: Filtered by postfilter v. 0.9.2
 by: dxforth - Wed, 28 Apr 2021 00:03 UTC

I've found an essentially no-cost way of implementing it.
Other than the novelty of being able to write ]] 123 [[
what are the reasons/examples for having it?

Re: POSTPONEing literals?

<31ba090a-29c8-4b5e-9b04-22c9d43115d5n@googlegroups.com>

  copy mid

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

  copy link   Newsgroups: comp.lang.forth
X-Received: by 2002:a37:c209:: with SMTP id i9mr18150147qkm.363.1619581394701;
Tue, 27 Apr 2021 20:43:14 -0700 (PDT)
X-Received: by 2002:a05:622a:1186:: with SMTP id m6mr24388423qtk.319.1619581394520;
Tue, 27 Apr 2021 20:43:14 -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: Tue, 27 Apr 2021 20:43:14 -0700 (PDT)
In-Reply-To: <s6a8o8$va3$1@gioia.aioe.org>
Injection-Info: google-groups.googlegroups.com; posting-host=148.167.132.243; posting-account=OxDKOgoAAADW0cxAqHqpN1zqeCoSsDap
NNTP-Posting-Host: 148.167.132.243
References: <s6a8o8$va3$1@gioia.aioe.org>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <31ba090a-29c8-4b5e-9b04-22c9d43115d5n@googlegroups.com>
Subject: Re: POSTPONEing literals?
From: hughagui...@gmail.com (Hugh Aguilar)
Injection-Date: Wed, 28 Apr 2021 03:43:14 +0000
Content-Type: text/plain; charset="UTF-8"
 by: Hugh Aguilar - Wed, 28 Apr 2021 03:43 UTC

On Tuesday, April 27, 2021 at 5:03:24 PM UTC-7, dxforth wrote:
> I've found an essentially no-cost way of implementing it.
> Other than the novelty of being able to write ]] 123 [[
> what are the reasons/examples for having it?

My MACRO: and POST: have worked with literals for quite some time.
This is a comment from my code:
\ POST: LIT: DLIT: FLIT: "LIT: are used inside of immediate words that meta-compile.
\ This is similar to ]] but a lot better because it supports literals
\ and immediate words such as [CHAR] POSTPONE etc. that take data out of the input stream.

Why are you interested in Anton Ertl's ]] construct?
It is worthless from a technical standpoint. It was invented primarily as a workaround
for Anton Ertl's lack of disambiguifiers that Elizabeth Rather forbids him from using.
Anybody who uses ]] is just brown-nosing Anton Ertl who is brown-nosing
Elizabeth Rather --- an example of: "meta-brown-nosing" --- this is a pun, because my
MACRO: and POST: are used for meta-compiling (I explain this in case
any of the ANS-Forth cult didn't get the pun).

Note that my MACRO: and POST: are ANS-Forth code.
Your as-yet-undescribed way to POSTPONE literals is not going to be ANS-Forth.
Because of this, the ANS-Forth cult will not be interested in it.

I really doubt that anybody in the ANS-Forth cult understand meta-compiling.

Re: POSTPONEing literals?

<s6arit$ubj$1@gioia.aioe.org>

  copy mid

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

  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: POSTPONEing literals?
Date: Wed, 28 Apr 2021 15:24:44 +1000
Organization: Aioe.org NNTP Server
Lines: 59
Message-ID: <s6arit$ubj$1@gioia.aioe.org>
References: <s6a8o8$va3$1@gioia.aioe.org>
<31ba090a-29c8-4b5e-9b04-22c9d43115d5n@googlegroups.com>
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.10.0
X-Notice: Filtered by postfilter v. 0.9.2
Content-Language: en-GB
 by: dxforth - Wed, 28 Apr 2021 05:24 UTC

On 28/04/2021 13:43, Hugh Aguilar wrote:
> On Tuesday, April 27, 2021 at 5:03:24 PM UTC-7, dxforth wrote:
>> I've found an essentially no-cost way of implementing it.
>> Other than the novelty of being able to write ]] 123 [[
>> what are the reasons/examples for having it?
>
> My MACRO: and POST: have worked with literals for quite some time.
> This is a comment from my code:
> \ POST: LIT: DLIT: FLIT: "LIT: are used inside of immediate words that meta-compile.
> \ This is similar to ]] but a lot better because it supports literals
> \ and immediate words such as [CHAR] POSTPONE etc. that take data out of the input stream.
>
> Why are you interested in Anton Ertl's ]] construct?
> It is worthless from a technical standpoint. It was invented primarily as a workaround
> for Anton Ertl's lack of disambiguifiers that Elizabeth Rather forbids him from using.
> Anybody who uses ]] is just brown-nosing Anton Ertl who is brown-nosing
> Elizabeth Rather --- an example of: "meta-brown-nosing" --- this is a pun, because my
> MACRO: and POST: are used for meta-compiling (I explain this in case
> any of the ANS-Forth cult didn't get the pun).
>
> Note that my MACRO: and POST: are ANS-Forth code.
> Your as-yet-undescribed way to POSTPONE literals is not going to be ANS-Forth.
> Because of this, the ANS-Forth cult will not be interested in it.

It may interest forth implementers that provide POSTPONE. ISTM an
oversight that POSTPONE shouldn't handle both 'words and numbers'
directly when any forth interpreter can.

A fig-style interpreter looks something like:

: interpret ( -- )
begin
bl word dup c@
while
find ?dup if
state @ if compile, else execute then
else
( c-addr) number
then ?stack
repeat drop ;

Given 'number', we can define:

: POSTPONE
?comp bl word find ?dup if
0< if compile compile then compile,
end number ; immediate

Such a POSTPONE will handle any literal that 'number' can.

\ Simple POSTPONE macro
: ]]
begin >in @ bl word count ?dup
while s" [[" compare
while >in ! [compile] postpone
repeat drop end 2drop ; immediate

> I really doubt that anybody in the ANS-Forth cult understand meta-compiling.
>

Re: POSTPONEing literals?

<2021Apr28.082922@mips.complang.tuwien.ac.at>

  copy mid

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

  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: POSTPONEing literals?
Date: Wed, 28 Apr 2021 06:29:22 GMT
Organization: Institut fuer Computersprachen, Technische Universitaet Wien
Lines: 43
Message-ID: <2021Apr28.082922@mips.complang.tuwien.ac.at>
References: <s6a8o8$va3$1@gioia.aioe.org> <31ba090a-29c8-4b5e-9b04-22c9d43115d5n@googlegroups.com> <s6arit$ubj$1@gioia.aioe.org>
Injection-Info: reader02.eternal-september.org; posting-host="9fd2443fbf7ae773f80ea9725d79f347";
logging-data="17998"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+gzCUwkaBYfqYpan/3TnjJ"
Cancel-Lock: sha1:JoqTYbyBtmkbRGZWQFMTBNC/t70=
X-newsreader: xrn 10.00-beta-3
 by: Anton Ertl - Wed, 28 Apr 2021 06:29 UTC

dxforth <dxforth@gmail.com> writes:
>It may interest forth implementers that provide POSTPONE. ISTM an
>oversight that POSTPONE shouldn't handle both 'words and numbers'
>directly when any forth interpreter can.

My guess ist that POSTPONE was not specified to handle numbers because
neither [COMPILE] nor COMPILE could handle numbers, and programmers
could work around the lack of POSTPONE 123 with 123 POSTPONE LITERAL.

>A fig-style interpreter looks something like:
>
>: interpret ( -- )
> begin
> bl word dup c@
> while
> find ?dup if
> state @ if compile, else execute then
> else
> ( c-addr) number
> then ?stack
> repeat drop ;
>
>Given 'number', we can define:
>
>: POSTPONE
> ?comp bl word find ?dup if
> 0< if compile compile then compile,
> end number ; immediate

This NUMBER is pretty "smart", leaving the number on the stack in
interpret state, performing the compilation semantics of LITERAL or
2LITERAL in compile state, and also knowing that one more level of
LITERAL or 2LITERAL is needed when it's called from POSTPONE.

I guess complications like that also discouraged the Forth-94
committee from standardizing POSTPONEing numbers.

- 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 2020: https://euro.theforth.net/2020

Re: POSTPONEing literals?

<s6b1fi$17sk$1@gioia.aioe.org>

  copy mid

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

  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: POSTPONEing literals?
Date: Wed, 28 Apr 2021 17:05:22 +1000
Organization: Aioe.org NNTP Server
Lines: 50
Message-ID: <s6b1fi$17sk$1@gioia.aioe.org>
References: <s6a8o8$va3$1@gioia.aioe.org>
<31ba090a-29c8-4b5e-9b04-22c9d43115d5n@googlegroups.com>
<s6arit$ubj$1@gioia.aioe.org> <2021Apr28.082922@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.10.0
X-Notice: Filtered by postfilter v. 0.9.2
Content-Language: en-GB
 by: dxforth - Wed, 28 Apr 2021 07:05 UTC

On 28/04/2021 16:29, Anton Ertl wrote:
> dxforth <dxforth@gmail.com> writes:
>>It may interest forth implementers that provide POSTPONE. ISTM an
>>oversight that POSTPONE shouldn't handle both 'words and numbers'
>>directly when any forth interpreter can.
>
> My guess ist that POSTPONE was not specified to handle numbers because
> neither [COMPILE] nor COMPILE could handle numbers, and programmers
> could work around the lack of POSTPONE 123 with 123 POSTPONE LITERAL.
>
>>A fig-style interpreter looks something like:
>>
>>: interpret ( -- )
>> begin
>> bl word dup c@
>> while
>> find ?dup if
>> state @ if compile, else execute then
>> else
>> ( c-addr) number
>> then ?stack
>> repeat drop ;
>>
>>Given 'number', we can define:
>>
>>: POSTPONE
>> ?comp bl word find ?dup if
>> 0< if compile compile then compile,
>> end number ; immediate
>
> This NUMBER is pretty "smart", leaving the number on the stack in
> interpret state, performing the compilation semantics of LITERAL or
> 2LITERAL in compile state, and also knowing that one more level of
> LITERAL or 2LITERAL is needed when it's called from POSTPONE.

Not a problem since POSTPONE is required to postpone. The ?COMP
handles any attempt by a user to do otherwise.

>
> I guess complications like that also discouraged the Forth-94
> committee from standardizing POSTPONEing numbers.

If they considered it, surely they would have mentioned it. Their
'go to' reference was Hayes' Rochester Conference paper. Does anyone
have it? It would be interesting to know what it said.

>
> - anton
>

Re: POSTPONEing literals?

<2021Apr28.093707@mips.complang.tuwien.ac.at>

  copy mid

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

  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: POSTPONEing literals?
Date: Wed, 28 Apr 2021 07:37:07 GMT
Organization: Institut fuer Computersprachen, Technische Universitaet Wien
Lines: 44
Message-ID: <2021Apr28.093707@mips.complang.tuwien.ac.at>
References: <s6a8o8$va3$1@gioia.aioe.org> <31ba090a-29c8-4b5e-9b04-22c9d43115d5n@googlegroups.com> <s6arit$ubj$1@gioia.aioe.org> <2021Apr28.082922@mips.complang.tuwien.ac.at> <s6b1fi$17sk$1@gioia.aioe.org>
Injection-Info: reader02.eternal-september.org; posting-host="9fd2443fbf7ae773f80ea9725d79f347";
logging-data="16702"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18AHGado5oz8+qq6LPMUuKK"
Cancel-Lock: sha1:8DTjA1PQJX1TgBnVyR4eNI7E8rM=
X-newsreader: xrn 10.00-beta-3
 by: Anton Ertl - Wed, 28 Apr 2021 07:37 UTC

dxforth <dxforth@gmail.com> writes:
>On 28/04/2021 16:29, Anton Ertl wrote:
>> dxforth <dxforth@gmail.com> writes:
>>>Given 'number', we can define:
>>>
>>>: POSTPONE
>>> ?comp bl word find ?dup if
>>> 0< if compile compile then compile,
>>> end number ; immediate
>>
>> This NUMBER is pretty "smart", leaving the number on the stack in
>> interpret state, performing the compilation semantics of LITERAL or
>> 2LITERAL in compile state, and also knowing that one more level of
>> LITERAL or 2LITERAL is needed when it's called from POSTPONE.
>
>Not a problem since POSTPONE is required to postpone.

How does that make NUMBER perform the extra LITERAL level?

Test case:

: foo postpone 123 ; immediate
: bar foo ;
bar . \ prints 123

>> I guess complications like that also discouraged the Forth-94
>> committee from standardizing POSTPONEing numbers.
>
>If they considered it, surely they would have mentioned it. Their
>'go to' reference was Hayes' Rochester Conference paper. Does anyone
>have it? It would be interesting to know what it said.

A number of Rochester Forth Conference Proceedings have appeared in
JFAR <http://soton.mpeforth.com/flag/jfar/index.html>. There are two
papers by Hayes listed in the author index:
<http://soton.mpeforth.com/flag/jfar/authors-H.html>, but they are
unlikely to be about POSTPONE.

- 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 2020: https://euro.theforth.net/2020

Re: POSTPONEing literals?

<s6b8am$ner$1@gioia.aioe.org>

  copy mid

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

  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: POSTPONEing literals?
Date: Wed, 28 Apr 2021 19:02:14 +1000
Organization: Aioe.org NNTP Server
Lines: 35
Message-ID: <s6b8am$ner$1@gioia.aioe.org>
References: <s6a8o8$va3$1@gioia.aioe.org>
<31ba090a-29c8-4b5e-9b04-22c9d43115d5n@googlegroups.com>
<s6arit$ubj$1@gioia.aioe.org> <2021Apr28.082922@mips.complang.tuwien.ac.at>
<s6b1fi$17sk$1@gioia.aioe.org> <2021Apr28.093707@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.10.0
Content-Language: en-GB
X-Notice: Filtered by postfilter v. 0.9.2
 by: dxforth - Wed, 28 Apr 2021 09:02 UTC

On 28/04/2021 17:37, Anton Ertl wrote:
> dxforth <dxforth@gmail.com> writes:
>>On 28/04/2021 16:29, Anton Ertl wrote:
>>> dxforth <dxforth@gmail.com> writes:
>>>>Given 'number', we can define:
>>>>
>>>>: POSTPONE
>>>> ?comp bl word find ?dup if
>>>> 0< if compile compile then compile,
>>>> end number ; immediate
>>>
>>> This NUMBER is pretty "smart", leaving the number on the stack in
>>> interpret state, performing the compilation semantics of LITERAL or
>>> 2LITERAL in compile state, and also knowing that one more level of
>>> LITERAL or 2LITERAL is needed when it's called from POSTPONE.
>>
>>Not a problem since POSTPONE is required to postpone.
>
> How does that make NUMBER perform the extra LITERAL level?
>
> Test case:
>
> : foo postpone 123 ; immediate
> : bar foo ;
> bar . \ prints 123
>

Omit immediate :)

POSTPONE 123 is akin to postponing an immediate word; it
will execute when later encountered, rather than compile.

123 POSTPONE LITERAL isn't postponing 123; it's postponing
LITERAL and 123 happens to be on the stack when it does.
IOW you're setting up a scenario to get a desired effect.

Re: POSTPONEing literals?

<s6ba05$1j43$1@gioia.aioe.org>

  copy mid

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

  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: POSTPONEing literals?
Date: Wed, 28 Apr 2021 19:30:44 +1000
Organization: Aioe.org NNTP Server
Lines: 26
Message-ID: <s6ba05$1j43$1@gioia.aioe.org>
References: <s6a8o8$va3$1@gioia.aioe.org>
<31ba090a-29c8-4b5e-9b04-22c9d43115d5n@googlegroups.com>
<s6arit$ubj$1@gioia.aioe.org> <2021Apr28.082922@mips.complang.tuwien.ac.at>
<s6b1fi$17sk$1@gioia.aioe.org> <2021Apr28.093707@mips.complang.tuwien.ac.at>
<s6b8am$ner$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.10.0
Content-Language: en-GB
X-Notice: Filtered by postfilter v. 0.9.2
 by: dxforth - Wed, 28 Apr 2021 09:30 UTC

On 28/04/2021 19:02, dxforth wrote:
> On 28/04/2021 17:37, Anton Ertl wrote:
>>
>> How does that make NUMBER perform the extra LITERAL level?
>>
>> Test case:
>>
>> : foo postpone 123 ; immediate
>> : bar foo ;
>> bar . \ prints 123
>>
>
> Omit immediate :)
>
> POSTPONE 123 is akin to postponing an immediate word; it
> will execute when later encountered, rather than compile.

I'll have to concede this isn't useful. I had an example
but it turns out I had used a constant rather than a literal!

>
> 123 POSTPONE LITERAL isn't postponing 123; it's postponing
> LITERAL and 123 happens to be on the stack when it does.
> IOW you're setting up a scenario to get a desired effect.
>

Re: POSTPONEing literals?

<s6bfpm$g81$1@dont-email.me>

  copy mid

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

  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: POSTPONEing literals?
Date: Wed, 28 Apr 2021 14:09:40 +0300
Organization: A noiseless patient Spider
Lines: 65
Message-ID: <s6bfpm$g81$1@dont-email.me>
References: <s6a8o8$va3$1@gioia.aioe.org>
<31ba090a-29c8-4b5e-9b04-22c9d43115d5n@googlegroups.com>
<s6arit$ubj$1@gioia.aioe.org> <2021Apr28.082922@mips.complang.tuwien.ac.at>
<s6b1fi$17sk$1@gioia.aioe.org> <2021Apr28.093707@mips.complang.tuwien.ac.at>
<s6b8am$ner$1@gioia.aioe.org>
Mime-Version: 1.0
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Transfer-Encoding: 8bit
Injection-Date: Wed, 28 Apr 2021 11:09:42 -0000 (UTC)
Injection-Info: reader02.eternal-september.org; posting-host="4544b109297e111ff6c7c6a1d5960c1b";
logging-data="16641"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/7p4kdZeRPrUHEZPHHmHKm"
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101
Thunderbird/78.10.0
Cancel-Lock: sha1:XbjR+G0/iFkshMz1GxClnK2utcw=
In-Reply-To: <s6b8am$ner$1@gioia.aioe.org>
Content-Language: en-US
 by: Ruvim - Wed, 28 Apr 2021 11:09 UTC

On 2021-04-28 12:02, dxforth wrote:
> On 28/04/2021 17:37, Anton Ertl wrote:
>> dxforth <dxforth@gmail.com> writes:
>>> On 28/04/2021 16:29, Anton Ertl wrote:
>>>> dxforth <dxforth@gmail.com> writes:
>>>>> Given 'number', we can define:
>>>>>
>>>>> : POSTPONE
>>>>>   ?comp bl word find ?dup if
>>>>>     0< if compile compile then compile,
>>>>>   end  number ; immediate
>>>>
>>>> This NUMBER is pretty "smart", leaving the number on the stack in
>>>> interpret state, performing the compilation semantics of LITERAL or
>>>> 2LITERAL in compile state, and also knowing that one more level of
>>>> LITERAL or 2LITERAL is needed when it's called from POSTPONE.
>>>
>>> Not a problem since POSTPONE is required to postpone.
>>
>> How does that make NUMBER perform the extra LITERAL level?
>>
>> Test case:
>>
>> : foo postpone 123 ; immediate
>> : bar foo ;
>> bar . \ prints 123
>>
>
> Omit immediate :)
>
> POSTPONE 123 is akin to postponing an immediate word; it
> will execute when later encountered, rather than compile.

There is an approach that shows (or helps to understand) how POSTPONE
should work regardless of its argument kind.

: foo postpone 123 ; immediate

: bar foo ;

1. Substitute foo in bar by the body of bar in square brackets.
<==>
: bar [ postpone 123 ] ;

2. Suppose that interpretation semantics of POSTPONE X is to *perform*
compilation semantics of X. Remember that performing compilation
semantics of X is what the text interpreter does when it encounters X in
compilation state.
<==>
: bar 123 ;

Hence,

: bar foo ;

shall be equivalent to

: bar 123 ;

--
Ruvim

Re: POSTPONEing literals?

<2021Apr28.132528@mips.complang.tuwien.ac.at>

  copy mid

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

  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: POSTPONEing literals?
Date: Wed, 28 Apr 2021 11:25:28 GMT
Organization: Institut fuer Computersprachen, Technische Universitaet Wien
Lines: 48
Message-ID: <2021Apr28.132528@mips.complang.tuwien.ac.at>
References: <s6a8o8$va3$1@gioia.aioe.org> <31ba090a-29c8-4b5e-9b04-22c9d43115d5n@googlegroups.com> <s6arit$ubj$1@gioia.aioe.org> <2021Apr28.082922@mips.complang.tuwien.ac.at> <s6b1fi$17sk$1@gioia.aioe.org> <2021Apr28.093707@mips.complang.tuwien.ac.at> <s6b8am$ner$1@gioia.aioe.org>
Injection-Info: reader02.eternal-september.org; posting-host="9fd2443fbf7ae773f80ea9725d79f347";
logging-data="17662"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/nw9Qw9RI01U9pogGy+3+8"
Cancel-Lock: sha1:ijLc5SBaJ7ryOGVGcCNYOtpTHGw=
X-newsreader: xrn 10.00-beta-3
 by: Anton Ertl - Wed, 28 Apr 2021 11:25 UTC

dxforth <dxforth@gmail.com> writes:
>On 28/04/2021 17:37, Anton Ertl wrote:
>> Test case:
>>
>> : foo postpone 123 ; immediate
>> : bar foo ;
>> bar . \ prints 123
>>
>
>Omit immediate :)
>
>POSTPONE 123 is akin to postponing an immediate word;

What would be the use of that? If we would want that, we could just
leave the POSTPONE away. Also, 123 does not behave like an immediate
word in normal compilation, so why would you want that POSTPONE 123
treats it as immediate? In normal text interpretation (interpret and
compile state), the number 123 behaves like

123 constant 123 \ no immediate

BTW, the example above works in the development version of Gforth, and
that's not a bug.

>123 POSTPONE LITERAL isn't postponing 123

If POSTPONE 123 does not work, I have to write 123 POSTPONE LITERAL,
and in Gforth the result after running the code is the same:

: foo1 postpone 123 ; immediate ok
: foo2 123 postpone literal ; immediate ok
: bar1 foo1 ; ok
: bar2 foo2 ; ok
simple-see bar1
$7F447B532DA0 lit
$7F447B532DA8 #123
$7F447B532DB0 ;s ok
simple-see bar2
$7F447B532DE0 lit
$7F447B532DE8 #123
$7F447B532DF0 ;s ok

- 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 2020: https://euro.theforth.net/2020

Re: POSTPONEing literals?

<s6bl0q$1870$1@gioia.aioe.org>

  copy mid

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

  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: POSTPONEing literals?
Date: Wed, 28 Apr 2021 22:38:50 +1000
Organization: Aioe.org NNTP Server
Lines: 57
Message-ID: <s6bl0q$1870$1@gioia.aioe.org>
References: <s6a8o8$va3$1@gioia.aioe.org>
<31ba090a-29c8-4b5e-9b04-22c9d43115d5n@googlegroups.com>
<s6arit$ubj$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.10.0
X-Notice: Filtered by postfilter v. 0.9.2
Content-Language: en-GB
 by: dxforth - Wed, 28 Apr 2021 12:38 UTC

On 28/04/2021 15:24, dxforth wrote:
> ...
> A fig-style interpreter looks something like:
>
> : interpret ( -- )
> begin
> bl word dup c@
> while
> find ?dup if
> state @ if compile, else execute then
> else
> ( c-addr) number
> then ?stack
> repeat drop ;
>
> Given 'number', we can define:
>
> : POSTPONE
> ?comp bl word find ?dup if
> 0< if compile compile then compile,
> end number ; immediate

That won't work per Anton's comment. POSTPONE needs to know the compiling
literal used by 'number'. Here are the tweaks:

0 value nlit \ xt of the literal used by NUMBER

: number ( c-addr -- | d|n|r )
...
2dup number? if
2nip dpl @ 0< if
drop ['] literal
else
['] 2literal
then to nlit true
else
fnumber \ defer for floats
then
...
( flag) ?defined \ 0 = fail & abort
state @ if nlit execute then ;

: POSTPONE
?comp bl word find ?dup if
0< if compile compile then
else number nlit then compile, ; immediate

\\ test

DX-Forth 4.45 2021-04-17

: foo postpone 123 : immediate LITERAL is system ok
: bar foo ; ok
bar . 123 ok
: foo2 postpone 123e : immediate FLITERAL is system ok
: bar2 foo2 ; ok
bar2 f. 123. ok

Re: POSTPONEing literals?

<s6bq1c$1t49$1@gioia.aioe.org>

  copy mid

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

  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: POSTPONEing literals?
Date: Thu, 29 Apr 2021 00:04:27 +1000
Organization: Aioe.org NNTP Server
Lines: 71
Message-ID: <s6bq1c$1t49$1@gioia.aioe.org>
References: <s6a8o8$va3$1@gioia.aioe.org>
<31ba090a-29c8-4b5e-9b04-22c9d43115d5n@googlegroups.com>
<s6arit$ubj$1@gioia.aioe.org> <2021Apr28.082922@mips.complang.tuwien.ac.at>
<s6b1fi$17sk$1@gioia.aioe.org> <2021Apr28.093707@mips.complang.tuwien.ac.at>
<s6b8am$ner$1@gioia.aioe.org> <s6bfpm$g81$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.10.0
Content-Language: en-GB
X-Notice: Filtered by postfilter v. 0.9.2
 by: dxforth - Wed, 28 Apr 2021 14:04 UTC

On 28/04/2021 21:09, Ruvim wrote:
> On 2021-04-28 12:02, dxforth wrote:
>> On 28/04/2021 17:37, Anton Ertl wrote:
>>> dxforth <dxforth@gmail.com> writes:
>>>> On 28/04/2021 16:29, Anton Ertl wrote:
>>>>> dxforth <dxforth@gmail.com> writes:
>>>>>> Given 'number', we can define:
>>>>>>
>>>>>> : POSTPONE
>>>>>>   ?comp bl word find ?dup if
>>>>>>     0< if compile compile then compile,
>>>>>>   end  number ; immediate
>>>>>
>>>>> This NUMBER is pretty "smart", leaving the number on the stack in
>>>>> interpret state, performing the compilation semantics of LITERAL or
>>>>> 2LITERAL in compile state, and also knowing that one more level of
>>>>> LITERAL or 2LITERAL is needed when it's called from POSTPONE.
>>>>
>>>> Not a problem since POSTPONE is required to postpone.
>>>
>>> How does that make NUMBER perform the extra LITERAL level?
>>>
>>> Test case:
>>>
>>> : foo postpone 123 ; immediate
>>> : bar foo ;
>>> bar . \ prints 123
>>>
>>
>> Omit immediate :)
>>
>> POSTPONE 123 is akin to postponing an immediate word; it
>> will execute when later encountered, rather than compile.
>
>
> There is an approach that shows (or helps to understand) how POSTPONE
> should work regardless of its argument kind.
>
>
> : foo postpone 123 ; immediate
>
> : bar foo ;
>
> 1. Substitute foo in bar by the body of bar in square brackets.
> <==>
> : bar [ postpone 123 ] ;

Result is ambiguous (POSTPONE inside brackets).

>
> 2. Suppose that interpretation semantics of POSTPONE X is to *perform*
> compilation semantics of X. Remember that performing compilation
> semantics of X is what the text interpreter does when it encounters X in
> compilation state.
> <==>
> : bar 123 ;
>
>
> Hence,
>
> : bar foo ;
>
> shall be equivalent to
>
> : bar 123 ;
>
>
> --
> Ruvim
>

Re: POSTPONEing literals?

<s6buuq$trg$1@dont-email.me>

  copy mid

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

  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: POSTPONEing literals?
Date: Wed, 28 Apr 2021 18:28:26 +0300
Organization: A noiseless patient Spider
Lines: 91
Message-ID: <s6buuq$trg$1@dont-email.me>
References: <s6a8o8$va3$1@gioia.aioe.org>
<31ba090a-29c8-4b5e-9b04-22c9d43115d5n@googlegroups.com>
<s6arit$ubj$1@gioia.aioe.org> <2021Apr28.082922@mips.complang.tuwien.ac.at>
<s6b1fi$17sk$1@gioia.aioe.org> <2021Apr28.093707@mips.complang.tuwien.ac.at>
<s6b8am$ner$1@gioia.aioe.org> <s6bfpm$g81$1@dont-email.me>
<s6bq1c$1t49$1@gioia.aioe.org>
Mime-Version: 1.0
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Transfer-Encoding: 8bit
Injection-Date: Wed, 28 Apr 2021 15:28:26 -0000 (UTC)
Injection-Info: reader02.eternal-september.org; posting-host="4544b109297e111ff6c7c6a1d5960c1b";
logging-data="30576"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/tD2TdGLXxZ61bRJZR6JXK"
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101
Thunderbird/78.10.0
Cancel-Lock: sha1:wrMCcxIJh+ym5VzTIkGew6Pk2as=
In-Reply-To: <s6bq1c$1t49$1@gioia.aioe.org>
Content-Language: en-US
 by: Ruvim - Wed, 28 Apr 2021 15:28 UTC

On 2021-04-28 17:04, dxforth wrote:
> On 28/04/2021 21:09, Ruvim wrote:
>> On 2021-04-28 12:02, dxforth wrote:
>>> On 28/04/2021 17:37, Anton Ertl wrote:
>>>> dxforth <dxforth@gmail.com> writes:
>>>>> On 28/04/2021 16:29, Anton Ertl wrote:
>>>>>> dxforth <dxforth@gmail.com> writes:
>>>>>>> Given 'number', we can define:
>>>>>>>
>>>>>>> : POSTPONE
>>>>>>>   ?comp bl word find ?dup if
>>>>>>>     0< if compile compile then compile,
>>>>>>>   end  number ; immediate
>>>>>>
>>>>>> This NUMBER is pretty "smart", leaving the number on the stack in
>>>>>> interpret state, performing the compilation semantics of LITERAL or
>>>>>> 2LITERAL in compile state, and also knowing that one more level of
>>>>>> LITERAL or 2LITERAL is needed when it's called from POSTPONE.
>>>>>
>>>>> Not a problem since POSTPONE is required to postpone.
>>>>
>>>> How does that make NUMBER perform the extra LITERAL level?
>>>>
>>>> Test case:
>>>>
>>>> : foo postpone 123 ; immediate
>>>> : bar foo ;
>>>> bar . \ prints 123
>>>>
>>>
>>> Omit immediate :)
>>>
>>> POSTPONE 123 is akin to postponing an immediate word; it
>>> will execute when later encountered, rather than compile.
>>
>>
>> There is an approach that shows (or helps to understand) how POSTPONE
>> should work regardless of its argument kind.
>>
>>
>>     : foo postpone 123 ; immediate
>>
>>     : bar foo ;
>>
>> 1. Substitute foo in bar by the body of bar in square brackets.
>> <==>
>>     : bar [ postpone 123 ] ;
>
> Result is ambiguous (POSTPONE inside brackets).

It isn't a real code, it's a pseudo code, a conceptual model. And in any
case, the result is not ambiguous since the item 2 describes semantics
for POSTPONE inside brackets (i.e., the interpretation semantics for
POSTPONE). If it would be a real code, POSTPONE should be just redefined
to have these interpretation semantics. In one my framework (standard
compliant) this looks like the following:

: postpone
state @ if postpone postpone exit then
parse-lexeme ['] translate-lexeme execute-compiling ?nf
; immediate

\ If you want to go deeper:
\ translate-lexeme ( i*x sd-lexeme -- j*x flag )
\ -- https://git.io/J3Tkf
\ execute-compiling ( i*x xt -- j*x )
\ -- https://git.io/J3Tk5

>> 2. Suppose that interpretation semantics of POSTPONE X is to *perform*
>> compilation semantics of X. Remember that performing compilation
>> semantics of X is what the text interpreter does when it encounters X in
>> compilation state.
>> <==>
>>     : bar 123 ;
>>
>>
>> Hence,
>>
>>     : bar foo ;
>>
>> shall be equivalent to
>>
>>     : bar 123 ;

--
Ruvim

Re: POSTPONEing literals?

<s6d41g$hu6$1@gioia.aioe.org>

  copy mid

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

  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: POSTPONEing literals?
Date: Thu, 29 Apr 2021 12:01:21 +1000
Organization: Aioe.org NNTP Server
Lines: 53
Message-ID: <s6d41g$hu6$1@gioia.aioe.org>
References: <s6a8o8$va3$1@gioia.aioe.org>
<31ba090a-29c8-4b5e-9b04-22c9d43115d5n@googlegroups.com>
<s6arit$ubj$1@gioia.aioe.org> <s6bl0q$1870$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.10.0
Content-Language: en-GB
X-Notice: Filtered by postfilter v. 0.9.2
 by: dxforth - Thu, 29 Apr 2021 02:01 UTC

On 28/04/2021 22:38, dxforth wrote:
> ...
> POSTPONE needs to know the compiling
> literal used by 'number'. Here are the tweaks:

We can improve on that as nlit wasn't needed after all.
'number' now returns the xt directly.

: number ( c-addr -- [d|n|r] xt )
...
2dup number? if
2nip dpl @ 0< if
drop ['] literal
else
['] 2literal
then true
else
fnumber \ defer for floats
then
...
( flag) ?defined \ 0 = fail & abort
>r state @ if r@ execute then r> ;

: POSTPONE
?comp bl word find ?dup if
0< if compile compile then
else number then compile, ; immediate

'number' in INTERPRET will need to drop the xt:

: interpret ( -- )
begin
bl word dup c@
while
find ?dup if
state @ if compile, else execute then
else
( c-addr) number DROP
then ?stack
repeat drop ;

What was the cost of making POSTPONE handle numeric literals?
Comparing the old and new DX-Forth executables, it was an
extra 16 bytes.

\ tests

: foo postpone 123 : immediate LITERAL is system ok
: bar foo ; ok
bar . 123 ok
: foo2 postpone 123e : immediate FLITERAL is system ok
: bar2 foo2 ; ok
bar2 f. 123. ok

Re: POSTPONEing literals?

<e977b9e1-5f0d-43cc-b091-e25411ce9d35n@googlegroups.com>

  copy mid

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

  copy link   Newsgroups: comp.lang.forth
X-Received: by 2002:ad4:4d94:: with SMTP id cv20mr11739191qvb.26.1619662472696;
Wed, 28 Apr 2021 19:14:32 -0700 (PDT)
X-Received: by 2002:a05:620a:a51:: with SMTP id j17mr23902283qka.36.1619662472561;
Wed, 28 Apr 2021 19:14:32 -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: Wed, 28 Apr 2021 19:14:32 -0700 (PDT)
In-Reply-To: <31ba090a-29c8-4b5e-9b04-22c9d43115d5n@googlegroups.com>
Injection-Info: google-groups.googlegroups.com; posting-host=209.6.150.53; posting-account=CMtXAgoAAADrX4RLPW-ahkvKEhc1sSgg
NNTP-Posting-Host: 209.6.150.53
References: <s6a8o8$va3$1@gioia.aioe.org> <31ba090a-29c8-4b5e-9b04-22c9d43115d5n@googlegroups.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <e977b9e1-5f0d-43cc-b091-e25411ce9d35n@googlegroups.com>
Subject: Re: POSTPONEing literals?
From: azathoth...@gmail.com (azathot...@gmail.com)
Injection-Date: Thu, 29 Apr 2021 02:14:32 +0000
Content-Type: text/plain; charset="UTF-8"
 by: azathot...@gmail.com - Thu, 29 Apr 2021 02:14 UTC

On Tuesday, April 27, 2021 at 11:43:15 PM UTC-4, Hugh Aguilar wrote:
> On Tuesday, April 27, 2021 at 5:03:24 PM UTC-7, dxforth wrote:
> > I've found an essentially no-cost way of implementing it.
> > Other than the novelty of being able to write ]] 123 [[
> > what are the reasons/examples for having it?
> My MACRO: and POST: have worked with literals for quite some time.
> This is a comment from my code:
> \ POST: LIT: DLIT: FLIT: "LIT: are used inside of immediate words that meta-compile.
> \ This is similar to ]] but a lot better because it supports literals
> \ and immediate words such as [CHAR] POSTPONE etc. that take data out of the input stream.
>
> Why are you interested in Anton Ertl's ]] construct?
> It is worthless from a technical standpoint. It was invented primarily as a workaround
> for Anton Ertl's lack of disambiguifiers that Elizabeth Rather forbids him from using.
> Anybody who uses ]] is just brown-nosing Anton Ertl who is brown-nosing
> Elizabeth Rather --- an example of: "meta-brown-nosing" --- this is a pun, because my
> MACRO: and POST: are used for meta-compiling (I explain this in case
> any of the ANS-Forth cult didn't get the pun).
>
> Note that my MACRO: and POST: are ANS-Forth code.
> Your as-yet-undescribed way to POSTPONE literals is not going to be ANS-Forth.
> Because of this, the ANS-Forth cult will not be interested in it.
>
> I really doubt that anybody in the ANS-Forth cult understand meta-compiling.
Hugh do you have an online forth tutorial?
ARe you able to do dynamic web sites in forth?

Re: POSTPONEing literals?

<s6d5o6$15hc$1@gioia.aioe.org>

  copy mid

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

  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: POSTPONEing literals?
Date: Thu, 29 Apr 2021 12:30:31 +1000
Organization: Aioe.org NNTP Server
Lines: 33
Message-ID: <s6d5o6$15hc$1@gioia.aioe.org>
References: <s6a8o8$va3$1@gioia.aioe.org>
<31ba090a-29c8-4b5e-9b04-22c9d43115d5n@googlegroups.com>
<e977b9e1-5f0d-43cc-b091-e25411ce9d35n@googlegroups.com>
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.10.0
Content-Language: en-GB
X-Notice: Filtered by postfilter v. 0.9.2
 by: dxforth - Thu, 29 Apr 2021 02:30 UTC

On 29/04/2021 12:14, azathot...@gmail.com wrote:
> On Tuesday, April 27, 2021 at 11:43:15 PM UTC-4, Hugh Aguilar wrote:
>> On Tuesday, April 27, 2021 at 5:03:24 PM UTC-7, dxforth wrote:
>> > I've found an essentially no-cost way of implementing it.
>> > Other than the novelty of being able to write ]] 123 [[
>> > what are the reasons/examples for having it?
>> My MACRO: and POST: have worked with literals for quite some time.
>> This is a comment from my code:
>> \ POST: LIT: DLIT: FLIT: "LIT: are used inside of immediate words that meta-compile.
>> \ This is similar to ]] but a lot better because it supports literals
>> \ and immediate words such as [CHAR] POSTPONE etc. that take data out of the input stream.
>>
>> Why are you interested in Anton Ertl's ]] construct?
>> It is worthless from a technical standpoint. It was invented primarily as a workaround
>> for Anton Ertl's lack of disambiguifiers that Elizabeth Rather forbids him from using.
>> Anybody who uses ]] is just brown-nosing Anton Ertl who is brown-nosing
>> Elizabeth Rather --- an example of: "meta-brown-nosing" --- this is a pun, because my
>> MACRO: and POST: are used for meta-compiling (I explain this in case
>> any of the ANS-Forth cult didn't get the pun).
>>
>> Note that my MACRO: and POST: are ANS-Forth code.
>> Your as-yet-undescribed way to POSTPONE literals is not going to be ANS-Forth.
>> Because of this, the ANS-Forth cult will not be interested in it.
>>
>> I really doubt that anybody in the ANS-Forth cult understand meta-compiling.
> Hugh do you have an online forth tutorial?
> ARe you able to do dynamic web sites in forth?
>

This guy can:

https://www.45office.com/

Re: POSTPONEing literals?

<2021Apr29.080904@mips.complang.tuwien.ac.at>

  copy mid

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

  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: POSTPONEing literals?
Date: Thu, 29 Apr 2021 06:09:04 GMT
Organization: Institut fuer Computersprachen, Technische Universitaet Wien
Lines: 75
Message-ID: <2021Apr29.080904@mips.complang.tuwien.ac.at>
References: <s6a8o8$va3$1@gioia.aioe.org> <31ba090a-29c8-4b5e-9b04-22c9d43115d5n@googlegroups.com> <s6arit$ubj$1@gioia.aioe.org> <s6bl0q$1870$1@gioia.aioe.org> <s6d41g$hu6$1@gioia.aioe.org>
Injection-Info: reader02.eternal-september.org; posting-host="2e982b04689b29bfde69f4bbd9c6e32b";
logging-data="31285"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/FsgELmYYWmGfw5auUlWkh"
Cancel-Lock: sha1:cY2zM+KLTt+7zAlSL75nZahov4Y=
X-newsreader: xrn 10.00-beta-3
 by: Anton Ertl - Thu, 29 Apr 2021 06:09 UTC

dxforth <dxforth@gmail.com> writes:
>On 28/04/2021 22:38, dxforth wrote:
>> ...
>> POSTPONE needs to know the compiling
>> literal used by 'number'. Here are the tweaks:
>
>We can improve on that as nlit wasn't needed after all.
>'number' now returns the xt directly.
>
>: number ( c-addr -- [d|n|r] xt )
> ...
> 2dup number? if
> 2nip dpl @ 0< if
> drop ['] literal
> else
> ['] 2literal
> then true
> else
> fnumber \ defer for floats
> then
> ...
> ( flag) ?defined \ 0 = fail & abort
> >r state @ if r@ execute then r> ;
>
>: POSTPONE
> ?comp bl word find ?dup if
> 0< if compile compile then
> else number then compile, ; immediate
>
>'number' in INTERPRET will need to drop the xt:
>
>: interpret ( -- )
> begin
> bl word dup c@
> while
> find ?dup if
> state @ if compile, else execute then
> else
> ( c-addr) number DROP
> then ?stack
> repeat drop ;

Or, instead of making NUMBER state-smart, you put the STATE handling
in INTERPRET:

Replace the last line of NUMBER with ";"

Define INTERPRET as:

: interpret ( -- )
begin
bl word dup c@
while
find ?dup if
state @ if compile, else execute then
else
( c-addr) number state @ if execute else drop then
then ?stack
repeat drop ;

And POSTPONE as:

: POSTPONE
bl word find ?dup if
0< if compile compile then
else number dup >r execute r> then compile, ; immediate

This POSTPONE is not STATE-"smart".

- 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 2020: https://euro.theforth.net/2020

Re: POSTPONEing literals?

<s6dn0e$hoq$1@gioia.aioe.org>

  copy mid

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

  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: POSTPONEing literals?
Date: Thu, 29 Apr 2021 17:25:02 +1000
Organization: Aioe.org NNTP Server
Lines: 72
Message-ID: <s6dn0e$hoq$1@gioia.aioe.org>
References: <s6a8o8$va3$1@gioia.aioe.org>
<31ba090a-29c8-4b5e-9b04-22c9d43115d5n@googlegroups.com>
<s6arit$ubj$1@gioia.aioe.org> <s6bl0q$1870$1@gioia.aioe.org>
<s6d41g$hu6$1@gioia.aioe.org> <2021Apr29.080904@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.10.0
Content-Language: en-GB
X-Notice: Filtered by postfilter v. 0.9.2
 by: dxforth - Thu, 29 Apr 2021 07:25 UTC

On 29/04/2021 16:09, Anton Ertl wrote:
> dxforth <dxforth@gmail.com> writes:
>>On 28/04/2021 22:38, dxforth wrote:
>>> ...
>>> POSTPONE needs to know the compiling
>>> literal used by 'number'. Here are the tweaks:
>>
>>We can improve on that as nlit wasn't needed after all.
>>'number' now returns the xt directly.
>>
>>: number ( c-addr -- [d|n|r] xt )
>> ...
>> 2dup number? if
>> 2nip dpl @ 0< if
>> drop ['] literal
>> else
>> ['] 2literal
>> then true
>> else
>> fnumber \ defer for floats
>> then
>> ...
>> ( flag) ?defined \ 0 = fail & abort
>> >r state @ if r@ execute then r> ;
>>
>>: POSTPONE
>> ?comp bl word find ?dup if
>> 0< if compile compile then
>> else number then compile, ; immediate
>>
>>'number' in INTERPRET will need to drop the xt:
>>
>>: interpret ( -- )
>> begin
>> bl word dup c@
>> while
>> find ?dup if
>> state @ if compile, else execute then
>> else
>> ( c-addr) number DROP
>> then ?stack
>> repeat drop ;
>
> Or, instead of making NUMBER state-smart, you put the STATE handling
> in INTERPRET:
>
> Replace the last line of NUMBER with ";"
>
> Define INTERPRET as:
>
> : interpret ( -- )
> begin
> bl word dup c@
> while
> find ?dup if
> state @ if compile, else execute then
> else
> ( c-addr) number state @ if execute else drop then
> then ?stack
> repeat drop ;
>
> And POSTPONE as:
>
> : POSTPONE
> bl word find ?dup if
> 0< if compile compile then
> else number dup >r execute r> then compile, ; immediate
>
> This POSTPONE is not STATE-"smart".

Would you have an example of use where it would matter? POSTPONE
COMPILE LITERAL etc are either legally or technically compile-only.

Re: POSTPONEing literals?

<608a788c$0$21147$e4fe514c@news.xs4all.nl>

  copy mid

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

  copy link   Newsgroups: comp.lang.forth
Path: i2pn2.org!i2pn.org!weretis.net!feeder6.news.weretis.net!4.us.feeder.erje.net!2.eu.feeder.erje.net!feeder.erje.net!news.uzoreto.com!newsfeed.xs4all.nl!newsfeed9.news.xs4all.nl!nzpost1.xs4all.net!not-for-mail
Newsgroups: comp.lang.forth
Subject: Re: POSTPONEing literals?
References: <s6a8o8$va3$1@gioia.aioe.org> <s6bl0q$1870$1@gioia.aioe.org> <s6d41g$hu6$1@gioia.aioe.org> <2021Apr29.080904@mips.complang.tuwien.ac.at>
X-Newsreader: trn 4.0-test77 (Sep 1, 2010)
From: alb...@cherry (none)
Originator: albert@cherry.(none) (albert)
Date: 29 Apr 2021 09:12:44 GMT
Lines: 50
Message-ID: <608a788c$0$21147$e4fe514c@news.xs4all.nl>
NNTP-Posting-Host: d6baf270.news.xs4all.nl
X-Trace: G=M0IPXOzH,C=U2FsdGVkX1+gSWHHLG0xgK6a8V8ufnF6pSUL2JFziy68PL1zsDksOAxhwFPcsLvJ9/NugeEUvJuAxdzEIjm5s4p3RoX4O4EGw3kTf0SyxjK8+UIqjvBMBGUXfVjows5v
X-Complaints-To: abuse@xs4all.nl
 by: none - Thu, 29 Apr 2021 09:12 UTC

In article <2021Apr29.080904@mips.complang.tuwien.ac.at>,
Anton Ertl <anton@mips.complang.tuwien.ac.at> wrote:
<SNIP>
>
>Or, instead of making NUMBER state-smart, you put the STATE handling
>in INTERPRET:
>
>Replace the last line of NUMBER with ";"
>
>Define INTERPRET as:
>
>: interpret ( -- )
> begin
> bl word dup c@
> while
> find ?dup if
> state @ if compile, else execute then
> else
> ( c-addr) number state @ if execute else drop then
> then ?stack
> repeat drop ;

Or, if `` number '' is handled by immediate prefixes you can just
leave the else part.
Note that prefixes like $ # % ' presort the different cases of numbers
to handle. ( $1234 #200 %10011100 'A' )

Or if INTERPRET monitors stack changes, all cases of `` number ''
would be simplified.

>
>And POSTPONE as:
>
>: POSTPONE
> bl word find ?dup if
> 0< if compile compile then
> else number dup >r execute r> then compile, ; immediate
>
>This POSTPONE is not STATE-"smart".

It is IMMEDIATE-"smart" , but that is less objectionable.

>- anton

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: POSTPONEing literals?

<2021Apr29.105420@mips.complang.tuwien.ac.at>

  copy mid

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

  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: POSTPONEing literals?
Date: Thu, 29 Apr 2021 08:54:20 GMT
Organization: Institut fuer Computersprachen, Technische Universitaet Wien
Lines: 40
Message-ID: <2021Apr29.105420@mips.complang.tuwien.ac.at>
References: <s6a8o8$va3$1@gioia.aioe.org> <31ba090a-29c8-4b5e-9b04-22c9d43115d5n@googlegroups.com> <s6arit$ubj$1@gioia.aioe.org> <s6bl0q$1870$1@gioia.aioe.org> <s6d41g$hu6$1@gioia.aioe.org> <2021Apr29.080904@mips.complang.tuwien.ac.at> <s6dn0e$hoq$1@gioia.aioe.org>
Injection-Info: reader02.eternal-september.org; posting-host="2e982b04689b29bfde69f4bbd9c6e32b";
logging-data="28757"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/yV+8OqcbQwcOdixBUT6I+"
Cancel-Lock: sha1:TGTZa8bq9mVhiNDrUhyvd3Hbu+o=
X-newsreader: xrn 10.00-beta-3
 by: Anton Ertl - Thu, 29 Apr 2021 08:54 UTC

dxforth <dxforth@gmail.com> writes:
>> This POSTPONE is not STATE-"smart".
>
>Would you have an example of use where it would matter?

: postpone postpone postpone ; immediate
: foo [ postpone . ] ; immediate

>POSTPONE
>COMPILE LITERAL etc are either legally or technically compile-only.

"Compile-only" is used in two different meanings:

1) Has undefined interpretation semantics.

2) Errors out when being run in interpret state.

The fixed POSTPONE is technically fine wrt either meaning: it has
interpretation semantics, and it does not produce error when it runs
in interpret state

Concerning "legally", the standard only specifies 1) for POSTPONE, and
that is easily fixed:

: postpone postpone postpone ; immediate

Apart from that, given all the slavery and freedom rethoric you have
been using wrt standard compliance, don't you want to provide the
dxforth programmers with the freedom to just write

: foo [ postpone . ] ;

Gforth, SwiftForth, and VFX provide this freedom.

- 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 2020: https://euro.theforth.net/2020

Re: POSTPONEing literals?

<s6e45l$lpa$1@dont-email.me>

  copy mid

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

  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: POSTPONEing literals?
Date: Thu, 29 Apr 2021 14:09:38 +0300
Organization: A noiseless patient Spider
Lines: 25
Message-ID: <s6e45l$lpa$1@dont-email.me>
References: <s6a8o8$va3$1@gioia.aioe.org>
<31ba090a-29c8-4b5e-9b04-22c9d43115d5n@googlegroups.com>
<s6arit$ubj$1@gioia.aioe.org> <s6bl0q$1870$1@gioia.aioe.org>
<s6d41g$hu6$1@gioia.aioe.org> <2021Apr29.080904@mips.complang.tuwien.ac.at>
<s6dn0e$hoq$1@gioia.aioe.org> <2021Apr29.105420@mips.complang.tuwien.ac.at>
Mime-Version: 1.0
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Thu, 29 Apr 2021 11:09:41 -0000 (UTC)
Injection-Info: reader02.eternal-september.org; posting-host="6d7de13e21f9783215abfbd95749a406";
logging-data="22314"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/1YVFP8b82aeO8Ed77Kg7H"
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101
Thunderbird/78.10.0
Cancel-Lock: sha1:DYayEPJ7hWia3nx/P/7G/DDn964=
In-Reply-To: <2021Apr29.105420@mips.complang.tuwien.ac.at>
Content-Language: en-US
 by: Ruvim - Thu, 29 Apr 2021 11:09 UTC

On 2021-04-29 11:54, Anton Ertl wrote:
> dxforth <dxforth@gmail.com> writes:
>>> This POSTPONE is not STATE-"smart".
>>
>> Would you have an example of use where it would matter?
>
> : postpone postpone postpone ; immediate
> : foo [ postpone . ] ; immediate

It's ambiguous. It should be admitted, at the moment the standard
doesn't allow to perform compilation semantics in interpretation state.

But in any standard system, POSTPONE can be redefined in such a way that
your test will work as expected:

: postpone ( -- ) \ "name"
bl word find dup 0= if -13 throw then
swap postpone literal
1 = if ['] execute-compiling else ['] compile, then compile,
; immediate

--
Ruvim

Re: POSTPONEing literals?

<s6e6e9$ui$1@gioia.aioe.org>

  copy mid

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

  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: POSTPONEing literals?
Date: Thu, 29 Apr 2021 21:48:25 +1000
Organization: Aioe.org NNTP Server
Lines: 46
Message-ID: <s6e6e9$ui$1@gioia.aioe.org>
References: <s6a8o8$va3$1@gioia.aioe.org>
<31ba090a-29c8-4b5e-9b04-22c9d43115d5n@googlegroups.com>
<s6arit$ubj$1@gioia.aioe.org> <s6bl0q$1870$1@gioia.aioe.org>
<s6d41g$hu6$1@gioia.aioe.org> <2021Apr29.080904@mips.complang.tuwien.ac.at>
<s6dn0e$hoq$1@gioia.aioe.org> <2021Apr29.105420@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.10.0
Content-Language: en-GB
X-Notice: Filtered by postfilter v. 0.9.2
 by: dxforth - Thu, 29 Apr 2021 11:48 UTC

On 29/04/2021 18:54, Anton Ertl wrote:
>
>>> This POSTPONE is not STATE-"smart".

I agree your mods correct the oddity of NUMBER doing work that is
properly the function of INTERPRET and POSTPONE. I'll be retaining
?COMP which in my actual code is positioned just before NUMBER in
POSTPONE. That's because my COMPILE already has ?COMP built-in for
crash prevention.

>>
>>Would you have an example of use where it would matter?
>
> : postpone postpone postpone ; immediate
> : foo [ postpone . ] ; immediate
>
>>POSTPONE
>>COMPILE LITERAL etc are either legally or technically compile-only.
>
> "Compile-only" is used in two different meanings:
>
> 1) Has undefined interpretation semantics.
>
> 2) Errors out when being run in interpret state.
>
> The fixed POSTPONE is technically fine wrt either meaning: it has
> interpretation semantics, and it does not produce error when it runs
> in interpret state
>
> Concerning "legally", the standard only specifies 1) for POSTPONE, and
> that is easily fixed:
>
> : postpone postpone postpone ; immediate
>
> Apart from that, given all the slavery and freedom rethoric you have
> been using wrt standard compliance, don't you want to provide the
> dxforth programmers with the freedom to just write
>
> : foo [ postpone . ] ;
>
> Gforth, SwiftForth, and VFX provide this freedom.
>

200x doesn't and the principals of those systems have been sitting on
its board since inception. If anyone is being disenfranchised, it
would appear to be 200x users.

Re: POSTPONEing literals?

<s6fgj2$rb0$1@gioia.aioe.org>

  copy mid

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

  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: POSTPONEing literals?
Date: Fri, 30 Apr 2021 09:47:48 +1000
Organization: Aioe.org NNTP Server
Lines: 22
Message-ID: <s6fgj2$rb0$1@gioia.aioe.org>
References: <s6a8o8$va3$1@gioia.aioe.org>
<31ba090a-29c8-4b5e-9b04-22c9d43115d5n@googlegroups.com>
<s6arit$ubj$1@gioia.aioe.org> <s6bl0q$1870$1@gioia.aioe.org>
<s6d41g$hu6$1@gioia.aioe.org> <2021Apr29.080904@mips.complang.tuwien.ac.at>
<s6dn0e$hoq$1@gioia.aioe.org> <2021Apr29.105420@mips.complang.tuwien.ac.at>
<s6e45l$lpa$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.10.0
X-Notice: Filtered by postfilter v. 0.9.2
Content-Language: en-GB
 by: dxforth - Thu, 29 Apr 2021 23:47 UTC

On 29/04/2021 21:09, Ruvim wrote:
> On 2021-04-29 11:54, Anton Ertl wrote:
>> dxforth <dxforth@gmail.com> writes:
>>>> This POSTPONE is not STATE-"smart".
>>>
>>> Would you have an example of use where it would matter?
>>
>> : postpone postpone postpone ; immediate
>> : foo [ postpone . ] ; immediate
>
> It's ambiguous. It should be admitted, at the moment the standard
> doesn't allow to perform compilation semantics in interpretation state.

Has the case been made that it should? That something now works
that previously didn't is a curiosity - not a demonstrated need.
The functionality described above can almost certainly be duplicated
by other means. I just haven't been able to find the many examples
of use that would justify changing POSTPONE to do it. Why I asked.
The same for POSTPONEing literals. I've just spent 21 bytes on
something I don't know I'll ever use. When forth's hacks start
thinking like Moore, the language may gain some credibility but
not until then.

Re: POSTPONEing literals?

<s6gos1$7jf$1@dont-email.me>

  copy mid

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

  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: POSTPONEing literals?
Date: Fri, 30 Apr 2021 14:15:12 +0300
Organization: A noiseless patient Spider
Lines: 67
Message-ID: <s6gos1$7jf$1@dont-email.me>
References: <s6a8o8$va3$1@gioia.aioe.org>
<31ba090a-29c8-4b5e-9b04-22c9d43115d5n@googlegroups.com>
<s6arit$ubj$1@gioia.aioe.org> <s6bl0q$1870$1@gioia.aioe.org>
<s6d41g$hu6$1@gioia.aioe.org> <2021Apr29.080904@mips.complang.tuwien.ac.at>
<s6dn0e$hoq$1@gioia.aioe.org> <2021Apr29.105420@mips.complang.tuwien.ac.at>
<s6e45l$lpa$1@dont-email.me> <s6fgj2$rb0$1@gioia.aioe.org>
Mime-Version: 1.0
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Transfer-Encoding: 8bit
Injection-Date: Fri, 30 Apr 2021 11:15:13 -0000 (UTC)
Injection-Info: reader02.eternal-september.org; posting-host="11b2210343d9ebf93078c2af4ed1889d";
logging-data="7791"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19s/FOdnJGpw77+jVpWW7gP"
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101
Thunderbird/78.10.0
Cancel-Lock: sha1:bqr2r9xErV3iEc+/GTASXjXpKK4=
In-Reply-To: <s6fgj2$rb0$1@gioia.aioe.org>
Content-Language: en-US
X-Mozilla-News-Host: news://eternal-september.org
 by: Ruvim - Fri, 30 Apr 2021 11:15 UTC

On 2021-04-30 02:47, dxforth wrote:
> On 29/04/2021 21:09, Ruvim wrote:
>> On 2021-04-29 11:54, Anton Ertl wrote:
>>> dxforth <dxforth@gmail.com> writes:
>>>>> This POSTPONE is not STATE-"smart".
>>>>
>>>> Would you have an example of use where it would matter?
>>>
>>> : postpone postpone postpone ; immediate
>>> : foo [ postpone . ] ; immediate
>>
>> It's ambiguous. It should be admitted, at the moment the standard
>> doesn't allow to perform compilation semantics in interpretation state.
>
> Has the case been made that it should?  That something now works
> that previously didn't is a curiosity - not a demonstrated need.
> The functionality described above can almost certainly be duplicated
> by other means.  I just haven't been able to find the many examples
> of use that would justify changing POSTPONE to do it.  Why I asked.
> The same for POSTPONEing literals.  I've just spent 21 bytes on
> something I don't know I'll ever use.  When forth's hacks start
> thinking like Moore, the language may gain some credibility but
> not until then.

So the question is why do we have (or why do we need to provide) some
features that are very rarely used and have the alternatives?

I see this problem as a problem of integrality and consistency.

A user expects that the system/language is (or should be) integral and
consistent. A user mentally builds a model of the system, and this model
allows to predict the system's behavior in edge case, or to extrapolate
behavior from one set of situations into another set.

If some prediction fails, the reason should be sound, convincing, and
clear to correct the model. Otherwise it will look like a bug or a flaw.

If POSTPONE works for words, why it cannot work for numbers? What is a
sound reason for that? Does it have some intrinsic uncertainty? Is it
difficult to implement?

If nothing of that, it's better to not break a more general model and
support applying POSTPONE to numbers.

Ditto about performing compilation semantics in interpretation state.
If a user (a program) explicitly directs a system to perform some
compilation semantics, why he should be concerned to also set
compilation state? The system can set compilation state by itself. It's
not difficult. And all required information is available for the system.

A small nuance is that the system should not revert the state if it was
explicitly directed to change the state. But it's also a simple thing,
see my the same example https://git.io/J3331

So there is no any sound reason to break (i.e. to not support) a more
general model.

--
Ruvim

Re: POSTPONEing literals?

<608bed52$0$21150$e4fe514c@news.xs4all.nl>

  copy mid

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

  copy link   Newsgroups: comp.lang.forth
Path: i2pn2.org!i2pn.org!paganini.bofh.team!news.dns-netz.com!news.freedyn.net!newsfeed.xs4all.nl!newsfeed9.news.xs4all.nl!nzpost1.xs4all.net!not-for-mail
Newsgroups: comp.lang.forth
References: <s6a8o8$va3$1@gioia.aioe.org> <s6e45l$lpa$1@dont-email.me> <s6fgj2$rb0$1@gioia.aioe.org> <s6gos1$7jf$1@dont-email.me>
Subject: Re: POSTPONEing literals?
X-Newsreader: trn 4.0-test77 (Sep 1, 2010)
From: alb...@cherry (none)
Originator: albert@cherry.(none) (albert)
Date: 30 Apr 2021 11:43:14 GMT
Lines: 78
Message-ID: <608bed52$0$21150$e4fe514c@news.xs4all.nl>
NNTP-Posting-Host: e710468b.news.xs4all.nl
X-Trace: G=iL8qLG8I,C=U2FsdGVkX19sd9KOV0stNPfrEowX/TdSrkwgiFZEhlHrzh7sJXV/QGW6wbBVct7Q66hmsvD6u96KtpfnwFDnKNeVkCCI+KOji3ZIl8cOWowwyGykqE9QbbJoVM7DOdWN
X-Complaints-To: abuse@xs4all.nl
 by: none - Fri, 30 Apr 2021 11:43 UTC

In article <s6gos1$7jf$1@dont-email.me>, Ruvim <ruvim.pinka@gmail.com> wrote:
>On 2021-04-30 02:47, dxforth wrote:
>> On 29/04/2021 21:09, Ruvim wrote:
>>> On 2021-04-29 11:54, Anton Ertl wrote:
>>>> dxforth <dxforth@gmail.com> writes:
>>>>>> This POSTPONE is not STATE-"smart".
>>>>>
>>>>> Would you have an example of use where it would matter?
>>>>
>>>> : postpone postpone postpone ; immediate
>>>> : foo [ postpone . ] ; immediate
>>>
>>> It's ambiguous. It should be admitted, at the moment the standard
>>> doesn't allow to perform compilation semantics in interpretation state.
>>
>> Has the case been made that it should?  That something now works
>> that previously didn't is a curiosity - not a demonstrated need.
>> The functionality described above can almost certainly be duplicated
>> by other means.  I just haven't been able to find the many examples
>> of use that would justify changing POSTPONE to do it.  Why I asked.
>> The same for POSTPONEing literals.  I've just spent 21 bytes on
>> something I don't know I'll ever use.  When forth's hacks start
>> thinking like Moore, the language may gain some credibility but
>> not until then.
>
>
>So the question is why do we have (or why do we need to provide) some
>features that are very rarely used and have the alternatives?
>
>I see this problem as a problem of integrality and consistency.
>
>A user expects that the system/language is (or should be) integral and
>consistent. A user mentally builds a model of the system, and this model
>allows to predict the system's behavior in edge case, or to extrapolate
>behavior from one set of situations into another set.
>
>If some prediction fails, the reason should be sound, convincing, and
>clear to correct the model. Otherwise it will look like a bug or a flaw.
>
>
>
>If POSTPONE works for words, why it cannot work for numbers? What is a
>sound reason for that? Does it have some intrinsic uncertainty? Is it
>difficult to implement?
>
>If nothing of that, it's better to not break a more general model and
>support applying POSTPONE to numbers.
>
>
>
>
>Ditto about performing compilation semantics in interpretation state.
>If a user (a program) explicitly directs a system to perform some
>compilation semantics, why he should be concerned to also set
>compilation state? The system can set compilation state by itself. It's
>not difficult. And all required information is available for the system.
>
>A small nuance is that the system should not revert the state if it was
>explicitly directed to change the state. But it's also a simple thing,
>see my the same example https://git.io/J3331
>
>
>So there is no any sound reason to break (i.e. to not support) a more
>general model.

Your reasoning is sound. My conclusion is that with the kind of
abstraction POSTPONE offers we took a wrong turn. Instead of supporting
POSTPONE for numbers, I want to get rid of POSTPONE altogether.

>--
>Ruvim

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

Pages:123456789
server_pubkey.txt

rocksolid light 0.9.81
clearnet tor