Path: ...!weretis.net!feeder9.news.weretis.net!i2pn.org!rocksolid2!i2pn2.org!.POSTED!not-for-mail From: dxf Newsgroups: comp.lang.forth Subject: Re: Reverse SCAN SPLIT Date: Sat, 19 Oct 2024 01:41:52 +1100 Organization: i2pn2 (i2pn.org) Message-ID: References: <5c65a8f1fdfc3e9937a825842fe23dc2758f48ef@i2pn2.org> <73ec4c8359439c78d77d4fce31fc50b2@www.novabbs.com> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Injection-Date: Fri, 18 Oct 2024 14:41:56 -0000 (UTC) Injection-Info: i2pn2.org; logging-data="2601591"; mail-complaints-to="usenet@i2pn2.org"; posting-account="XPw7UV90Iy7EOhY4YuUXhpdoEf5Vz7K+BsxA/Cx8bVc"; User-Agent: Mozilla Thunderbird Content-Language: en-GB X-Spam-Checker-Version: SpamAssassin 4.0.0 In-Reply-To: Bytes: 2562 Lines: 41 On 17/10/2024 9:48 pm, albert@spenarnc.xs4all.nl wrote: > In article <73ec4c8359439c78d77d4fce31fc50b2@www.novabbs.com>, > mhx wrote: >> On Thu, 17 Oct 2024 8:28:26 +0000, albert@spenarnc.xs4all.nl wrote: >> >>> In article , >> [..] >>> 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.