Rocksolid Light

Welcome to novaBBS (click a section below)

mail  files  register  newsreader  groups  login

Message-ID:  

Unix weanies are as bad at this as anyone. -- Larry Wall in <199702111730.JAA28598@wall.org>


devel / comp.lang.forth / Re: SKIP/SCAN - what modern forth doesn't have it?

SubjectAuthor
* SKIP/SCAN - what modern forth doesn't have it?dxforth
+* Re: SKIP/SCAN - what modern forth doesn't have it?none
|`* Re: SKIP/SCAN - what modern forth doesn't have it?minf...@arcor.de
| `* Re: SKIP/SCAN - what modern forth doesn't have it?none
|  `- Re: SKIP/SCAN - what modern forth doesn't have it?minf...@arcor.de
+* Re: SKIP/SCAN - what modern forth doesn't have it?Heinrich Hohl
|+- Re: SKIP/SCAN - what modern forth doesn't have it?Zbig
|+- Re: SKIP/SCAN - what modern forth doesn't have it?none
|`* Re: SKIP/SCAN - what modern forth doesn't have it?dxforth
| `* Re: SKIP/SCAN - what modern forth doesn't have it?Heinrich Hohl
|  +- Re: SKIP/SCAN - what modern forth doesn't have it?minf...@arcor.de
|  +- Re: SKIP/SCAN - what modern forth doesn't have it?dxforth
|  +* Re: SKIP/SCAN - what modern forth doesn't have it?Stephen Pelc
|  |`* Re: SKIP/SCAN - what modern forth doesn't have it?Anton Ertl
|  | +* Re: SKIP/SCAN - what modern forth doesn't have it?Marcel Hendrix
|  | |`* Re: SKIP/SCAN - what modern forth doesn't have it?Hans Bezemer
|  | | `* Re: SKIP/SCAN - what modern forth doesn't have it?none
|  | |  `- Re: SKIP/SCAN - what modern forth doesn't have it?dxforth
|  | +- Re: SKIP/SCAN - what modern forth doesn't have it?none
|  | `* Re: SKIP/SCAN - what modern forth doesn't have it?dxforth
|  |  `* Re: SKIP/SCAN - what modern forth doesn't have it?NN
|  |   +- Re: SKIP/SCAN - what modern forth doesn't have it?NN
|  |   +* Re: SKIP/SCAN - what modern forth doesn't have it?minf...@arcor.de
|  |   |`- Re: SKIP/SCAN - what modern forth doesn't have it?dxforth
|  |   `- Re: SKIP/SCAN - what modern forth doesn't have it?dxforth
|  `- Re: SKIP/SCAN - what modern forth doesn't have it?dxforth
+* Re: SKIP/SCAN - what modern forth doesn't have it?Hans Bezemer
|`- Re: SKIP/SCAN - what modern forth doesn't have it?dxforth
`* Re: SKIP/SCAN - what modern forth doesn't have it?Rick C
 `* Re: SKIP/SCAN - what modern forth doesn't have it?minf...@arcor.de
  +- Re: SKIP/SCAN - what modern forth doesn't have it?none
  +* Re: SKIP/SCAN - what modern forth doesn't have it?Kerr-Mudd, John
  |`- Re: SKIP/SCAN - what modern forth doesn't have it?dxforth
  `- Re: SKIP/SCAN - what modern forth doesn't have it?dxforth

Pages:12
Re: SKIP/SCAN - what modern forth doesn't have it?

<ta2hl9$obr$1@gioia.aioe.org>

  copy mid

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

  copy link   Newsgroups: comp.lang.forth
Path: i2pn2.org!i2pn.org!aioe.org!7AktqsUqy5CCvnKa3S0Dkw.user.46.165.242.75.POSTED!not-for-mail
From: dxfo...@gmail.com (dxforth)
Newsgroups: comp.lang.forth
Subject: Re: SKIP/SCAN - what modern forth doesn't have it?
Date: Wed, 6 Jul 2022 09:31:53 +1000
Organization: Aioe.org NNTP Server
Message-ID: <ta2hl9$obr$1@gioia.aioe.org>
References: <t9to17$1u6s$1@gioia.aioe.org>
<85102527-f82a-4ddb-9638-70d83174cad8n@googlegroups.com>
<ta0as4$ge1$1@gioia.aioe.org>
<705982c5-5dfb-4459-82e2-3b4e17744b84n@googlegroups.com>
<ta1ht2$3nq6g$1@dont-email.me> <2022Jul5.173251@mips.complang.tuwien.ac.at>
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
Injection-Info: gioia.aioe.org; logging-data="24955"; posting-host="7AktqsUqy5CCvnKa3S0Dkw.user.gioia.aioe.org"; mail-complaints-to="abuse@aioe.org";
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101
Thunderbird/91.10.0
X-Notice: Filtered by postfilter v. 0.9.2
Content-Language: en-GB
 by: dxforth - Tue, 5 Jul 2022 23:31 UTC

On 6/07/2022 01:32, Anton Ertl wrote:
> Stephen Pelc <stephen@vfxforth.com> writes:
>>The behaviour come from when we swtched from block files to text files.
>>We wished to retain the ability to keep source in chunks, and to keep the
>>text small, so we treated ^L (12) as a page separator and TAB (9) as white
>>space. At that time many text editors behaved the same way.
>
> 11.3.5
> |When parsing from a text file using a space delimiter, control
> |characters shall be treated the same as the space character.
>
> [funky behaviour of SKIP and SCAN in VFX]
>>I believe it is in the spirit of the ANS
>
> It certainly does: Systems are allowed to implement non-standard words
> like SKIP and SCAN with whatever semantics they like.

The standard for SKIP SCAN had been set by L&P F83. Anyone implementing
it would have been aware of what it was, and the consequences of departing.

Re: SKIP/SCAN - what modern forth doesn't have it?

<b69c42c7-8de9-4e3c-8feb-41ab289ae869n@googlegroups.com>

  copy mid

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

  copy link   Newsgroups: comp.lang.forth
X-Received: by 2002:a37:62c8:0:b0:6ae:fb95:2f2b with SMTP id w191-20020a3762c8000000b006aefb952f2bmr27553283qkb.645.1657132006189;
Wed, 06 Jul 2022 11:26:46 -0700 (PDT)
X-Received: by 2002:a05:620a:400f:b0:6af:53bc:7311 with SMTP id
h15-20020a05620a400f00b006af53bc7311mr28597884qko.305.1657132006024; Wed, 06
Jul 2022 11:26:46 -0700 (PDT)
Path: i2pn2.org!i2pn.org!feed1.usenet.blueworldhosting.com!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: Wed, 6 Jul 2022 11:26:45 -0700 (PDT)
In-Reply-To: <ta2hl9$obr$1@gioia.aioe.org>
Injection-Info: google-groups.googlegroups.com; posting-host=2a00:23c5:6f05:3a01:fccc:6c00:b065:837a;
posting-account=9A5f7goAAAD_QfJPZnlK3Xq_UhzYjdP-
NNTP-Posting-Host: 2a00:23c5:6f05:3a01:fccc:6c00:b065:837a
References: <t9to17$1u6s$1@gioia.aioe.org> <85102527-f82a-4ddb-9638-70d83174cad8n@googlegroups.com>
<ta0as4$ge1$1@gioia.aioe.org> <705982c5-5dfb-4459-82e2-3b4e17744b84n@googlegroups.com>
<ta1ht2$3nq6g$1@dont-email.me> <2022Jul5.173251@mips.complang.tuwien.ac.at> <ta2hl9$obr$1@gioia.aioe.org>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <b69c42c7-8de9-4e3c-8feb-41ab289ae869n@googlegroups.com>
Subject: Re: SKIP/SCAN - what modern forth doesn't have it?
From: november...@gmail.com (NN)
Injection-Date: Wed, 06 Jul 2022 18:26:46 +0000
Content-Type: text/plain; charset="UTF-8"
X-Received-Bytes: 3625
 by: NN - Wed, 6 Jul 2022 18:26 UTC

On Wednesday, 6 July 2022 at 00:31:56 UTC+1, dxforth wrote:
> On 6/07/2022 01:32, Anton Ertl wrote:
> > Stephen Pelc <ste...@vfxforth.com> writes:
> >>The behaviour come from when we swtched from block files to text files.
> >>We wished to retain the ability to keep source in chunks, and to keep the
> >>text small, so we treated ^L (12) as a page separator and TAB (9) as white
> >>space. At that time many text editors behaved the same way.
> >
> > 11.3.5
> > |When parsing from a text file using a space delimiter, control
> > |characters shall be treated the same as the space character.
> >
> > [funky behaviour of SKIP and SCAN in VFX]
> >>I believe it is in the spirit of the ANS
> >
> > It certainly does: Systems are allowed to implement non-standard words
> > like SKIP and SCAN with whatever semantics they like.
> The standard for SKIP SCAN had been set by L&P F83. Anyone implementing
> it would have been aware of what it was, and the consequences of departing.

I implemented a forth-like scanner and parser
in python once and found that the ability to just pass an
array of chars was useful. Meant I could look [' ','\t','\n','\r']
more easily.

If the need had arisen in forth then we would have these
filed under common usage.

( ---------------------------------------------------------- )
: searchchar ( a u c -- f )
over 0> if
scan nip 0> if true else false then
else drop drop drop false then ;
( ---------------------------------------------------------- )
: skip[] ( a1 u1 a2 u2 -- a3 u3 )
2>r begin eol? 0= while
rch 2r@ rot searchchar while
nch repeat
then 2r> 2drop ;
( ---------------------------------------------------------- )
: scan[] ( a1 u1 a2 u2 -- a3 u3 )
2>r begin eol? 0= while
rch 2r@ rot searchchar 0= while
nch repeat
then 2r> 2drop ;
( ---------------------------------------------------------- )

Notes
(1) searchchar is used because standard search requires a string
and I needed a char

so in gforth you would pass a string eg s\" \t \n\r" and search
for bl, tab, cr and nl all at once.
or any other combination you seek to skip[] and scan[] over

NN

Re: SKIP/SCAN - what modern forth doesn't have it?

<3bb23e30-032d-4d6e-a893-3b573b6c4245n@googlegroups.com>

  copy mid

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

  copy link   Newsgroups: comp.lang.forth
X-Received: by 2002:a05:6214:20e9:b0:472:f2e6:dd62 with SMTP id 9-20020a05621420e900b00472f2e6dd62mr15030304qvk.67.1657132598004;
Wed, 06 Jul 2022 11:36:38 -0700 (PDT)
X-Received: by 2002:ad4:5deb:0:b0:472:f289:9f89 with SMTP id
jn11-20020ad45deb000000b00472f2899f89mr15208752qvb.79.1657132597870; Wed, 06
Jul 2022 11:36:37 -0700 (PDT)
Path: i2pn2.org!i2pn.org!feed1.usenet.blueworldhosting.com!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: Wed, 6 Jul 2022 11:36:37 -0700 (PDT)
In-Reply-To: <b69c42c7-8de9-4e3c-8feb-41ab289ae869n@googlegroups.com>
Injection-Info: google-groups.googlegroups.com; posting-host=2a00:23c5:6f05:3a01:fccc:6c00:b065:837a;
posting-account=9A5f7goAAAD_QfJPZnlK3Xq_UhzYjdP-
NNTP-Posting-Host: 2a00:23c5:6f05:3a01:fccc:6c00:b065:837a
References: <t9to17$1u6s$1@gioia.aioe.org> <85102527-f82a-4ddb-9638-70d83174cad8n@googlegroups.com>
<ta0as4$ge1$1@gioia.aioe.org> <705982c5-5dfb-4459-82e2-3b4e17744b84n@googlegroups.com>
<ta1ht2$3nq6g$1@dont-email.me> <2022Jul5.173251@mips.complang.tuwien.ac.at>
<ta2hl9$obr$1@gioia.aioe.org> <b69c42c7-8de9-4e3c-8feb-41ab289ae869n@googlegroups.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <3bb23e30-032d-4d6e-a893-3b573b6c4245n@googlegroups.com>
Subject: Re: SKIP/SCAN - what modern forth doesn't have it?
From: november...@gmail.com (NN)
Injection-Date: Wed, 06 Jul 2022 18:36:37 +0000
Content-Type: text/plain; charset="UTF-8"
X-Received-Bytes: 4063
 by: NN - Wed, 6 Jul 2022 18:36 UTC

On Wednesday, 6 July 2022 at 19:26:47 UTC+1, NN wrote:
> On Wednesday, 6 July 2022 at 00:31:56 UTC+1, dxforth wrote:
> > On 6/07/2022 01:32, Anton Ertl wrote:
> > > Stephen Pelc <ste...@vfxforth.com> writes:
> > >>The behaviour come from when we swtched from block files to text files.
> > >>We wished to retain the ability to keep source in chunks, and to keep the
> > >>text small, so we treated ^L (12) as a page separator and TAB (9) as white
> > >>space. At that time many text editors behaved the same way.
> > >
> > > 11.3.5
> > > |When parsing from a text file using a space delimiter, control
> > > |characters shall be treated the same as the space character.
> > >
> > > [funky behaviour of SKIP and SCAN in VFX]
> > >>I believe it is in the spirit of the ANS
> > >
> > > It certainly does: Systems are allowed to implement non-standard words
> > > like SKIP and SCAN with whatever semantics they like.
> > The standard for SKIP SCAN had been set by L&P F83. Anyone implementing
> > it would have been aware of what it was, and the consequences of departing.
> I implemented a forth-like scanner and parser
> in python once and found that the ability to just pass an
> array of chars was useful. Meant I could look [' ','\t','\n','\r']
> more easily.
>
> If the need had arisen in forth then we would have these
> filed under common usage.
>
> ( ---------------------------------------------------------- )
> : searchchar ( a u c -- f )
> over 0> if
> scan nip 0> if true else false then
> else drop drop drop false then ;
> ( ---------------------------------------------------------- )
> : skip[] ( a1 u1 a2 u2 -- a3 u3 )
> 2>r begin eol? 0= while
> rch 2r@ rot searchchar while
> nch repeat
> then 2r> 2drop ;
>
> ( ---------------------------------------------------------- )
> : scan[] ( a1 u1 a2 u2 -- a3 u3 )
> 2>r begin eol? 0= while
> rch 2r@ rot searchchar 0= while
> nch repeat
> then 2r> 2drop ;
> ( ---------------------------------------------------------- )
>
> Notes
> (1) searchchar is used because standard search requires a string
> and I needed a char
>
>
>
> so in gforth you would pass a string eg s\" \t \n\r" and search
> for bl, tab, cr and nl all at once.
>
> or any other combination you seek to skip[] and scan[] over
>
>
> NN

Before someone asks

a1 u1 is the string we are searching over
a2 u2 is the character array of chars we are looking for
and
a3 u3 is what is returned as a result of searching thru a1 u1

Re: SKIP/SCAN - what modern forth doesn't have it?

<e6487006-73c4-44f2-9a56-501ba097608cn@googlegroups.com>

  copy mid

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

  copy link   Newsgroups: comp.lang.forth
X-Received: by 2002:a05:620a:2552:b0:6b4:8dbf:8992 with SMTP id s18-20020a05620a255200b006b48dbf8992mr6021823qko.109.1657133260382;
Wed, 06 Jul 2022 11:47:40 -0700 (PDT)
X-Received: by 2002:a05:622a:48f:b0:31d:396d:e55 with SMTP id
p15-20020a05622a048f00b0031d396d0e55mr23273238qtx.376.1657133260126; Wed, 06
Jul 2022 11:47:40 -0700 (PDT)
Path: i2pn2.org!i2pn.org!feed1.usenet.blueworldhosting.com!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: Wed, 6 Jul 2022 11:47:39 -0700 (PDT)
In-Reply-To: <b69c42c7-8de9-4e3c-8feb-41ab289ae869n@googlegroups.com>
Injection-Info: google-groups.googlegroups.com; posting-host=2003:f7:1f17:f907:c0de:44cb:37c4:b925;
posting-account=AqNUYgoAAADmkK2pN-RKms8sww57W0Iw
NNTP-Posting-Host: 2003:f7:1f17:f907:c0de:44cb:37c4:b925
References: <t9to17$1u6s$1@gioia.aioe.org> <85102527-f82a-4ddb-9638-70d83174cad8n@googlegroups.com>
<ta0as4$ge1$1@gioia.aioe.org> <705982c5-5dfb-4459-82e2-3b4e17744b84n@googlegroups.com>
<ta1ht2$3nq6g$1@dont-email.me> <2022Jul5.173251@mips.complang.tuwien.ac.at>
<ta2hl9$obr$1@gioia.aioe.org> <b69c42c7-8de9-4e3c-8feb-41ab289ae869n@googlegroups.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <e6487006-73c4-44f2-9a56-501ba097608cn@googlegroups.com>
Subject: Re: SKIP/SCAN - what modern forth doesn't have it?
From: minfo...@arcor.de (minf...@arcor.de)
Injection-Date: Wed, 06 Jul 2022 18:47:40 +0000
Content-Type: text/plain; charset="UTF-8"
X-Received-Bytes: 3927
 by: minf...@arcor.de - Wed, 6 Jul 2022 18:47 UTC

NN schrieb am Mittwoch, 6. Juli 2022 um 20:26:47 UTC+2:
> On Wednesday, 6 July 2022 at 00:31:56 UTC+1, dxforth wrote:
> > On 6/07/2022 01:32, Anton Ertl wrote:
> > > Stephen Pelc <ste...@vfxforth.com> writes:
> > >>The behaviour come from when we swtched from block files to text files.
> > >>We wished to retain the ability to keep source in chunks, and to keep the
> > >>text small, so we treated ^L (12) as a page separator and TAB (9) as white
> > >>space. At that time many text editors behaved the same way.
> > >
> > > 11.3.5
> > > |When parsing from a text file using a space delimiter, control
> > > |characters shall be treated the same as the space character.
> > >
> > > [funky behaviour of SKIP and SCAN in VFX]
> > >>I believe it is in the spirit of the ANS
> > >
> > > It certainly does: Systems are allowed to implement non-standard words
> > > like SKIP and SCAN with whatever semantics they like.
> > The standard for SKIP SCAN had been set by L&P F83. Anyone implementing
> > it would have been aware of what it was, and the consequences of departing.
> I implemented a forth-like scanner and parser
> in python once and found that the ability to just pass an
> array of chars was useful. Meant I could look [' ','\t','\n','\r']
> more easily.
>
> If the need had arisen in forth then we would have these
> filed under common usage.
>
> ( ---------------------------------------------------------- )
> : searchchar ( a u c -- f )
> over 0> if
> scan nip 0> if true else false then
> else drop drop drop false then ;
> ( ---------------------------------------------------------- )
> : skip[] ( a1 u1 a2 u2 -- a3 u3 )
> 2>r begin eol? 0= while
> rch 2r@ rot searchchar while
> nch repeat
> then 2r> 2drop ;
>
> ( ---------------------------------------------------------- )
> : scan[] ( a1 u1 a2 u2 -- a3 u3 )
> 2>r begin eol? 0= while
> rch 2r@ rot searchchar 0= while
> nch repeat
> then 2r> 2drop ;
> ( ---------------------------------------------------------- )
>
> Notes
> (1) searchchar is used because standard search requires a string
> and I needed a char
>
>
>
> so in gforth you would pass a string eg s\" \t \n\r" and search
> for bl, tab, cr and nl all at once.
>
> or any other combination you seek to skip[] and scan[] over

In C the string library functions strpbrk and strcspn do that job.

Re: SKIP/SCAN - what modern forth doesn't have it?

<ta5cpe$ulb$1@gioia.aioe.org>

  copy mid

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

  copy link   Newsgroups: comp.lang.forth
Path: i2pn2.org!i2pn.org!aioe.org!7AktqsUqy5CCvnKa3S0Dkw.user.46.165.242.75.POSTED!not-for-mail
From: dxfo...@gmail.com (dxforth)
Newsgroups: comp.lang.forth
Subject: Re: SKIP/SCAN - what modern forth doesn't have it?
Date: Thu, 7 Jul 2022 11:27:09 +1000
Organization: Aioe.org NNTP Server
Message-ID: <ta5cpe$ulb$1@gioia.aioe.org>
References: <t9to17$1u6s$1@gioia.aioe.org>
<85102527-f82a-4ddb-9638-70d83174cad8n@googlegroups.com>
<ta0as4$ge1$1@gioia.aioe.org>
<705982c5-5dfb-4459-82e2-3b4e17744b84n@googlegroups.com>
<ta1ht2$3nq6g$1@dont-email.me> <2022Jul5.173251@mips.complang.tuwien.ac.at>
<ta2hl9$obr$1@gioia.aioe.org>
<b69c42c7-8de9-4e3c-8feb-41ab289ae869n@googlegroups.com>
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
Injection-Info: gioia.aioe.org; logging-data="31403"; posting-host="7AktqsUqy5CCvnKa3S0Dkw.user.gioia.aioe.org"; mail-complaints-to="abuse@aioe.org";
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101
Thunderbird/91.11.0
X-Notice: Filtered by postfilter v. 0.9.2
Content-Language: en-GB
 by: dxforth - Thu, 7 Jul 2022 01:27 UTC

On 7/07/2022 04:26, NN wrote:
> ...
> I implemented a forth-like scanner and parser
> in python once and found that the ability to just pass an
> array of chars was useful. Meant I could look [' ','\t','\n','\r']
> more easily.
>
> If the need had arisen in forth then we would have these
> filed under common usage.
>
> ( ---------------------------------------------------------- )
> : searchchar ( a u c -- f )
> over 0> if
> scan nip 0> if true else false then
> else drop drop drop false then ;
> ( ---------------------------------------------------------- )
> : skip[] ( a1 u1 a2 u2 -- a3 u3 )
> 2>r begin eol? 0= while
> rch 2r@ rot searchchar while
> nch repeat
> then 2r> 2drop ;
>
> ( ---------------------------------------------------------- )
> : scan[] ( a1 u1 a2 u2 -- a3 u3 )
> 2>r begin eol? 0= while
> rch 2r@ rot searchchar 0= while
> nch repeat
> then 2r> 2drop ;
> ( ---------------------------------------------------------- )
>
> Notes
> (1) searchchar is used because standard search requires a string
> and I needed a char
>
>
>
> so in gforth you would pass a string eg s\" \t \n\r" and search
> for bl, tab, cr and nl all at once.
>
> or any other combination you seek to skip[] and scan[] over

We all have routines squirrelled away but primitives SKIP SCAN
is what's common to all. Henry is correct to assert they be kept
primitive. Sometimes we don't see the woods for the trees.

: searchchar ( a u c -- f )
over ( 0>) if scan nip ( 0>) exit then
drop nip ;

Re: SKIP/SCAN - what modern forth doesn't have it?

<ta5fo0$1tmi$1@gioia.aioe.org>

  copy mid

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

  copy link   Newsgroups: comp.lang.forth
Path: i2pn2.org!i2pn.org!aioe.org!7AktqsUqy5CCvnKa3S0Dkw.user.46.165.242.75.POSTED!not-for-mail
From: dxfo...@gmail.com (dxforth)
Newsgroups: comp.lang.forth
Subject: Re: SKIP/SCAN - what modern forth doesn't have it?
Date: Thu, 7 Jul 2022 12:17:35 +1000
Organization: Aioe.org NNTP Server
Message-ID: <ta5fo0$1tmi$1@gioia.aioe.org>
References: <t9to17$1u6s$1@gioia.aioe.org>
<85102527-f82a-4ddb-9638-70d83174cad8n@googlegroups.com>
<ta0as4$ge1$1@gioia.aioe.org>
<705982c5-5dfb-4459-82e2-3b4e17744b84n@googlegroups.com>
<ta1ht2$3nq6g$1@dont-email.me> <2022Jul5.173251@mips.complang.tuwien.ac.at>
<ta2hl9$obr$1@gioia.aioe.org>
<b69c42c7-8de9-4e3c-8feb-41ab289ae869n@googlegroups.com>
<e6487006-73c4-44f2-9a56-501ba097608cn@googlegroups.com>
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
Injection-Info: gioia.aioe.org; logging-data="63186"; posting-host="7AktqsUqy5CCvnKa3S0Dkw.user.gioia.aioe.org"; mail-complaints-to="abuse@aioe.org";
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101
Thunderbird/91.11.0
Content-Language: en-GB
X-Notice: Filtered by postfilter v. 0.9.2
 by: dxforth - Thu, 7 Jul 2022 02:17 UTC

On 7/07/2022 04:47, minf...@arcor.de wrote:
> NN schrieb am Mittwoch, 6. Juli 2022 um 20:26:47 UTC+2:
>>
>> so in gforth you would pass a string eg s\" \t \n\r" and search
>> for bl, tab, cr and nl all at once.
>>
>> or any other combination you seek to skip[] and scan[] over
>
> In C the string library functions strpbrk and strcspn do that job.

As would these in the case of blanks & control characters and more
efficiently.

\ Scan blank or control character
code BL-SCAN ( c-addr1 u1 -- c-addr2 u2 )
cx pop di pop $20 # al mov sseg ) es mov 2 $ jcxz
1 $: es: 0 [di] al cmp 2 $ jnc di inc 1 $ loop
2 $: di push cx push next
end-code

\ Skip blank or control character
code BL-SKIP ( c-addr1 u1 -- c-addr2 u2 )
cx pop di pop $20 # al mov sseg ) es mov 2 $ jcxz
1 $: es: 0 [di] al cmp 2 $ jc di inc 1 $ loop
2 $: di push cx push next
end-code

Re: SKIP/SCAN - what modern forth doesn't have it?

<78faec9f-6732-4144-84d3-edf9d197311dn@googlegroups.com>

  copy mid

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

  copy link   Newsgroups: comp.lang.forth
X-Received: by 2002:a05:622a:507:b0:31e:9f9b:e1ad with SMTP id l7-20020a05622a050700b0031e9f9be1admr3665541qtx.323.1657295760568;
Fri, 08 Jul 2022 08:56:00 -0700 (PDT)
X-Received: by 2002:a05:622a:551:b0:31d:425c:fb8e with SMTP id
m17-20020a05622a055100b0031d425cfb8emr3620341qtx.478.1657295760355; Fri, 08
Jul 2022 08:56:00 -0700 (PDT)
Path: i2pn2.org!i2pn.org!weretis.net!feeder6.news.weretis.net!news.misty.com!border2.nntp.dca1.giganews.com!nntp.giganews.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.forth
Date: Fri, 8 Jul 2022 08:56:00 -0700 (PDT)
In-Reply-To: <51841e7b-9590-45fe-ae4b-fed81f99b94fn@googlegroups.com>
Injection-Info: google-groups.googlegroups.com; posting-host=77.174.47.232; posting-account=Ebqe4AoAAABfjCRL4ZqOHWv4jv5ZU4Cs
NNTP-Posting-Host: 77.174.47.232
References: <t9to17$1u6s$1@gioia.aioe.org> <85102527-f82a-4ddb-9638-70d83174cad8n@googlegroups.com>
<ta0as4$ge1$1@gioia.aioe.org> <705982c5-5dfb-4459-82e2-3b4e17744b84n@googlegroups.com>
<ta1ht2$3nq6g$1@dont-email.me> <2022Jul5.173251@mips.complang.tuwien.ac.at> <51841e7b-9590-45fe-ae4b-fed81f99b94fn@googlegroups.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <78faec9f-6732-4144-84d3-edf9d197311dn@googlegroups.com>
Subject: Re: SKIP/SCAN - what modern forth doesn't have it?
From: the.beez...@gmail.com (Hans Bezemer)
Injection-Date: Fri, 08 Jul 2022 15:56:00 +0000
Content-Type: text/plain; charset="UTF-8"
Lines: 6
 by: Hans Bezemer - Fri, 8 Jul 2022 15:56 UTC

On Tuesday, July 5, 2022 at 6:42:35 PM UTC+2, Marcel Hendrix wrote:
> This means BL SCAN is a special case.
I hate special cases. Because they tend to lead to ugly code and
unintuitive behavior.

Hans Bezemer

Re: SKIP/SCAN - what modern forth doesn't have it?

<nnd$0dec312f$36593e34@9569820029bc5e32>

  copy mid

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

  copy link   Newsgroups: comp.lang.forth
Newsgroups: comp.lang.forth
References: <t9to17$1u6s$1@gioia.aioe.org> <2022Jul5.173251@mips.complang.tuwien.ac.at> <51841e7b-9590-45fe-ae4b-fed81f99b94fn@googlegroups.com> <78faec9f-6732-4144-84d3-edf9d197311dn@googlegroups.com>
Subject: Re: SKIP/SCAN - what modern forth doesn't have it?
X-Newsreader: trn 4.0-test77 (Sep 1, 2010)
From: alb...@cherry (none)
Originator: albert@cherry.(none) (albert)
Message-ID: <nnd$0dec312f$36593e34@9569820029bc5e32>
Organization: KPN B.V.
Date: Fri, 08 Jul 2022 21:41:04 +0200
Path: i2pn2.org!i2pn.org!aioe.org!news.mixmin.net!feeder1-2.proxad.net!proxad.net!feeder1-1.proxad.net!ecngs!feeder2.ecngs.de!178.20.174.213.MISMATCH!feeder1.feed.usenet.farm!feed.usenet.farm!news-out.netnews.com!news.alt.net!fdc2.netnews.com!peer01.ams1!peer.ams1.xlned.com!news.xlned.com!peer02.ams4!peer.am4.highwinds-media.com!news.highwinds-media.com!feed.abavia.com!abe005.abavia.com!abp003.abavia.com!news.kpn.nl!not-for-mail
Lines: 28
Injection-Date: Fri, 08 Jul 2022 21:41:04 +0200
Injection-Info: news.kpn.nl; mail-complaints-to="abuse@kpn.com"
X-Received-Bytes: 1717
 by: none - Fri, 8 Jul 2022 19:41 UTC

In article <78faec9f-6732-4144-84d3-edf9d197311dn@googlegroups.com>,
Hans Bezemer <the.beez.speaks@gmail.com> wrote:
>On Tuesday, July 5, 2022 at 6:42:35 PM UTC+2, Marcel Hendrix wrote:
>> This means BL SCAN is a special case.
>I hate special cases. Because they tend to lead to ugly code and
>unintuitive behavior.

+1
Sufficient reason to not implement SCAN .
WORD forces two different behaviours : PARSE-NAME / TOKEN / NAME
and PARSE.
So WORD is banned from the core implementation, and becomes
a loadable extension.
BL SCAN is inheriting a 70's design error from WORD .

[In my book]

>
>Hans Bezemer
>

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: SKIP/SCAN - what modern forth doesn't have it?

<taaqf8$kfs$1@gioia.aioe.org>

  copy mid

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

  copy link   Newsgroups: comp.lang.forth
Path: i2pn2.org!i2pn.org!aioe.org!7AktqsUqy5CCvnKa3S0Dkw.user.46.165.242.75.POSTED!not-for-mail
From: dxfo...@gmail.com (dxforth)
Newsgroups: comp.lang.forth
Subject: Re: SKIP/SCAN - what modern forth doesn't have it?
Date: Sat, 9 Jul 2022 12:51:19 +1000
Organization: Aioe.org NNTP Server
Message-ID: <taaqf8$kfs$1@gioia.aioe.org>
References: <t9to17$1u6s$1@gioia.aioe.org>
<2022Jul5.173251@mips.complang.tuwien.ac.at>
<51841e7b-9590-45fe-ae4b-fed81f99b94fn@googlegroups.com>
<78faec9f-6732-4144-84d3-edf9d197311dn@googlegroups.com>
<nnd$0dec312f$36593e34@9569820029bc5e32>
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
Injection-Info: gioia.aioe.org; logging-data="20988"; posting-host="7AktqsUqy5CCvnKa3S0Dkw.user.gioia.aioe.org"; mail-complaints-to="abuse@aioe.org";
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101
Thunderbird/91.11.0
X-Notice: Filtered by postfilter v. 0.9.2
Content-Language: en-GB
 by: dxforth - Sat, 9 Jul 2022 02:51 UTC

On 9/07/2022 05:41, albert wrote:
> In article <78faec9f-6732-4144-84d3-edf9d197311dn@googlegroups.com>,
> Hans Bezemer <the.beez.speaks@gmail.com> wrote:
>>On Tuesday, July 5, 2022 at 6:42:35 PM UTC+2, Marcel Hendrix wrote:
>>> This means BL SCAN is a special case.
>>I hate special cases. Because they tend to lead to ugly code and
>>unintuitive behavior.
>
> +1
> Sufficient reason to not implement SCAN .
> WORD forces two different behaviours : PARSE-NAME / TOKEN / NAME
> and PARSE.
> So WORD is banned from the core implementation, and becomes
> a loadable extension.
> BL SCAN is inheriting a 70's design error from WORD .

Use of SCAN extends beyond WORD etc e.g.

; -PATH ( c-addr1 u1 -- c-addr2 u2 )
; 2dup [char] : scan dup if 1 /string 2swap
; then begin 2drop 2dup [char] \ scan dup
; while 1 /string 2swap repeat 2drop

; /ext ( c-addr1 u1 -- u2 ) -path [char] . scan nip

; +EXT ( c-addr1 u1 c-addr2 u2 -- c-addr3 u3 )
; 2over /ext if 2drop end 3 min
; s" ." 2rot -trailing (pfsiz-5) min zbuf
; @ 1+ 0 +string +string +string

; -EXT ( c-addr u1 -- c-addr u2 ) 2dup /ext -

Pages:12
server_pubkey.txt

rocksolid light 0.9.81
clearnet tor