Re: Reverse SCAN SPLIT

Liste des Groupes 
Sujet : Re: Reverse SCAN SPLIT
De : dxforth (at) *nospam* gmail.com (dxf)
Groupes : comp.lang.forth
Date : 18. Oct 2024, 15:41:52
Autres entêtes
Organisation : i2pn2 (i2pn.org)
Message-ID : <fea4967aee99bd0d235a21fbd6253e167b5690a9@i2pn2.org>
References : 1 2 3 4 5
User-Agent : Mozilla Thunderbird
On 17/10/2024 9:48 pm, albert@spenarnc.xs4all.nl wrote:
In article <73ec4c8359439c78d77d4fce31fc50b2@www.novabbs.com>,
mhx <mhx@iae.nl> wrote:
On Thu, 17 Oct 2024 8:28:26 +0000, albert@spenarnc.xs4all.nl wrote:
>
In article <nnd$231969a2$24a04042@87f25e33f755b9dd>,
[..]
Compare to what I'm doing. Promoting the actual API specification
so that you can decide whether you want to actually use it.
>
   $/
>
>
  STACKEFFECT: sc c --- sc1 sc2
>
  DESCRIPTION: []
>
  Find the first c in the string constant sc and split it at that
  address. Return the strings after and before c into sc1 and sc2
  respectively. If the character is not present sc1 is a null string
  (its address is zero) and sc2 is the original string. Both sc1 and
  sc2 may be empty strings (i.e. their count is zero), if c is the
  last or first character in sc .
>
Wil Baden chose to keep c in sc2. Do you have a reason to
remove it?
>
It seems logical to remove it. I normally use lots of
`1 /STRING' and `-LEADING' or `-TRAILING' sequences in further
processing of Split-At-Char results, but not always.
Maybe because an empty sc2 is less informative than an sc2 of
size 1?
 
In the rare case that you want the delimiter :
"orang utan" BL $/
( *utan" "orang" )
you simply do
  1+
( *utan" "orang " )

Applying 1+ is not foolproof in the case of empty sc2.


Date Sujet#  Auteur
7 Oct 24 * Reverse SCAN SPLIT18dxf
7 Oct 24 +* Re: Reverse SCAN SPLIT6Ahmed
7 Oct 24 i`* Re: Reverse SCAN SPLIT5Ahmed
7 Oct 24 i `* Re: Reverse SCAN SPLIT4dxf
7 Oct 24 i  `* Re: Reverse SCAN SPLIT3Ahmed
8 Oct 24 i   `* Re: Reverse SCAN SPLIT2dxf
8 Oct 24 i    `- Re: Reverse SCAN SPLIT1Ahmed
7 Oct 24 +* Re: Reverse SCAN SPLIT2Ruvim
7 Oct 24 i`- Re: Reverse SCAN SPLIT1dxf
7 Oct 24 +- Re: Reverse SCAN SPLIT1dxf
10 Oct 24 +- Re: Reverse SCAN SPLIT1dxf
10 Oct 24 `* Re: Reverse SCAN SPLIT7albert
10 Oct 24  `* Re: Reverse SCAN SPLIT6dxf
17 Oct 24   +- Re: Reverse SCAN SPLIT1minforth
17 Oct 24   `* Re: Reverse SCAN SPLIT4mhx
18 Oct 24    +- Re: Reverse SCAN SPLIT1dxf
18 Oct 24    `* Re: Reverse SCAN SPLIT2dxf
19 Oct 24     `- Re: Reverse SCAN SPLIT1albert

Haut de la page

Les messages affichés proviennent d'usenet.

NewsPortal