Rocksolid Light

Welcome to novaBBS (click a section below)

mail  files  register  newsreader  groups  login

Message-ID:  

Live long and prosper. -- Spock, "Amok Time", stardate 3372.7


devel / comp.lang.forth / Re: gForth Block File Question

SubjectAuthor
* gForth Block File QuestionVan Kichline
+* Re: gForth Block File QuestionVan Kichline
|`* Re: gForth Block File Questiondxforth
| `* Re: gForth Block File Questiondxforth
|  +* Re: gForth Block File QuestionVan Kichline
|  |`* Re: gForth Block File QuestionBrian Fox
|  | +- Re: gForth Block File Questiondxforth
|  | `* Re: gForth Block File QuestionVan Kichline
|  |  +* Re: gForth Block File QuestionS Jack
|  |  |+- Re: gForth Block File QuestionVan Kichline
|  |  |+- Re: gForth Block File QuestionBrian Fox
|  |  |`- Re: gForth Block File Questiondxforth
|  |  `* Re: gForth Block File QuestionAndy Valencia
|  |   +- Re: gForth Block File QuestionVan Kichline
|  |   `- Re: gForth Block File Questionnone
|  +* Re: gForth Block File QuestionRuvim
|  |+* Re: gForth Block File Questiondxforth
|  ||+* Re: gForth Block File QuestionAnton Ertl
|  |||`* Re: gForth Block File Questiondxforth
|  ||| `* Re: gForth Block File QuestionAnton Ertl
|  |||  +* Re: gForth Block File Questionminf...@arcor.de
|  |||  |+- Re: gForth Block File Questiondxforth
|  |||  |`* Re: gForth Block File QuestionAnton Ertl
|  |||  | `- Re: gForth Block File Questionnone
|  |||  `* Re: gForth Block File Questiondxforth
|  |||   `* Re: gForth Block File QuestionAnton Ertl
|  |||    `* Re: gForth Block File Questiondxforth
|  |||     `* Re: gForth Block File QuestionAnton Ertl
|  |||      +- Re: gForth Block File QuestionVan Kichline
|  |||      `- Re: gForth Block File Questiondxforth
|  ||`* Re: gForth Block File Questionnone
|  || `- Re: gForth Block File Questiondxforth
|  |`- Re: gForth Block File QuestionVan Kichline
|  `- Re: gForth Block File QuestionAnton Ertl
`- Re: gForth Block File Questionminf...@arcor.de

Pages:12
gForth Block File Question

<b25c1d0f-2dcd-4de9-86f2-5a5aa99705bcn@googlegroups.com>

  copy mid

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

  copy link   Newsgroups: comp.lang.forth
X-Received: by 2002:ad4:4ba4:0:b0:56e:f4f0:e71d with SMTP id i4-20020ad44ba4000000b0056ef4f0e71dmr157157qvw.6.1678491327177;
Fri, 10 Mar 2023 15:35:27 -0800 (PST)
X-Received: by 2002:a05:620a:22e9:b0:73b:a6e7:f505 with SMTP id
p9-20020a05620a22e900b0073ba6e7f505mr1292780qki.1.1678491326854; Fri, 10 Mar
2023 15:35:26 -0800 (PST)
Path: i2pn2.org!i2pn.org!weretis.net!feeder8.news.weretis.net!proxad.net!feeder1-2.proxad.net!209.85.160.216.MISMATCH!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.forth
Date: Fri, 10 Mar 2023 15:35:26 -0800 (PST)
Injection-Info: google-groups.googlegroups.com; posting-host=50.46.219.106; posting-account=VRZdRQoAAAByg2veNn4xonsritzF12hS
NNTP-Posting-Host: 50.46.219.106
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <b25c1d0f-2dcd-4de9-86f2-5a5aa99705bcn@googlegroups.com>
Subject: gForth Block File Question
From: vkichl...@gmail.com (Van Kichline)
Injection-Date: Fri, 10 Mar 2023 23:35:27 +0000
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
 by: Van Kichline - Fri, 10 Mar 2023 23:35 UTC

I am new to Forth and just beginning to get serious. I an using gForth on Ubuntu for now. I want to use block files, and have found a nice little block editor: editb, which is working well but has no block file management functions. I've added Index, but really need to reorganize my block file.
Brodie says moving blocks is easy (at least for fig Forth) but I haven't found the way to load a block and write it to a different block number. Can anyone provide a hint?
Or, if there's somewhere I can look at the source of a more complete block editing environment, I may be able to figure it out for myself.
Any help appreciated, thanks!

Re: gForth Block File Question

<3f82488e-2326-44e2-85d7-d01b7028dbf4n@googlegroups.com>

  copy mid

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

  copy link   Newsgroups: comp.lang.forth
X-Received: by 2002:a05:620a:14a7:b0:738:bca9:d4dd with SMTP id x7-20020a05620a14a700b00738bca9d4ddmr1122636qkj.12.1678496181471;
Fri, 10 Mar 2023 16:56:21 -0800 (PST)
X-Received: by 2002:ac8:184:0:b0:3bf:b8cc:4e00 with SMTP id
x4-20020ac80184000000b003bfb8cc4e00mr7230384qtf.9.1678496181261; Fri, 10 Mar
2023 16:56:21 -0800 (PST)
Path: i2pn2.org!i2pn.org!usenet.blueworldhosting.com!feed1.usenet.blueworldhosting.com!peer03.iad!feed-me.highwinds-media.com!news.highwinds-media.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.forth
Date: Fri, 10 Mar 2023 16:56:20 -0800 (PST)
In-Reply-To: <b25c1d0f-2dcd-4de9-86f2-5a5aa99705bcn@googlegroups.com>
Injection-Info: google-groups.googlegroups.com; posting-host=50.46.219.106; posting-account=VRZdRQoAAAByg2veNn4xonsritzF12hS
NNTP-Posting-Host: 50.46.219.106
References: <b25c1d0f-2dcd-4de9-86f2-5a5aa99705bcn@googlegroups.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <3f82488e-2326-44e2-85d7-d01b7028dbf4n@googlegroups.com>
Subject: Re: gForth Block File Question
From: vkichl...@gmail.com (Van Kichline)
Injection-Date: Sat, 11 Mar 2023 00:56:21 +0000
Content-Type: text/plain; charset="UTF-8"
X-Received-Bytes: 1320
 by: Van Kichline - Sat, 11 Mar 2023 00:56 UTC

I've found an answer, but I think it can be greatly simplified:
: copy-block ( from to -- )
block swap block
1024 0 do
2dup i + swap i + swap
dup C@ rot C! drop
loop 2drop ;

Re: gForth Block File Question

<tugqku$26lh7$1@dont-email.me>

  copy mid

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

  copy link   Newsgroups: comp.lang.forth
Path: i2pn2.org!i2pn.org!eternal-september.org!reader01.eternal-september.org!.POSTED!not-for-mail
From: dxfo...@gmail.com (dxforth)
Newsgroups: comp.lang.forth
Subject: Re: gForth Block File Question
Date: Sat, 11 Mar 2023 13:56:30 +1100
Organization: A noiseless patient Spider
Lines: 14
Message-ID: <tugqku$26lh7$1@dont-email.me>
References: <b25c1d0f-2dcd-4de9-86f2-5a5aa99705bcn@googlegroups.com>
<3f82488e-2326-44e2-85d7-d01b7028dbf4n@googlegroups.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Sat, 11 Mar 2023 02:56:30 -0000 (UTC)
Injection-Info: reader01.eternal-september.org; posting-host="171d637398f7f4269a1e863a176bb09d";
logging-data="2315815"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19WkoP7cc7hcuCQ82QNMith"
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101
Thunderbird/102.8.0
Cancel-Lock: sha1:l+qJ5Tfz+v5H++Y9/0A1g14HQPQ=
Content-Language: en-GB
In-Reply-To: <3f82488e-2326-44e2-85d7-d01b7028dbf4n@googlegroups.com>
 by: dxforth - Sat, 11 Mar 2023 02:56 UTC

On 11/03/2023 11:56 am, Van Kichline wrote:
> I've found an answer, but I think it can be greatly simplified:
> : copy-block ( from to -- )
> block swap block
> 1024 0 do
> 2dup i + swap i + swap
> dup C@ rot C! drop
> loop 2drop ;

: copy-block ( from to -- )
buffer swap block swap 1024 move update ;

(assumes more than one block buffer)

Re: gForth Block File Question

<tugqu9$26lh7$2@dont-email.me>

  copy mid

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

  copy link   Newsgroups: comp.lang.forth
Path: i2pn2.org!i2pn.org!eternal-september.org!reader01.eternal-september.org!.POSTED!not-for-mail
From: dxfo...@gmail.com (dxforth)
Newsgroups: comp.lang.forth
Subject: Re: gForth Block File Question
Date: Sat, 11 Mar 2023 14:01:29 +1100
Organization: A noiseless patient Spider
Lines: 10
Message-ID: <tugqu9$26lh7$2@dont-email.me>
References: <b25c1d0f-2dcd-4de9-86f2-5a5aa99705bcn@googlegroups.com>
<3f82488e-2326-44e2-85d7-d01b7028dbf4n@googlegroups.com>
<tugqku$26lh7$1@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
Injection-Date: Sat, 11 Mar 2023 03:01:29 -0000 (UTC)
Injection-Info: reader01.eternal-september.org; posting-host="171d637398f7f4269a1e863a176bb09d";
logging-data="2315815"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19iX3IKKS37lb+vMmdbYvJR"
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101
Thunderbird/102.8.0
Cancel-Lock: sha1:gzUAR9vx4wRh2jF2xG+Cz5hhX2w=
In-Reply-To: <tugqku$26lh7$1@dont-email.me>
Content-Language: en-GB
 by: dxforth - Sat, 11 Mar 2023 03:01 UTC

On 11/03/2023 1:56 pm, dxforth wrote:
>
> : copy-block ( from to -- )
>    buffer swap block swap 1024 move update ;

Incorrect. Should be:

: copy-block ( from to -- )
swap block swap buffer 1024 move update ;

Re: gForth Block File Question

<1a7fbdeb-b34c-4d08-9ef1-1bf5dc2bdb2en@googlegroups.com>

  copy mid

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

  copy link   Newsgroups: comp.lang.forth
X-Received: by 2002:ac8:530d:0:b0:3bf:d025:1ac1 with SMTP id t13-20020ac8530d000000b003bfd0251ac1mr7178140qtn.11.1678505073791;
Fri, 10 Mar 2023 19:24:33 -0800 (PST)
X-Received: by 2002:a05:620a:1283:b0:742:6fd1:3344 with SMTP id
w3-20020a05620a128300b007426fd13344mr1338731qki.12.1678505073535; Fri, 10 Mar
2023 19:24:33 -0800 (PST)
Path: i2pn2.org!i2pn.org!usenet.blueworldhosting.com!feed1.usenet.blueworldhosting.com!peer03.iad!feed-me.highwinds-media.com!news.highwinds-media.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.forth
Date: Fri, 10 Mar 2023 19:24:33 -0800 (PST)
In-Reply-To: <tugqu9$26lh7$2@dont-email.me>
Injection-Info: google-groups.googlegroups.com; posting-host=50.46.219.106; posting-account=VRZdRQoAAAByg2veNn4xonsritzF12hS
NNTP-Posting-Host: 50.46.219.106
References: <b25c1d0f-2dcd-4de9-86f2-5a5aa99705bcn@googlegroups.com>
<3f82488e-2326-44e2-85d7-d01b7028dbf4n@googlegroups.com> <tugqku$26lh7$1@dont-email.me>
<tugqu9$26lh7$2@dont-email.me>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <1a7fbdeb-b34c-4d08-9ef1-1bf5dc2bdb2en@googlegroups.com>
Subject: Re: gForth Block File Question
From: vkichl...@gmail.com (Van Kichline)
Injection-Date: Sat, 11 Mar 2023 03:24:33 +0000
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
X-Received-Bytes: 1413
 by: Van Kichline - Sat, 11 Mar 2023 03:24 UTC

On Friday, March 10, 2023 at 7:01:32 PM UTC-8, dxforth wrote:

Thanks! That’s considerably simpler! I have a lot to learn.

Re: gForth Block File Question

<be3888a8-c017-4c4c-a6f7-1ddde7327000n@googlegroups.com>

  copy mid

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

  copy link   Newsgroups: comp.lang.forth
X-Received: by 2002:ad4:58d3:0:b0:56e:a94c:a6e5 with SMTP id dh19-20020ad458d3000000b0056ea94ca6e5mr321277qvb.8.1678513595807;
Fri, 10 Mar 2023 21:46:35 -0800 (PST)
X-Received: by 2002:ac8:700a:0:b0:3bf:baab:bf95 with SMTP id
x10-20020ac8700a000000b003bfbaabbf95mr1375961qtm.4.1678513595619; Fri, 10 Mar
2023 21:46:35 -0800 (PST)
Path: i2pn2.org!i2pn.org!weretis.net!feeder6.news.weretis.net!1.us.feeder.erje.net!3.us.feeder.erje.net!feeder.erje.net!border-1.nntp.ord.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: Fri, 10 Mar 2023 21:46:35 -0800 (PST)
In-Reply-To: <1a7fbdeb-b34c-4d08-9ef1-1bf5dc2bdb2en@googlegroups.com>
Injection-Info: google-groups.googlegroups.com; posting-host=2607:fea8:2a60:9ae:6221:d052:a3fd:187a;
posting-account=2z7GawoAAADc70p5SM5AbaCyzjLblS3g
NNTP-Posting-Host: 2607:fea8:2a60:9ae:6221:d052:a3fd:187a
References: <b25c1d0f-2dcd-4de9-86f2-5a5aa99705bcn@googlegroups.com>
<3f82488e-2326-44e2-85d7-d01b7028dbf4n@googlegroups.com> <tugqku$26lh7$1@dont-email.me>
<tugqu9$26lh7$2@dont-email.me> <1a7fbdeb-b34c-4d08-9ef1-1bf5dc2bdb2en@googlegroups.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <be3888a8-c017-4c4c-a6f7-1ddde7327000n@googlegroups.com>
Subject: Re: gForth Block File Question
From: brian....@brianfox.ca (Brian Fox)
Injection-Date: Sat, 11 Mar 2023 05:46:35 +0000
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
Lines: 13
 by: Brian Fox - Sat, 11 Mar 2023 05:46 UTC

On Friday, March 10, 2023 at 10:24:34 PM UTC-5, Van Kichline wrote:
> On Friday, March 10, 2023 at 7:01:32 PM UTC-8, dxforth wrote:
> …
> Thanks! That’s considerably simpler! I have a lot to learn.

Not sure if this works on GForth but some older systems kept a cell
just before the buffer address that contained the block number
and the update flag. This was how HsForth did it.

In those systems copy was:

: COPY ( from to -- ) FLUSH SWAP BLOCK CELL- ! UPDATE ;

Quite clever and even simpler.

Re: gForth Block File Question

<tuh8hp$2cadb$1@dont-email.me>

  copy mid

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

  copy link   Newsgroups: comp.lang.forth
Path: i2pn2.org!i2pn.org!eternal-september.org!reader01.eternal-september.org!.POSTED!not-for-mail
From: dxfo...@gmail.com (dxforth)
Newsgroups: comp.lang.forth
Subject: Re: gForth Block File Question
Date: Sat, 11 Mar 2023 17:53:46 +1100
Organization: A noiseless patient Spider
Lines: 31
Message-ID: <tuh8hp$2cadb$1@dont-email.me>
References: <b25c1d0f-2dcd-4de9-86f2-5a5aa99705bcn@googlegroups.com>
<3f82488e-2326-44e2-85d7-d01b7028dbf4n@googlegroups.com>
<tugqku$26lh7$1@dont-email.me> <tugqu9$26lh7$2@dont-email.me>
<1a7fbdeb-b34c-4d08-9ef1-1bf5dc2bdb2en@googlegroups.com>
<be3888a8-c017-4c4c-a6f7-1ddde7327000n@googlegroups.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
Injection-Date: Sat, 11 Mar 2023 06:53:46 -0000 (UTC)
Injection-Info: reader01.eternal-september.org; posting-host="171d637398f7f4269a1e863a176bb09d";
logging-data="2501035"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/C6KLcSByIAmGstBrpxl0g"
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101
Thunderbird/102.8.0
Cancel-Lock: sha1:zNRNYR67OUVWrHHgeuU52kPuCMQ=
In-Reply-To: <be3888a8-c017-4c4c-a6f7-1ddde7327000n@googlegroups.com>
Content-Language: en-GB
 by: dxforth - Sat, 11 Mar 2023 06:53 UTC

On 11/03/2023 4:46 pm, Brian Fox wrote:
> On Friday, March 10, 2023 at 10:24:34 PM UTC-5, Van Kichline wrote:
>> On Friday, March 10, 2023 at 7:01:32 PM UTC-8, dxforth wrote:
>> …
>> Thanks! That’s considerably simpler! I have a lot to learn.
>
> Not sure if this works on GForth but some older systems kept a cell
> just before the buffer address that contained the block number
> and the update flag. This was how HsForth did it.
>
> In those systems copy was:
>
> : COPY ( from to -- ) FLUSH SWAP BLOCK CELL- ! UPDATE ;
>
> Quite clever and even simpler.

Looking at COPY from a screen editor I notice UPDATE was followed by
SAVE-BUFFERS. That ensures the data gets written to disk instead of
trusting it will.

This was the code for COPIES. Today it seems clumsy. Perhaps someone
can do better.

\ Copy u3 screens from screen u1 to u2
: COPIES ( u1 u2 u3 -- )
?dup if
swap 2 pick - >r over +
r@ 0< if swap 1 else 1- -1 then
r> 2swap do i 2dup + copy over +loop
then 2drop ;

Re: gForth Block File Question

<tuhdph$2cpfj$1@dont-email.me>

  copy mid

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

  copy link   Newsgroups: comp.lang.forth
Path: i2pn2.org!i2pn.org!eternal-september.org!reader01.eternal-september.org!.POSTED!not-for-mail
From: ruvim.pi...@gmail.com (Ruvim)
Newsgroups: comp.lang.forth
Subject: Re: gForth Block File Question
Date: Sat, 11 Mar 2023 08:23:12 +0000
Organization: A noiseless patient Spider
Lines: 45
Message-ID: <tuhdph$2cpfj$1@dont-email.me>
References: <b25c1d0f-2dcd-4de9-86f2-5a5aa99705bcn@googlegroups.com>
<3f82488e-2326-44e2-85d7-d01b7028dbf4n@googlegroups.com>
<tugqku$26lh7$1@dont-email.me> <tugqu9$26lh7$2@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
Injection-Date: Sat, 11 Mar 2023 08:23:13 -0000 (UTC)
Injection-Info: reader01.eternal-september.org; posting-host="4a880bd3903f2d254439614441fdc594";
logging-data="2516467"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18RvC5yinqErBHGGjOCWUyn"
User-Agent: Mozilla/5.0 (Windows NT 10.0; rv:102.0) Gecko/20100101
Firefox/102.0
Cancel-Lock: sha1:EAQQYpSqSPJfe7WJghqno4zSnbA=
In-Reply-To: <tugqu9$26lh7$2@dont-email.me>
Content-Language: en-US
 by: Ruvim - Sat, 11 Mar 2023 08:23 UTC

On 2023-03-11 03:01, dxforth wrote:
> On 11/03/2023 1:56 pm, dxforth wrote:
>>
>> : copy-block ( from to -- )
>>     buffer swap block swap 1024 move update ;
>
> Incorrect.  Should be:
>
> : copy-block ( from to -- )
>     swap block swap buffer 1024 move update ;
>

It's a system specific solution (both variants are correct to the same
extent).

The address of a block buffer returned by BLOCK or BUFFER is transient,
with very weak guarantees by the standard to a program. This address
becomes invalid after any next performing of BLOCK, BUFFER, LIST, or
LOAD, parsing, displaying characters, etc, — see 7.3.2 Block buffer
regions [1].

The standard allows a system to implement even only one buffer for blocks.

So, a standard compliant solution is to use a separate temporary buffer:

1024 buffer: tmp

: copy-block ( u.block-from u.block-to -- )
swap block tmp 1024 move
tmp swap buffer 1024 move
update
save-buffers \ it's optional
;

"save-buffers" is optional since the system shall save to the HDD an
updated buffer before reuse it anyway.

[1] https://forth-standard.org/standard/block#block:buffers

--
Ruvim

Re: gForth Block File Question

<22da166c-b668-46c5-84cd-8eb0e7377897n@googlegroups.com>

  copy mid

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

  copy link   Newsgroups: comp.lang.forth
X-Received: by 2002:ad4:4f8e:0:b0:56e:96c3:e0f0 with SMTP id em14-20020ad44f8e000000b0056e96c3e0f0mr420462qvb.0.1678525817192;
Sat, 11 Mar 2023 01:10:17 -0800 (PST)
X-Received: by 2002:ac8:410c:0:b0:3c0:3c09:a4a3 with SMTP id
q12-20020ac8410c000000b003c03c09a4a3mr4474867qtl.6.1678525816913; Sat, 11 Mar
2023 01:10:16 -0800 (PST)
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: Sat, 11 Mar 2023 01:10:16 -0800 (PST)
In-Reply-To: <b25c1d0f-2dcd-4de9-86f2-5a5aa99705bcn@googlegroups.com>
Injection-Info: google-groups.googlegroups.com; posting-host=2003:f7:1f22:aac3:a52d:1cfa:acff:c1e9;
posting-account=AqNUYgoAAADmkK2pN-RKms8sww57W0Iw
NNTP-Posting-Host: 2003:f7:1f22:aac3:a52d:1cfa:acff:c1e9
References: <b25c1d0f-2dcd-4de9-86f2-5a5aa99705bcn@googlegroups.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <22da166c-b668-46c5-84cd-8eb0e7377897n@googlegroups.com>
Subject: Re: gForth Block File Question
From: minfo...@arcor.de (minf...@arcor.de)
Injection-Date: Sat, 11 Mar 2023 09:10:17 +0000
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
 by: minf...@arcor.de - Sat, 11 Mar 2023 09:10 UTC

Van Kichline schrieb am Samstag, 11. März 2023 um 00:35:28 UTC+1:
> I am new to Forth and just beginning to get serious. I an using gForth on Ubuntu for now. I want to use block files, and have found a nice little block editor: editb, which is working well but has no block file management functions. I've added Index, but really need to reorganize my block file.
> Brodie says moving blocks is easy (at least for fig Forth) but I haven't found the way to load a block and write it to a different block number. Can anyone provide a hint?
> Or, if there's somewhere I can look at the source of a more complete block editing environment, I may be able to figure it out for myself.
> Any help appreciated, thanks!

Once upon a time blocks had been invented to map whole disk sectors to memory
and process them there. Efficient during its time, but rather awkward today IMO.

Most OS-based Forths like gforth have moved on to sequential text files. So unless
you have specific reasons, consider converting your blockfile to a text file and use
your favourite text editor for restructuring and editing.

Re: gForth Block File Question

<tuhh4p$2dn7r$1@dont-email.me>

  copy mid

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

  copy link   Newsgroups: comp.lang.forth
Path: i2pn2.org!i2pn.org!eternal-september.org!reader01.eternal-september.org!.POSTED!not-for-mail
From: dxfo...@gmail.com (dxforth)
Newsgroups: comp.lang.forth
Subject: Re: gForth Block File Question
Date: Sat, 11 Mar 2023 20:20:25 +1100
Organization: A noiseless patient Spider
Lines: 21
Message-ID: <tuhh4p$2dn7r$1@dont-email.me>
References: <b25c1d0f-2dcd-4de9-86f2-5a5aa99705bcn@googlegroups.com>
<3f82488e-2326-44e2-85d7-d01b7028dbf4n@googlegroups.com>
<tugqku$26lh7$1@dont-email.me> <tugqu9$26lh7$2@dont-email.me>
<tuhdph$2cpfj$1@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
Injection-Date: Sat, 11 Mar 2023 09:20:25 -0000 (UTC)
Injection-Info: reader01.eternal-september.org; posting-host="171d637398f7f4269a1e863a176bb09d";
logging-data="2546939"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19C8gJSuQxWko1C+E26enz7"
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101
Thunderbird/102.8.0
Cancel-Lock: sha1:0YtxJiuV3Se3pyu6dskqRhIQ9YM=
Content-Language: en-GB
In-Reply-To: <tuhdph$2cpfj$1@dont-email.me>
 by: dxforth - Sat, 11 Mar 2023 09:20 UTC

On 11/03/2023 7:23 pm, Ruvim wrote:
> On 2023-03-11 03:01, dxforth wrote:
>> On 11/03/2023 1:56 pm, dxforth wrote:
>>>
>>> : copy-block ( from to -- )
>>>     buffer swap block swap 1024 move update ;
>>
>> Incorrect.  Should be:
>>
>> : copy-block ( from to -- )
>>      swap block swap buffer 1024 move update ;
>>
>
> It's a system specific solution (both variants are correct to the same extent).
>
>
> The address of a block buffer returned by BLOCK or BUFFER is transient, with very weak guarantees by the standard to a program. This address becomes invalid after any next performing of BLOCK, BUFFER

That's depressing. Any idea what might cause the address/contents of BLOCK to
become invalid when BUFFER is executed?

Re: gForth Block File Question

<2023Mar11.102313@mips.complang.tuwien.ac.at>

  copy mid

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

  copy link   Newsgroups: comp.lang.forth
Path: i2pn2.org!rocksolid2!i2pn.org!eternal-september.org!reader01.eternal-september.org!.POSTED!not-for-mail
From: ant...@mips.complang.tuwien.ac.at (Anton Ertl)
Newsgroups: comp.lang.forth
Subject: Re: gForth Block File Question
Date: Sat, 11 Mar 2023 09:23:13 GMT
Organization: Institut fuer Computersprachen, Technische Universitaet Wien
Lines: 53
Message-ID: <2023Mar11.102313@mips.complang.tuwien.ac.at>
References: <b25c1d0f-2dcd-4de9-86f2-5a5aa99705bcn@googlegroups.com> <3f82488e-2326-44e2-85d7-d01b7028dbf4n@googlegroups.com> <tugqku$26lh7$1@dont-email.me> <tugqu9$26lh7$2@dont-email.me>
Injection-Info: reader01.eternal-september.org; posting-host="1527798e2f548d8fea9026840f1c3dc2";
logging-data="2570061"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19ZTBnRd/gx6ilwQLYnAZ1a"
Cancel-Lock: sha1:vQw/+kgasQUmmgND0dITgaca1Bs=
X-newsreader: xrn 10.11
 by: Anton Ertl - Sat, 11 Mar 2023 09:23 UTC

dxforth <dxforth@gmail.com> writes:
>On 11/03/2023 1:56 pm, dxforth wrote:
>>
>> : copy-block ( from to -- )
>>    buffer swap block swap 1024 move update ;
>
>Incorrect. Should be:
>
>: copy-block ( from to -- )
> swap block swap buffer 1024 move update ;

Note:

|A call to BLOCK or BUFFER may render a previously-obtained
|block-buffer address invalid, as may a call to any word that:
[lots of other cases elided]

So a standard COPY-BLOCK should copy from the BLOCK to an intermediate
buffer, and only then call BUFFER and copy the data to the resulting
address.

Is this just a theoretical concern? No:

1) The first implementation of blocks in Gforth used just one block
buffer, so COPY-BLOCK would never work.

2) This implementation was replaced with one that currently uses 32
bufferes, so COPY-BLOCK works as intended in many cases, but
insidiously not in all cases: It chooses only one of the buffers for a
given block. In particular, if the block number of the two involved blocks modulo 32 is the same, you get the same buffer:

4 block hex. $5601034AB198 ok
68 block hex. $5601034AB198 ok

If you want to copy between two blocks that use the same
buffer, COPY-BLOCK will not work as intended.

Yes, one can consider this behaviour to signify a low quality of
implementation of the blocks wordset, or maybe that the standard is
not tight enough. But it seems to me that blocks these days cater to
a small minority, they know the quality of the blocks implementations
they use, and know how to work around their quirks. That's probably
why nobody has even discussed tightening the standard in this respect,
and IIRC nobody has asked for a higher-quality implementation in
Gforth. It's also not clear how such a tightening of the standard
would look like given multi-tasking Forth systems.

- 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: https://forth-standard.org/
EuroForth 2022: https://euro.theforth.net

Re: gForth Block File Question

<2023Mar11.105604@mips.complang.tuwien.ac.at>

  copy mid

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

  copy link   Newsgroups: comp.lang.forth
Path: i2pn2.org!i2pn.org!eternal-september.org!reader01.eternal-september.org!.POSTED!not-for-mail
From: ant...@mips.complang.tuwien.ac.at (Anton Ertl)
Newsgroups: comp.lang.forth
Subject: Re: gForth Block File Question
Date: Sat, 11 Mar 2023 09:56:04 GMT
Organization: Institut fuer Computersprachen, Technische Universitaet Wien
Lines: 24
Message-ID: <2023Mar11.105604@mips.complang.tuwien.ac.at>
References: <b25c1d0f-2dcd-4de9-86f2-5a5aa99705bcn@googlegroups.com> <3f82488e-2326-44e2-85d7-d01b7028dbf4n@googlegroups.com> <tugqku$26lh7$1@dont-email.me> <tugqu9$26lh7$2@dont-email.me> <tuhdph$2cpfj$1@dont-email.me> <tuhh4p$2dn7r$1@dont-email.me>
Injection-Info: reader01.eternal-september.org; posting-host="1527798e2f548d8fea9026840f1c3dc2";
logging-data="2570061"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18tCeBUPhZmJDS3gf8lPKII"
Cancel-Lock: sha1:/WewVC4zbtsUw471WlAcu4bgN6w=
X-newsreader: xrn 10.11
 by: Anton Ertl - Sat, 11 Mar 2023 09:56 UTC

dxforth <dxforth@gmail.com> writes:
>> The address of a block buffer returned by BLOCK or BUFFER is transient, with very weak guarantees by the standard to a program. This address becomes invalid after any next performing of BLOCK, BUFFER
>
>That's depressing. Any idea what might cause the address/contents of BLOCK to
>become invalid when BUFFER is executed?

1) If BUFFER needs a buffer and chooses the same one (e.g., in Gforth
even without multi-tasking).

2) (In a classical Forth system:) If BUFFER chooses a buffer that
contains a (different) UPDATEd block, performs I/O to save the
contents of that buffer to disk before giving it back as buffer for
the passed block number. Now, while the classical Forth system waits
for I/O to do it's work, it switches to a different task, which may
perform, e.g., one or more BUFFER operations, one of which might
choose the buffer that contains the block the original task loaded
with BLOCK.

- 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: https://forth-standard.org/
EuroForth 2022: https://euro.theforth.net

Re: gForth Block File Question

<nnd$5fba2afb$0f220b8a@47abe993ff3782c0>

  copy mid

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

  copy link   Newsgroups: comp.lang.forth
Newsgroups: comp.lang.forth
References: <b25c1d0f-2dcd-4de9-86f2-5a5aa99705bcn@googlegroups.com> <tugqu9$26lh7$2@dont-email.me> <tuhdph$2cpfj$1@dont-email.me> <tuhh4p$2dn7r$1@dont-email.me>
Subject: Re: gForth Block File Question
X-Newsreader: trn 4.0-test77 (Sep 1, 2010)
From: alb...@cherry (none)
Originator: albert@cherry.(none) (albert)
Message-ID: <nnd$5fba2afb$0f220b8a@47abe993ff3782c0>
Organization: KPN B.V.
Date: Sat, 11 Mar 2023 11:38:28 +0100
Path: i2pn2.org!i2pn.org!weretis.net!feeder8.news.weretis.net!news.uzoreto.com!peer02.ams4!peer.am4.highwinds-media.com!news.highwinds-media.com!feed.abavia.com!abe006.abavia.com!abp002.abavia.com!news.kpn.nl!not-for-mail
Lines: 81
Injection-Date: Sat, 11 Mar 2023 11:38:28 +0100
Injection-Info: news.kpn.nl; mail-complaints-to="abuse@kpn.com"
X-Received-Bytes: 4318
 by: none - Sat, 11 Mar 2023 10:38 UTC

In article <tuhh4p$2dn7r$1@dont-email.me>, dxforth <dxforth@gmail.com> wrote:
>On 11/03/2023 7:23 pm, Ruvim wrote:
>> On 2023-03-11 03:01, dxforth wrote:
>>> On 11/03/2023 1:56 pm, dxforth wrote:
>>>>
>>>> : copy-block ( from to -- )
>>>>     buffer swap block swap 1024 move update ;
>>>
>>> Incorrect.  Should be:
>>>
>>> : copy-block ( from to -- )
>>>      swap block swap buffer 1024 move update ;
>>>
>>
>> It's a system specific solution (both variants are correct to the same extent).
>>
>>
>> The address of a block buffer returned by BLOCK or BUFFER is transient, with very weak guarantees by the standard to a
>program. This address becomes invalid after any next performing of BLOCK, BUFFER
>
>That's depressing. Any idea what might cause the address/contents of BLOCK to
>become invalid when BUFFER is executed?
>

BUFFER was renamed into (BUFFER) in ciforth from FIGForth.
It is worthy of the round brackets, because it is an internal word.
--------------------

() Return the address addr of a buffer assigned to identification n ,
probably a block number. Block numbers are positive, so a negative
value can be used for a buffer that is used for some other purpose.
The buffer layout is as follows: a cell with n, a cell with the
status, and the content of length B/BUF . The status is negative for
locked. The l.s.b. gives zero for free and one for valid data. The
block is not read from the disc. The buffer is either one that was
already assigned, or else a free buffer. If there is none free, some
non-locked buffer is freed. The contents of that buffer is written to
the disc, if it was marked as updated. In ciforth this will never
happen, because updated blocks are written immediately. In ciforth
blocks can be locked, and locked buffers are never freed by (BUFFER) .
An update flag would somehow be multiplexed with the lock count, but
it is not needed in this ciforth. If all buffers were locked, (BUFFER)
throws exception 48.
-------------
The description suggest that you don't need the word unless you want
to mess with the internals of FORTH.

\ Copy block one to block two.
: C-S SWAP BLOCK SWAP BLOCK B/BUF CMOVE UPDATE ;
This requires that you have at least two block buffers.
Any content made before to other blocks, is at risk of
being lost, unless you do UPDATE diligently.
You must understand that BLOCK is a cache for a disk or a
file. So after any change to a block in memory you should
say UPDATE to notify that it is to be written to disk in
at a convenient time.

You have a wrong understanding of BLOCK if you ask that the address or
content has changed. You have only control over blocks via the UPDATE.
You can only change a block immediately after obtaining the address of
the block. In other words you have no business worrying about address
or content of blocks!

Using blocks is inherently more difficult than files, and any
newbies are strongly advised against using blocks, if files are
available.

I use blocks in lina (and am chastized for it!) but actually I
use it as a read only library, never changing blocks, never using
blocks for application source code, inserting blocks using external
tools, and never using block numbers, not even if symbolically
defined.

Groetjes Albert
--
Don't praise the day before the evening. One swallow doesn't make spring.
You must not say "hey" before you have crossed the bridge. Don't sell the
hide of the bear until you shot it. Better one bird in the hand than ten in
the air. First gain is a cat spinning. - the Wise from Antrim -

Re: gForth Block File Question

<tuhmfi$2embi$1@dont-email.me>

  copy mid

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

  copy link   Newsgroups: comp.lang.forth
Path: i2pn2.org!i2pn.org!eternal-september.org!reader01.eternal-september.org!.POSTED!not-for-mail
From: dxfo...@gmail.com (dxforth)
Newsgroups: comp.lang.forth
Subject: Re: gForth Block File Question
Date: Sat, 11 Mar 2023 21:51:25 +1100
Organization: A noiseless patient Spider
Lines: 27
Message-ID: <tuhmfi$2embi$1@dont-email.me>
References: <b25c1d0f-2dcd-4de9-86f2-5a5aa99705bcn@googlegroups.com>
<3f82488e-2326-44e2-85d7-d01b7028dbf4n@googlegroups.com>
<tugqku$26lh7$1@dont-email.me> <tugqu9$26lh7$2@dont-email.me>
<tuhdph$2cpfj$1@dont-email.me> <tuhh4p$2dn7r$1@dont-email.me>
<2023Mar11.105604@mips.complang.tuwien.ac.at>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Sat, 11 Mar 2023 10:51:30 -0000 (UTC)
Injection-Info: reader01.eternal-september.org; posting-host="171d637398f7f4269a1e863a176bb09d";
logging-data="2578802"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+kwBgv3x+LB4Rm7YD74e9N"
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101
Thunderbird/102.8.0
Cancel-Lock: sha1:juip+88jcJJeP/WyWcHz+AnnqTM=
In-Reply-To: <2023Mar11.105604@mips.complang.tuwien.ac.at>
Content-Language: en-GB
 by: dxforth - Sat, 11 Mar 2023 10:51 UTC

On 11/03/2023 8:56 pm, Anton Ertl wrote:
> dxforth <dxforth@gmail.com> writes:
>>> The address of a block buffer returned by BLOCK or BUFFER is transient, with very weak guarantees by the standard to a program. This address becomes invalid after any next performing of BLOCK, BUFFER
>>
>> That's depressing. Any idea what might cause the address/contents of BLOCK to
>> become invalid when BUFFER is executed?
>
> 1) If BUFFER needs a buffer and chooses the same one (e.g., in Gforth
> even without multi-tasking).

BUFFER doesn't read. How would the contents change?

> 2) (In a classical Forth system:) If BUFFER chooses a buffer that
> contains a (different) UPDATEd block, performs I/O to save the
> contents of that buffer to disk before giving it back as buffer for
> the passed block number. Now, while the classical Forth system waits
> for I/O to do it's work, it switches to a different task, which may
> perform, e.g., one or more BUFFER operations, one of which might
> choose the buffer that contains the block the original task loaded
> with BLOCK.

That's likely it. Reading the polyForth manual it only guarantees contents
between BLOCK ... UPDATE and BUFFER ... UPDATE provided no word that does
I/O is executed. Apparently PF comes with a function BLOCKS that copies a
range of blocks. Presumably it's multi-tasking friendly.

Re: gForth Block File Question

<2023Mar11.121730@mips.complang.tuwien.ac.at>

  copy mid

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

  copy link   Newsgroups: comp.lang.forth
Path: i2pn2.org!i2pn.org!eternal-september.org!reader01.eternal-september.org!.POSTED!not-for-mail
From: ant...@mips.complang.tuwien.ac.at (Anton Ertl)
Newsgroups: comp.lang.forth
Subject: Re: gForth Block File Question
Date: Sat, 11 Mar 2023 11:17:30 GMT
Organization: Institut fuer Computersprachen, Technische Universitaet Wien
Lines: 21
Message-ID: <2023Mar11.121730@mips.complang.tuwien.ac.at>
References: <b25c1d0f-2dcd-4de9-86f2-5a5aa99705bcn@googlegroups.com> <3f82488e-2326-44e2-85d7-d01b7028dbf4n@googlegroups.com> <tugqku$26lh7$1@dont-email.me> <tugqu9$26lh7$2@dont-email.me> <tuhdph$2cpfj$1@dont-email.me> <tuhh4p$2dn7r$1@dont-email.me> <2023Mar11.105604@mips.complang.tuwien.ac.at> <tuhmfi$2embi$1@dont-email.me>
Injection-Info: reader01.eternal-september.org; posting-host="1527798e2f548d8fea9026840f1c3dc2";
logging-data="2593137"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX192yoFYXlFqHeN3VMPeAj7P"
Cancel-Lock: sha1:lDnVu2o6NvH2iP+Ud/gw/thaDac=
X-newsreader: xrn 10.11
 by: Anton Ertl - Sat, 11 Mar 2023 11:17 UTC

dxforth <dxforth@gmail.com> writes:
>On 11/03/2023 8:56 pm, Anton Ertl wrote:
>> dxforth <dxforth@gmail.com> writes:
>>>> The address of a block buffer returned by BLOCK or BUFFER is transient, with very weak guarantees by the standard to a program. This address becomes invalid after any next performing of BLOCK, BUFFER
>>>
>>> That's depressing. Any idea what might cause the address/contents of BLOCK to
>>> become invalid when BUFFER is executed?
>>
>> 1) If BUFFER needs a buffer and chooses the same one (e.g., in Gforth
>> even without multi-tasking).
>
>BUFFER doesn't read. How would the contents change?

In Gforth BUFFER just calls BLOCK, and that reads.

- 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: https://forth-standard.org/
EuroForth 2022: https://euro.theforth.net

Re: gForth Block File Question

<tuhrai$2gfck$1@dont-email.me>

  copy mid

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

  copy link   Newsgroups: comp.lang.forth
Path: i2pn2.org!i2pn.org!eternal-september.org!reader01.eternal-september.org!.POSTED!not-for-mail
From: dxfo...@gmail.com (dxforth)
Newsgroups: comp.lang.forth
Subject: Re: gForth Block File Question
Date: Sat, 11 Mar 2023 23:14:10 +1100
Organization: A noiseless patient Spider
Lines: 10
Message-ID: <tuhrai$2gfck$1@dont-email.me>
References: <b25c1d0f-2dcd-4de9-86f2-5a5aa99705bcn@googlegroups.com>
<tugqu9$26lh7$2@dont-email.me> <tuhdph$2cpfj$1@dont-email.me>
<tuhh4p$2dn7r$1@dont-email.me> <nnd$5fba2afb$0f220b8a@47abe993ff3782c0>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Sat, 11 Mar 2023 12:14:10 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="171d637398f7f4269a1e863a176bb09d";
logging-data="2637204"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+V2GgmPRzavCU5YP8hqBqC"
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101
Thunderbird/102.8.0
Cancel-Lock: sha1:WjyPc+6ldZzYtYX3gGv/1BLbjHc=
In-Reply-To: <nnd$5fba2afb$0f220b8a@47abe993ff3782c0>
Content-Language: en-GB
 by: dxforth - Sat, 11 Mar 2023 12:14 UTC

On 11/03/2023 9:38 pm, albert wrote:
>
> Using blocks is inherently more difficult than files, and any
> newbies are strongly advised against using blocks, if files are
> available.

The Standard makes the writing of programs difficult by postulating
a hypothetical least common denominator. It's much easier writing
for a real system.

Re: gForth Block File Question

<d694f0e2-e64e-4b12-a1f3-12d2ba73efb4n@googlegroups.com>

  copy mid

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

  copy link   Newsgroups: comp.lang.forth
X-Received: by 2002:a05:620a:215c:b0:73b:a941:7206 with SMTP id m28-20020a05620a215c00b0073ba9417206mr1875527qkm.7.1678561325440;
Sat, 11 Mar 2023 11:02:05 -0800 (PST)
X-Received: by 2002:ac8:56f6:0:b0:3bf:d993:f353 with SMTP id
22-20020ac856f6000000b003bfd993f353mr8851895qtu.7.1678561325211; Sat, 11 Mar
2023 11:02:05 -0800 (PST)
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: Sat, 11 Mar 2023 11:02:05 -0800 (PST)
In-Reply-To: <2023Mar11.121730@mips.complang.tuwien.ac.at>
Injection-Info: google-groups.googlegroups.com; posting-host=2003:f7:1f22:aac3:a52d:1cfa:acff:c1e9;
posting-account=AqNUYgoAAADmkK2pN-RKms8sww57W0Iw
NNTP-Posting-Host: 2003:f7:1f22:aac3:a52d:1cfa:acff:c1e9
References: <b25c1d0f-2dcd-4de9-86f2-5a5aa99705bcn@googlegroups.com>
<3f82488e-2326-44e2-85d7-d01b7028dbf4n@googlegroups.com> <tugqku$26lh7$1@dont-email.me>
<tugqu9$26lh7$2@dont-email.me> <tuhdph$2cpfj$1@dont-email.me>
<tuhh4p$2dn7r$1@dont-email.me> <2023Mar11.105604@mips.complang.tuwien.ac.at>
<tuhmfi$2embi$1@dont-email.me> <2023Mar11.121730@mips.complang.tuwien.ac.at>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <d694f0e2-e64e-4b12-a1f3-12d2ba73efb4n@googlegroups.com>
Subject: Re: gForth Block File Question
From: minfo...@arcor.de (minf...@arcor.de)
Injection-Date: Sat, 11 Mar 2023 19:02:05 +0000
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
 by: minf...@arcor.de - Sat, 11 Mar 2023 19:02 UTC

Anton Ertl schrieb am Samstag, 11. März 2023 um 12:23:03 UTC+1:
> dxforth <dxf...@gmail.com> writes:
> >On 11/03/2023 8:56 pm, Anton Ertl wrote:
> >> dxforth <dxf...@gmail.com> writes:
> >>>> The address of a block buffer returned by BLOCK or BUFFER is transient, with very weak guarantees by the standard to a program. This address becomes invalid after any next performing of BLOCK, BUFFER
> >>>
> >>> That's depressing. Any idea what might cause the address/contents of BLOCK to
> >>> become invalid when BUFFER is executed?
> >>
> >> 1) If BUFFER needs a buffer and chooses the same one (e.g., in Gforth
> >> even without multi-tasking).
> >
> >BUFFER doesn't read. How would the contents change?
> In Gforth BUFFER just calls BLOCK, and that reads.

Shouldn't it be the other way round? Somewhat in the line of

: BLOCK \ ( ub -- adr ) 7.6.1.0800 provide block in assigned buffer
dup buffer dup (update-flag-set?)
IF nip ELSE tuck swap (read-block-from-file) (reset-update-flag) THEN ;

Re: gForth Block File Question

<81cccdfa-dccc-42cf-9a73-63606d20055bn@googlegroups.com>

  copy mid

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

  copy link   Newsgroups: comp.lang.forth
X-Received: by 2002:a37:ad16:0:b0:743:82f9:cc0d with SMTP id f22-20020a37ad16000000b0074382f9cc0dmr943780qkm.15.1678564953367;
Sat, 11 Mar 2023 12:02:33 -0800 (PST)
X-Received: by 2002:ac8:82:0:b0:3bf:ba7f:58f8 with SMTP id c2-20020ac80082000000b003bfba7f58f8mr8337426qtg.3.1678564953042;
Sat, 11 Mar 2023 12:02:33 -0800 (PST)
Path: i2pn2.org!i2pn.org!usenet.blueworldhosting.com!feed1.usenet.blueworldhosting.com!peer01.iad!feed-me.highwinds-media.com!news.highwinds-media.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.forth
Date: Sat, 11 Mar 2023 12:02:32 -0800 (PST)
In-Reply-To: <be3888a8-c017-4c4c-a6f7-1ddde7327000n@googlegroups.com>
Injection-Info: google-groups.googlegroups.com; posting-host=50.46.219.106; posting-account=VRZdRQoAAAByg2veNn4xonsritzF12hS
NNTP-Posting-Host: 50.46.219.106
References: <b25c1d0f-2dcd-4de9-86f2-5a5aa99705bcn@googlegroups.com>
<3f82488e-2326-44e2-85d7-d01b7028dbf4n@googlegroups.com> <tugqku$26lh7$1@dont-email.me>
<tugqu9$26lh7$2@dont-email.me> <1a7fbdeb-b34c-4d08-9ef1-1bf5dc2bdb2en@googlegroups.com>
<be3888a8-c017-4c4c-a6f7-1ddde7327000n@googlegroups.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <81cccdfa-dccc-42cf-9a73-63606d20055bn@googlegroups.com>
Subject: Re: gForth Block File Question
From: vkichl...@gmail.com (Van Kichline)
Injection-Date: Sat, 11 Mar 2023 20:02:33 +0000
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
X-Received-Bytes: 2161
 by: Van Kichline - Sat, 11 Mar 2023 20:02 UTC

On Friday, March 10, 2023 at 9:46:37 PM UTC-8, Brian Fox wrote:
> Not sure if this works on GForth but some older systems kept a cell
> just before the buffer address that contained the block number
> and the update flag. This was how HsForth did it.
>
> In those systems copy was:
>
> : COPY ( from to -- ) FLUSH SWAP BLOCK CELL- ! UPDATE ;
>
> Quite clever and even simpler.
That's what I (almost) recalled, from looking at a FIG Forth editor some time back which I can no longer locate. I scoured the gForth docs for any mention of such organization, but found none. In general the docs didn't touch on implementation, so it may be so, but it doesn't seem safe to assume. Thanks for clarifying that, though.

Re: gForth Block File Question

<04671a6a-85b5-45fa-ab42-1ca8afb0333dn@googlegroups.com>

  copy mid

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

  copy link   Newsgroups: comp.lang.forth
X-Received: by 2002:ac8:7010:0:b0:3bf:d313:40e with SMTP id x16-20020ac87010000000b003bfd313040emr8640169qtm.13.1678565475429;
Sat, 11 Mar 2023 12:11:15 -0800 (PST)
X-Received: by 2002:ac8:7010:0:b0:3bf:d313:40e with SMTP id
x16-20020ac87010000000b003bfd313040emr8640164qtm.13.1678565475126; Sat, 11
Mar 2023 12:11:15 -0800 (PST)
Path: i2pn2.org!i2pn.org!usenet.blueworldhosting.com!feed1.usenet.blueworldhosting.com!peer01.iad!feed-me.highwinds-media.com!news.highwinds-media.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.forth
Date: Sat, 11 Mar 2023 12:11:14 -0800 (PST)
In-Reply-To: <81cccdfa-dccc-42cf-9a73-63606d20055bn@googlegroups.com>
Injection-Info: google-groups.googlegroups.com; posting-host=2600:1700:3f7a:20d0:907b:9aa4:a424:1;
posting-account=V5nGoQoAAAC_P2U0qnxm2kC0s1jNJXJa
NNTP-Posting-Host: 2600:1700:3f7a:20d0:907b:9aa4:a424:1
References: <b25c1d0f-2dcd-4de9-86f2-5a5aa99705bcn@googlegroups.com>
<3f82488e-2326-44e2-85d7-d01b7028dbf4n@googlegroups.com> <tugqku$26lh7$1@dont-email.me>
<tugqu9$26lh7$2@dont-email.me> <1a7fbdeb-b34c-4d08-9ef1-1bf5dc2bdb2en@googlegroups.com>
<be3888a8-c017-4c4c-a6f7-1ddde7327000n@googlegroups.com> <81cccdfa-dccc-42cf-9a73-63606d20055bn@googlegroups.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <04671a6a-85b5-45fa-ab42-1ca8afb0333dn@googlegroups.com>
Subject: Re: gForth Block File Question
From: sdwjac...@gmail.com (S Jack)
Injection-Date: Sat, 11 Mar 2023 20:11:15 +0000
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
X-Received-Bytes: 2282
 by: S Jack - Sat, 11 Mar 2023 20:11 UTC

On Saturday, March 11, 2023 at 2:02:34 PM UTC-6, Van Kichline wrote:

I like block files and wouldn't care for a Forth that doesn't support
them. The way they worked originally, as in FigForth, I find neat. I
also like the simple coding of the Fig editor. I use Vim editor for my
everyday editing needs. Of course the Fig editor is not going to
compete with that but I make point to use blocks and the simple editor
where I can.

It seems blocks are of little interest to the standard community. You
may be better served by looking at original block code to see how
they worked. You can get copy of a DOS FigForth in below link.
The Fig editor is also contained in the zip.

https://archives.scovetta.com/pub/power_programming/FORTH/FIG_4TH.ZIP
--
me

Re: gForth Block File Question

<d69dd28c-9a39-46af-bd4b-e44b1fdc7fadn@googlegroups.com>

  copy mid

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

  copy link   Newsgroups: comp.lang.forth
X-Received: by 2002:ac8:5616:0:b0:3c0:326:efb3 with SMTP id 22-20020ac85616000000b003c00326efb3mr7624430qtr.2.1678566403525;
Sat, 11 Mar 2023 12:26:43 -0800 (PST)
X-Received: by 2002:a05:6214:186a:b0:56f:a4:d7f8 with SMTP id
eh10-20020a056214186a00b0056f00a4d7f8mr715703qvb.8.1678566403247; Sat, 11 Mar
2023 12:26:43 -0800 (PST)
Path: i2pn2.org!i2pn.org!usenet.blueworldhosting.com!feed1.usenet.blueworldhosting.com!peer01.iad!feed-me.highwinds-media.com!news.highwinds-media.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.forth
Date: Sat, 11 Mar 2023 12:26:43 -0800 (PST)
In-Reply-To: <04671a6a-85b5-45fa-ab42-1ca8afb0333dn@googlegroups.com>
Injection-Info: google-groups.googlegroups.com; posting-host=50.46.219.106; posting-account=VRZdRQoAAAByg2veNn4xonsritzF12hS
NNTP-Posting-Host: 50.46.219.106
References: <b25c1d0f-2dcd-4de9-86f2-5a5aa99705bcn@googlegroups.com>
<3f82488e-2326-44e2-85d7-d01b7028dbf4n@googlegroups.com> <tugqku$26lh7$1@dont-email.me>
<tugqu9$26lh7$2@dont-email.me> <1a7fbdeb-b34c-4d08-9ef1-1bf5dc2bdb2en@googlegroups.com>
<be3888a8-c017-4c4c-a6f7-1ddde7327000n@googlegroups.com> <81cccdfa-dccc-42cf-9a73-63606d20055bn@googlegroups.com>
<04671a6a-85b5-45fa-ab42-1ca8afb0333dn@googlegroups.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <d69dd28c-9a39-46af-bd4b-e44b1fdc7fadn@googlegroups.com>
Subject: Re: gForth Block File Question
From: vkichl...@gmail.com (Van Kichline)
Injection-Date: Sat, 11 Mar 2023 20:26:43 +0000
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
X-Received-Bytes: 2494
 by: Van Kichline - Sat, 11 Mar 2023 20:26 UTC

On Saturday, March 11, 2023 at 12:11:16 PM UTC-8, S Jack wrote:
> On Saturday, March 11, 2023 at 2:02:34 PM UTC-6, Van Kichline wrote:
>
> I like block files and wouldn't care for a Forth that doesn't support
> them. The way they worked originally, as in FigForth, I find neat. I
> also like the simple coding of the Fig editor. I use Vim editor for my
> everyday editing needs. Of course the Fig editor is not going to
> compete with that but I make point to use blocks and the simple editor
> where I can.
>
> It seems blocks are of little interest to the standard community. You
> may be better served by looking at original block code to see how
> they worked. You can get copy of a DOS FigForth in below link.
> The Fig editor is also contained in the zip.
>
> https://archives.scovetta.com/pub/power_programming/FORTH/FIG_4TH.ZIP
> --
> me
Thanks! I did not have this, will dig into it.

Re: gForth Block File Question

<d1a59a5d-3994-4e3b-ba1a-7a827333610fn@googlegroups.com>

  copy mid

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

  copy link   Newsgroups: comp.lang.forth
X-Received: by 2002:a05:620a:12f4:b0:742:30f3:c332 with SMTP id f20-20020a05620a12f400b0074230f3c332mr1863491qkl.15.1678567340794;
Sat, 11 Mar 2023 12:42:20 -0800 (PST)
X-Received: by 2002:ac8:4342:0:b0:3bf:c62b:4651 with SMTP id
a2-20020ac84342000000b003bfc62b4651mr8386169qtn.3.1678567340501; Sat, 11 Mar
2023 12:42:20 -0800 (PST)
Path: i2pn2.org!i2pn.org!usenet.blueworldhosting.com!feed1.usenet.blueworldhosting.com!peer01.iad!feed-me.highwinds-media.com!news.highwinds-media.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.forth
Date: Sat, 11 Mar 2023 12:42:20 -0800 (PST)
In-Reply-To: <tuhdph$2cpfj$1@dont-email.me>
Injection-Info: google-groups.googlegroups.com; posting-host=50.46.219.106; posting-account=VRZdRQoAAAByg2veNn4xonsritzF12hS
NNTP-Posting-Host: 50.46.219.106
References: <b25c1d0f-2dcd-4de9-86f2-5a5aa99705bcn@googlegroups.com>
<3f82488e-2326-44e2-85d7-d01b7028dbf4n@googlegroups.com> <tugqku$26lh7$1@dont-email.me>
<tugqu9$26lh7$2@dont-email.me> <tuhdph$2cpfj$1@dont-email.me>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <d1a59a5d-3994-4e3b-ba1a-7a827333610fn@googlegroups.com>
Subject: Re: gForth Block File Question
From: vkichl...@gmail.com (Van Kichline)
Injection-Date: Sat, 11 Mar 2023 20:42:20 +0000
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
X-Received-Bytes: 1865
 by: Van Kichline - Sat, 11 Mar 2023 20:42 UTC

On Saturday, March 11, 2023 at 12:23:43 AM UTC-8, Ruvim wrote:
....
> : copy-block ( u.block-from u.block-to -- )
> swap block tmp 1024 move
> tmp swap buffer 1024 move
> update
> save-buffers \ it's optional
> ;
....
> Ruvim

Thanks! While I have plenty of buffers on hand now, I am aiming for embedded systems in the future and this may help me prevent issues a year or two down the road.
After relying on search engines for doing Forth research for a month, posting here and getting excellent feedback has been a delight!

Re: gForth Block File Question

<1be42572-1ca5-4915-9a45-2db9b7ee8ffbn@googlegroups.com>

  copy mid

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

  copy link   Newsgroups: comp.lang.forth
X-Received: by 2002:a05:620a:47b8:b0:743:a003:f307 with SMTP id dt56-20020a05620a47b800b00743a003f307mr902420qkb.13.1678576602976;
Sat, 11 Mar 2023 15:16:42 -0800 (PST)
X-Received: by 2002:a05:620a:cd1:b0:742:3eb0:8661 with SMTP id
b17-20020a05620a0cd100b007423eb08661mr2004906qkj.6.1678576602750; Sat, 11 Mar
2023 15:16:42 -0800 (PST)
Path: i2pn2.org!i2pn.org!usenet.blueworldhosting.com!feed1.usenet.blueworldhosting.com!peer01.iad!feed-me.highwinds-media.com!news.highwinds-media.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.forth
Date: Sat, 11 Mar 2023 15:16:42 -0800 (PST)
In-Reply-To: <04671a6a-85b5-45fa-ab42-1ca8afb0333dn@googlegroups.com>
Injection-Info: google-groups.googlegroups.com; posting-host=2607:fea8:2a60:9ae:6221:d052:a3fd:187a;
posting-account=2z7GawoAAADc70p5SM5AbaCyzjLblS3g
NNTP-Posting-Host: 2607:fea8:2a60:9ae:6221:d052:a3fd:187a
References: <b25c1d0f-2dcd-4de9-86f2-5a5aa99705bcn@googlegroups.com>
<3f82488e-2326-44e2-85d7-d01b7028dbf4n@googlegroups.com> <tugqku$26lh7$1@dont-email.me>
<tugqu9$26lh7$2@dont-email.me> <1a7fbdeb-b34c-4d08-9ef1-1bf5dc2bdb2en@googlegroups.com>
<be3888a8-c017-4c4c-a6f7-1ddde7327000n@googlegroups.com> <81cccdfa-dccc-42cf-9a73-63606d20055bn@googlegroups.com>
<04671a6a-85b5-45fa-ab42-1ca8afb0333dn@googlegroups.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <1be42572-1ca5-4915-9a45-2db9b7ee8ffbn@googlegroups.com>
Subject: Re: gForth Block File Question
From: brian....@brianfox.ca (Brian Fox)
Injection-Date: Sat, 11 Mar 2023 23:16:42 +0000
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
X-Received-Bytes: 3020
 by: Brian Fox - Sat, 11 Mar 2023 23:16 UTC

On Saturday, March 11, 2023 at 3:11:16 PM UTC-5, S Jack wrote:
> On Saturday, March 11, 2023 at 2:02:34 PM UTC-6, Van Kichline wrote:
>
> I like block files and wouldn't care for a Forth that doesn't support
> them. The way they worked originally, as in FigForth, I find neat. I
> also like the simple coding of the Fig editor. I use Vim editor for my
> everyday editing needs. Of course the Fig editor is not going to
> compete with that but I make point to use blocks and the simple editor
> where I can.

Not sure if this is of any interest to you but I took a run at adding more
VI features to Sam Falvo's VIBE editor for blocks.

The code is here:
https://github.com/bfox9900/VIBE99/blob/main/src/VIBE9980.FTH

The preamble at the top conditionally loads a bunch of stuff because
my iteration of Camel Forth is just 8K, mostly CORE.
(NEEDS FROM is my way to make a tiny conditional compilation tool)

It might not be too tough to port it to another system however.

The biggest not portable part is the copy buffer called TEMP.
TEMP uses video RAM. If you changed TEMP to a BUFFER:
and replace VREAD and VWRITE with MOVE it would be
closer to ready for a conventional Forth system. (no promises)
And replace VTYPE with TYPE.

If nothing else it's beginning to create what you like in VI for blocks.
I can't go much farther with 24K of RAM for code. :-)))

Re: gForth Block File Question

<tuj3dd$2nmmb$1@dont-email.me>

  copy mid

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

  copy link   Newsgroups: comp.lang.forth
Path: i2pn2.org!i2pn.org!eternal-september.org!reader01.eternal-september.org!.POSTED!not-for-mail
From: dxfo...@gmail.com (dxforth)
Newsgroups: comp.lang.forth
Subject: Re: gForth Block File Question
Date: Sun, 12 Mar 2023 10:38:22 +1100
Organization: A noiseless patient Spider
Lines: 20
Message-ID: <tuj3dd$2nmmb$1@dont-email.me>
References: <b25c1d0f-2dcd-4de9-86f2-5a5aa99705bcn@googlegroups.com>
<3f82488e-2326-44e2-85d7-d01b7028dbf4n@googlegroups.com>
<tugqku$26lh7$1@dont-email.me> <tugqu9$26lh7$2@dont-email.me>
<tuhdph$2cpfj$1@dont-email.me> <tuhh4p$2dn7r$1@dont-email.me>
<2023Mar11.105604@mips.complang.tuwien.ac.at> <tuhmfi$2embi$1@dont-email.me>
<2023Mar11.121730@mips.complang.tuwien.ac.at>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Sat, 11 Mar 2023 23:38:21 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="8f24770e6b6081de93b7e9753e7c0bd0";
logging-data="2874059"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/NJLrtoTpfuoLwjZ+zw8iN"
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101
Thunderbird/102.8.0
Cancel-Lock: sha1:d6LvF7WWXtze05wVwg/WjntiVzU=
Content-Language: en-GB
In-Reply-To: <2023Mar11.121730@mips.complang.tuwien.ac.at>
 by: dxforth - Sat, 11 Mar 2023 23:38 UTC

On 11/03/2023 10:17 pm, Anton Ertl wrote:
> dxforth <dxforth@gmail.com> writes:
>> On 11/03/2023 8:56 pm, Anton Ertl wrote:
>>> dxforth <dxforth@gmail.com> writes:
>>>>> The address of a block buffer returned by BLOCK or BUFFER is transient, with very weak guarantees by the standard to a program. This address becomes invalid after any next performing of BLOCK, BUFFER
>>>>
>>>> That's depressing. Any idea what might cause the address/contents of BLOCK to
>>>> become invalid when BUFFER is executed?
>>>
>>> 1) If BUFFER needs a buffer and chooses the same one (e.g., in Gforth
>>> even without multi-tasking).
>>
>> BUFFER doesn't read. How would the contents change?
>
> In Gforth BUFFER just calls BLOCK, and that reads.

So that leaves multi-tasking as the only reason for ANS' requirement an
interim buffer be used to copy a block. The simplified code posted would
work on Gforth and majority of systems in use today?

Re: gForth Block File Question

<tuj5c3$2nmmb$2@dont-email.me>

  copy mid

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

  copy link   Newsgroups: comp.lang.forth
Path: i2pn2.org!i2pn.org!eternal-september.org!reader01.eternal-september.org!.POSTED!not-for-mail
From: dxfo...@gmail.com (dxforth)
Newsgroups: comp.lang.forth
Subject: Re: gForth Block File Question
Date: Sun, 12 Mar 2023 11:11:49 +1100
Organization: A noiseless patient Spider
Lines: 20
Message-ID: <tuj5c3$2nmmb$2@dont-email.me>
References: <b25c1d0f-2dcd-4de9-86f2-5a5aa99705bcn@googlegroups.com>
<3f82488e-2326-44e2-85d7-d01b7028dbf4n@googlegroups.com>
<tugqku$26lh7$1@dont-email.me> <tugqu9$26lh7$2@dont-email.me>
<1a7fbdeb-b34c-4d08-9ef1-1bf5dc2bdb2en@googlegroups.com>
<be3888a8-c017-4c4c-a6f7-1ddde7327000n@googlegroups.com>
<81cccdfa-dccc-42cf-9a73-63606d20055bn@googlegroups.com>
<04671a6a-85b5-45fa-ab42-1ca8afb0333dn@googlegroups.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
Injection-Date: Sun, 12 Mar 2023 00:11:48 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="8f24770e6b6081de93b7e9753e7c0bd0";
logging-data="2874059"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18uww/6EpiPJhBnIPOvf3a3"
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101
Thunderbird/102.8.0
Cancel-Lock: sha1:/jp/w4jk1rB/NJ5BbUtHVaP8stU=
Content-Language: en-GB
In-Reply-To: <04671a6a-85b5-45fa-ab42-1ca8afb0333dn@googlegroups.com>
 by: dxforth - Sun, 12 Mar 2023 00:11 UTC

On 12/03/2023 7:11 am, S Jack wrote:
> On Saturday, March 11, 2023 at 2:02:34 PM UTC-6, Van Kichline wrote:
>
> I like block files and wouldn't care for a Forth that doesn't support
> them. The way they worked originally, as in FigForth, I find neat. I
> also like the simple coding of the Fig editor. I use Vim editor for my
> everyday editing needs. Of course the Fig editor is not going to
> compete with that but I make point to use blocks and the simple editor
> where I can.
>
> It seems blocks are of little interest to the standard community. You
> may be better served by looking at original block code to see how
> they worked. You can get copy of a DOS FigForth in below link.
> The Fig editor is also contained in the zip.
>
> https://archives.scovetta.com/pub/power_programming/FORTH/FIG_4TH.ZIP

When editing screens some way to insert/delete blocks comes in handy.
Not sure how many systems support that.

Re: gForth Block File Question

<tujfif$2so0b$1@dont-email.me>

  copy mid

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

  copy link   Newsgroups: comp.lang.forth
Path: i2pn2.org!i2pn.org!eternal-september.org!reader01.eternal-september.org!.POSTED!not-for-mail
From: dxfo...@gmail.com (dxforth)
Newsgroups: comp.lang.forth
Subject: Re: gForth Block File Question
Date: Sun, 12 Mar 2023 14:05:50 +1100
Organization: A noiseless patient Spider
Lines: 27
Message-ID: <tujfif$2so0b$1@dont-email.me>
References: <b25c1d0f-2dcd-4de9-86f2-5a5aa99705bcn@googlegroups.com>
<3f82488e-2326-44e2-85d7-d01b7028dbf4n@googlegroups.com>
<tugqku$26lh7$1@dont-email.me> <tugqu9$26lh7$2@dont-email.me>
<tuhdph$2cpfj$1@dont-email.me> <tuhh4p$2dn7r$1@dont-email.me>
<2023Mar11.105604@mips.complang.tuwien.ac.at> <tuhmfi$2embi$1@dont-email.me>
<2023Mar11.121730@mips.complang.tuwien.ac.at>
<d694f0e2-e64e-4b12-a1f3-12d2ba73efb4n@googlegroups.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
Injection-Date: Sun, 12 Mar 2023 03:05:51 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="8f24770e6b6081de93b7e9753e7c0bd0";
logging-data="3039243"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19urMOO7tDsz9kL6XHyW54n"
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101
Thunderbird/102.8.0
Cancel-Lock: sha1:ekFlleYmAsl3OemqVy2LzjTJZC8=
Content-Language: en-GB
In-Reply-To: <d694f0e2-e64e-4b12-a1f3-12d2ba73efb4n@googlegroups.com>
 by: dxforth - Sun, 12 Mar 2023 03:05 UTC

On 12/03/2023 6:02 am, minf...@arcor.de wrote:
> Anton Ertl schrieb am Samstag, 11. März 2023 um 12:23:03 UTC+1:
>> dxforth <dxf...@gmail.com> writes:
>>> On 11/03/2023 8:56 pm, Anton Ertl wrote:
>>>> dxforth <dxf...@gmail.com> writes:
>>>>>> The address of a block buffer returned by BLOCK or BUFFER is transient, with very weak guarantees by the standard to a program. This address becomes invalid after any next performing of BLOCK, BUFFER
>>>>>
>>>>> That's depressing. Any idea what might cause the address/contents of BLOCK to
>>>>> become invalid when BUFFER is executed?
>>>>
>>>> 1) If BUFFER needs a buffer and chooses the same one (e.g., in Gforth
>>>> even without multi-tasking).
>>>
>>> BUFFER doesn't read. How would the contents change?
>> In Gforth BUFFER just calls BLOCK, and that reads.
>
> Shouldn't it be the other way round? Somewhat in the line of
>
> : BLOCK \ ( ub -- adr ) 7.6.1.0800 provide block in assigned buffer
> dup buffer dup (update-flag-set?)
> IF nip ELSE tuck swap (read-block-from-file) (reset-update-flag) THEN ;

Gforth it's defined : BUFFER BLOCK ;

Since BLOCK contains the functionality of BUFFER it begs the question why
not factor it out as tradition and everyone else has done.


devel / comp.lang.forth / Re: gForth Block File Question

Pages:12
server_pubkey.txt

rocksolid light 0.9.81
clearnet tor