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

    From dxforth@21:1/5 to All on Mon Jul 4 13:49:59 2022
    Until recently I treated SKIP/SCAN as exotic functions only found in
    medium to large forths. That changed when I encountered them in small microcontroller forths e.g. FlashForth, SwiftX.

    If forthers are avoiding SKIP/SCAN because it's 'not ANS' then I
    would say it's time to reconsider - not standardization as hell will
    freeze first - rather treat them as ubiquitously and with as little
    need of explanation or definition as is currently afforded PLACE.
    Regarding compatibility, the only consideration is 'white space'.
    SKIP/SCAN has the same restriction as WORD when BL is used as the
    scan character. Which should come as no surprise as WORD is typically implemented with SKIP/SCAN.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From none) (albert@21:1/5 to dxforth@gmail.com on Mon Jul 4 09:43:36 2022
    In article <t9to17$1u6s$1@gioia.aioe.org>, dxforth <dxforth@gmail.com> wrote: >Until recently I treated SKIP/SCAN as exotic functions only found in
    medium to large forths. That changed when I encountered them in small >microcontroller forths e.g. FlashForth, SwiftX.

    If forthers are avoiding SKIP/SCAN because it's 'not ANS' then I
    would say it's time to reconsider - not standardization as hell will
    freeze first - rather treat them as ubiquitously and with as little
    need of explanation or definition as is currently afforded PLACE.
    Regarding compatibility, the only consideration is 'white space'.
    SKIP/SCAN has the same restriction as WORD when BL is used as the
    scan character. Which should come as no surprise as WORD is typically >implemented with SKIP/SCAN.

    In modern Forth WORD is not typically implemented but a loadable extension.

    For SKIP SCAN I can't remember what it is supposed to do.
    Gforth 0.7.3 has it, but I can't find in the documentation.
    Swiftforth has it, but I can't find in the documentation.

    Bottom line, as soon as it standardized, I will look into it,
    if it worthwhile to add to ciforth.

    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

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From minforth@arcor.de@21:1/5 to none albert on Mon Jul 4 00:52:46 2022
    none albert schrieb am Montag, 4. Juli 2022 um 09:43:40 UTC+2:
    In article <t9to17$1u6s$1...@gioia.aioe.org>, dxforth <dxf...@gmail.com> wrote:
    Until recently I treated SKIP/SCAN as exotic functions only found in
    medium to large forths. That changed when I encountered them in small >microcontroller forths e.g. FlashForth, SwiftX.

    If forthers are avoiding SKIP/SCAN because it's 'not ANS' then I
    would say it's time to reconsider - not standardization as hell will
    freeze first - rather treat them as ubiquitously and with as little
    need of explanation or definition as is currently afforded PLACE.
    Regarding compatibility, the only consideration is 'white space'.
    SKIP/SCAN has the same restriction as WORD when BL is used as the
    scan character. Which should come as no surprise as WORD is typically >implemented with SKIP/SCAN.
    In modern Forth WORD is not typically implemented but a loadable extension.

    For SKIP SCAN I can't remember what it is supposed to do.
    Gforth 0.7.3 has it, but I can't find in the documentation.
    Swiftforth has it, but I can't find in the documentation.

    Bottom line, as soon as it standardized, I will look into it,
    if it worthwhile to add to ciforth.

    I consider Forth source text as pre-tokenized because every word/number
    appears space-delimited.

    For non-tokenized text those classic SKIP/SCAN words are practically useless.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From none) (albert@21:1/5 to minf...@arcor.de on Mon Jul 4 09:59:16 2022
    In article <3051af2f-1cec-4aca-885c-76a54938e1f0n@googlegroups.com>, minf...@arcor.de <minforth@arcor.de> wrote:
    none albert schrieb am Montag, 4. Juli 2022 um 09:43:40 UTC+2:
    In article <t9to17$1u6s$1...@gioia.aioe.org>, dxforth
    <dxf...@gmail.com> wrote:
    Until recently I treated SKIP/SCAN as exotic functions only found in
    medium to large forths. That changed when I encountered them in small
    microcontroller forths e.g. FlashForth, SwiftX.

    If forthers are avoiding SKIP/SCAN because it's 'not ANS' then I
    would say it's time to reconsider - not standardization as hell will
    freeze first - rather treat them as ubiquitously and with as little
    need of explanation or definition as is currently afforded PLACE.
    Regarding compatibility, the only consideration is 'white space'.
    SKIP/SCAN has the same restriction as WORD when BL is used as the
    scan character. Which should come as no surprise as WORD is typically
    implemented with SKIP/SCAN.
    In modern Forth WORD is not typically implemented but a loadable extension. >>
    For SKIP SCAN I can't remember what it is supposed to do.
    Gforth 0.7.3 has it, but I can't find in the documentation.
    Swiftforth has it, but I can't find in the documentation.

    Bottom line, as soon as it standardized, I will look into it,
    if it worthwhile to add to ciforth.

    I consider Forth source text as pre-tokenized because every word/number >appears space-delimited.

    For non-tokenized text those classic SKIP/SCAN words are practically useless.


    No any more. The modern insights is that
    "we gaan naar Rome"
    is a token.
    You can't have much success if considering Forth as pre-tokenized,
    nowadays. That was cure in the seventies.

    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

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Zbig@21:1/5 to All on Mon Jul 4 03:11:50 2022
    It came as a surprise to me that these useful words have not been
    included into the ANS standard. They should be added.

    I believe these two words -- and any other -- everyone can include
    on one's own, without trying to make the whole Forth-world happy
    with new, even better standard.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Heinrich Hohl@21:1/5 to dxforth on Mon Jul 4 02:58:25 2022
    On Monday, July 4, 2022 at 5:50:02 AM UTC+2, dxforth wrote:
    Until recently I treated SKIP/SCAN as exotic functions only found in
    medium to large forths.

    I use SKIP and SCAN quite often when processing strings.

    I would not know how to skip leading characters, or scan for words
    delimited by a specified character, without SKIP and SCAN.

    It came as a surprise to me that these useful words have not been
    included into the ANS standard. They should be added.

    Henry

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From minforth@arcor.de@21:1/5 to none albert on Mon Jul 4 03:42:04 2022
    none albert schrieb am Montag, 4. Juli 2022 um 09:59:19 UTC+2:
    In article <3051af2f-1cec-4aca...@googlegroups.com>,
    minf...@arcor.de <minf...@arcor.de> wrote:
    none albert schrieb am Montag, 4. Juli 2022 um 09:43:40 UTC+2:
    In article <t9to17$1u6s$1...@gioia.aioe.org>, dxforth
    <dxf...@gmail.com> wrote:
    Until recently I treated SKIP/SCAN as exotic functions only found in
    medium to large forths. That changed when I encountered them in small
    microcontroller forths e.g. FlashForth, SwiftX.

    If forthers are avoiding SKIP/SCAN because it's 'not ANS' then I
    would say it's time to reconsider - not standardization as hell will
    freeze first - rather treat them as ubiquitously and with as little
    need of explanation or definition as is currently afforded PLACE.
    Regarding compatibility, the only consideration is 'white space'.
    SKIP/SCAN has the same restriction as WORD when BL is used as the
    scan character. Which should come as no surprise as WORD is typically
    implemented with SKIP/SCAN.
    In modern Forth WORD is not typically implemented but a loadable extension.

    For SKIP SCAN I can't remember what it is supposed to do.
    Gforth 0.7.3 has it, but I can't find in the documentation.
    Swiftforth has it, but I can't find in the documentation.

    Bottom line, as soon as it standardized, I will look into it,
    if it worthwhile to add to ciforth.

    I consider Forth source text as pre-tokenized because every word/number >appears space-delimited.

    For non-tokenized text those classic SKIP/SCAN words are practically useless.

    No any more. The modern insights is that
    "we gaan naar Rome"
    is a token.
    You can't have much success if considering Forth as pre-tokenized,
    nowadays. That was cure in the seventies.

    That's a question of definition. Scanning and parsing is fuzzy anyhow in Forth.

    I had my revelations when treating non-Forth code with Forth eg
    4*alpha+0.01
    with alpha being a known constant.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From none) (albert@21:1/5 to hheinrich.hohl@gmail.com on Mon Jul 4 14:18:28 2022
    In article <85102527-f82a-4ddb-9638-70d83174cad8n@googlegroups.com>,
    Heinrich Hohl <hheinrich.hohl@gmail.com> wrote:
    On Monday, July 4, 2022 at 5:50:02 AM UTC+2, dxforth wrote:
    Until recently I treated SKIP/SCAN as exotic functions only found in
    medium to large forths.

    I use SKIP and SCAN quite often when processing strings.

    I would not know how to skip leading characters, or scan for words
    delimited by a specified character, without SKIP and SCAN.

    It came as a surprise to me that these useful words have not been
    included into the ANS standard. They should be added.

    Then propose and give a watertight definition, and get it approved.
    As everybody agrees with the definition, that is the motivation
    to add to every Forth.


    Henry

    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

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Hans Bezemer@21:1/5 to dxforth on Mon Jul 4 06:30:31 2022
    On Monday, July 4, 2022 at 5:50:02 AM UTC+2, dxforth wrote:
    If forthers are avoiding SKIP/SCAN because it's 'not ANS' then I
    would say it's time to reconsider - not standardization as hell will
    freeze first - rather treat them as ubiquitously and with as little
    need of explanation or definition as is currently afforded PLACE.
    I rarely use SCAN/SKIP, because I read most strings from file - and
    there (in 4tH) I can use PARSE, PARSE-NAME - or numerous other
    (loadable) variations - including PARSE-CSV.

    Where SCAN/SKIP is concerned I have some other variations on that
    theme where the SCAN, SKIP or SPLIT function is a DEFERed word
    that can e.g. do numeric characters or non-alphabetic characters -
    you name it.

    Regarding compatibility, the only consideration is 'white space'.
    SKIP/SCAN has the same restriction as WORD when BL is used as the
    scan character. Which should come as no surprise as WORD is typically implemented with SKIP/SCAN.
    WORD is loadable in 4tH - but I don't think I've used it in decades.

    In short - yeah, I got 'em. No, I barely use 'em.

    Hans Bezemer

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Rick C@21:1/5 to dxforth on Mon Jul 4 08:51:15 2022
    On Sunday, July 3, 2022 at 11:50:02 PM UTC-4, dxforth wrote:
    Until recently I treated SKIP/SCAN as exotic functions only found in
    medium to large forths. That changed when I encountered them in small microcontroller forths e.g. FlashForth, SwiftX.

    If forthers are avoiding SKIP/SCAN because it's 'not ANS' then I
    would say it's time to reconsider - not standardization as hell will
    freeze first - rather treat them as ubiquitously and with as little
    need of explanation or definition as is currently afforded PLACE.
    Regarding compatibility, the only consideration is 'white space'.
    SKIP/SCAN has the same restriction as WORD when BL is used as the
    scan character. Which should come as no surprise as WORD is typically implemented with SKIP/SCAN.

    At least one post says they don't know what SKIP and SCAN are supposed to do. I don't see where anyone mentions this. Can someone explain it for my benefit?

    --

    Rick C.

    - Get 1,000 miles of free Supercharging
    - Tesla referral code - https://ts.la/richard11209

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From minforth@arcor.de@21:1/5 to gnuarm.del...@gmail.com on Mon Jul 4 09:19:15 2022
    gnuarm.del...@gmail.com schrieb am Montag, 4. Juli 2022 um 17:51:17 UTC+2:
    On Sunday, July 3, 2022 at 11:50:02 PM UTC-4, dxforth wrote:
    Until recently I treated SKIP/SCAN as exotic functions only found in
    medium to large forths. That changed when I encountered them in small microcontroller forths e.g. FlashForth, SwiftX.

    If forthers are avoiding SKIP/SCAN because it's 'not ANS' then I
    would say it's time to reconsider - not standardization as hell will
    freeze first - rather treat them as ubiquitously and with as little
    need of explanation or definition as is currently afforded PLACE.
    Regarding compatibility, the only consideration is 'white space'.
    SKIP/SCAN has the same restriction as WORD when BL is used as the
    scan character. Which should come as no surprise as WORD is typically implemented with SKIP/SCAN.
    At least one post says they don't know what SKIP and SCAN are supposed to do. I don't see where anyone mentions this. Can someone explain it for my benefit?


    See here page 101ff (89/90 in the document) http://www.forth.org/OffeteStore/1003_InsideF83.pdf

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From none) (albert@21:1/5 to minf...@arcor.de on Mon Jul 4 21:30:44 2022
    In article <f2d6e47e-d462-4dc0-a317-d9cfb7089902n@googlegroups.com>, minf...@arcor.de <minforth@arcor.de> wrote:
    gnuarm.del...@gmail.com schrieb am Montag, 4. Juli 2022 um 17:51:17 UTC+2:
    On Sunday, July 3, 2022 at 11:50:02 PM UTC-4, dxforth wrote:
    Until recently I treated SKIP/SCAN as exotic functions only found in
    medium to large forths. That changed when I encountered them in small
    microcontroller forths e.g. FlashForth, SwiftX.

    If forthers are avoiding SKIP/SCAN because it's 'not ANS' then I
    would say it's time to reconsider - not standardization as hell will
    freeze first - rather treat them as ubiquitously and with as little
    need of explanation or definition as is currently afforded PLACE.
    Regarding compatibility, the only consideration is 'white space'.
    SKIP/SCAN has the same restriction as WORD when BL is used as the
    scan character. Which should come as no surprise as WORD is typically
    implemented with SKIP/SCAN.
    At least one post says they don't know what SKIP and SCAN are supposed
    to do. I don't see where anyone mentions this. Can someone explain it
    for my benefit?


    See here page 101ff (89/90 in the document) >http://www.forth.org/OffeteStore/1003_InsideF83.pdf

    Please note that this refers to a single implementation of
    Forth. (f83.exe).
    These words are not present in the FORTH 83 standard. http://forth.sourceforge.net/standard/fst83/

    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

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Kerr-Mudd, John@21:1/5 to minf...@arcor.de on Mon Jul 4 21:16:11 2022
    On Mon, 4 Jul 2022 09:19:15 -0700 (PDT)
    "minf...@arcor.de" <minforth@arcor.de> wrote:

    gnuarm.del...@gmail.com schrieb am Montag, 4. Juli 2022 um 17:51:17 UTC+2:
    On Sunday, July 3, 2022 at 11:50:02 PM UTC-4, dxforth wrote:
    Until recently I treated SKIP/SCAN as exotic functions only found in medium to large forths. That changed when I encountered them in small microcontroller forths e.g. FlashForth, SwiftX.

    If forthers are avoiding SKIP/SCAN because it's 'not ANS' then I
    would say it's time to reconsider - not standardization as hell will freeze first - rather treat them as ubiquitously and with as little
    need of explanation or definition as is currently afforded PLACE. Regarding compatibility, the only consideration is 'white space'. SKIP/SCAN has the same restriction as WORD when BL is used as the
    scan character. Which should come as no surprise as WORD is typically implemented with SKIP/SCAN.
    At least one post says they don't know what SKIP and SCAN are supposed to do. I don't see where anyone mentions this. Can someone explain it for my benefit?


    See here page 101ff (89/90 in the document) http://www.forth.org/OffeteStore/1003_InsideF83.pdf

    There's a typo in the asm code for SKIP on that page:
    <quote>
    LABEL DONE A common returning point when the input stream is exhausted.
    CX PUSH Push the contents of CX on stack and return. CX register has the remaining length
    of the stream.
    NEXT

    CODE SKIP ( addr len char -- addr1 len1 )
    Given the address and length of a string, and a character to look for, scan through
    the string while we continue to find the character. Leave the address of the mismatch and the length of the remaining string.
    AX POP Move char to AX register.
    CX POP Move len to CX register.
    DONE JCXZ If length of string is zero, jump to DONE and return.
    DI POP Move addr to DI register.
    DX DX MOV
    DX ES MOV Set ES=DS for string manipulations.
    REPZ BYTE SCAS Repeatedly scan the string until we find a character different from that in AX.
    0<> IF CX now has the count of characters in the remaining string. If CX is not zero,
    </quote>


    I'm pretty sure it should be:
    DX DS MOV
    before
    DX ES MOV Set ES=DS for string manipulations.

    --
    Bah, and indeed Humbug.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From dxforth@21:1/5 to Heinrich Hohl on Tue Jul 5 13:23:47 2022
    On 4/07/2022 19:58, Heinrich Hohl wrote:
    On Monday, July 4, 2022 at 5:50:02 AM UTC+2, dxforth wrote:
    Until recently I treated SKIP/SCAN as exotic functions only found in
    medium to large forths.

    I use SKIP and SCAN quite often when processing strings.

    I would not know how to skip leading characters, or scan for words
    delimited by a specified character, without SKIP and SCAN.

    It came as a surprise to me that these useful words have not been
    included into the ANS standard. They should be added.

    Checking occurrence of SCAN (approx, excluding false matches but not
    duplicated sources):

    SwiftForth: 35
    VfxForth: 168
    Win32Forth: 269 (???)
    Gforth: 34

    SCAN is used in literally every application I write (command-tail parsing).

    For those who use SKIP and SCAN, does it specially handle TABs?
    e.g. VFX versions treat TABs in the string as if they were BL.
    Has it caused any issues in practice?

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From dxforth@21:1/5 to minf...@arcor.de on Tue Jul 5 13:36:55 2022
    On 5/07/2022 02:19, minf...@arcor.de wrote:
    gnuarm.del...@gmail.com schrieb am Montag, 4. Juli 2022 um 17:51:17 UTC+2:
    On Sunday, July 3, 2022 at 11:50:02 PM UTC-4, dxforth wrote:
    Until recently I treated SKIP/SCAN as exotic functions only found in
    medium to large forths. That changed when I encountered them in small
    microcontroller forths e.g. FlashForth, SwiftX.

    If forthers are avoiding SKIP/SCAN because it's 'not ANS' then I
    would say it's time to reconsider - not standardization as hell will
    freeze first - rather treat them as ubiquitously and with as little
    need of explanation or definition as is currently afforded PLACE.
    Regarding compatibility, the only consideration is 'white space'.
    SKIP/SCAN has the same restriction as WORD when BL is used as the
    scan character. Which should come as no surprise as WORD is typically
    implemented with SKIP/SCAN.
    At least one post says they don't know what SKIP and SCAN are supposed to do.

    ANS said there were folks oblivious about locals - so they introduced it!
    Their way of getting something into the 'forth common consciousness'.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From dxforth@21:1/5 to John on Tue Jul 5 14:08:20 2022
    On 5/07/2022 06:16, Kerr-Mudd, John wrote:

    See here page 101ff (89/90 in the document)
    http://www.forth.org/OffeteStore/1003_InsideF83.pdf

    There's a typo in the asm code for SKIP on that page:
    <quote>
    LABEL DONE A common returning point when the input stream is exhausted.
    CX PUSH Push the contents of CX on stack and return. CX register has the remaining length
    of the stream.
    NEXT

    CODE SKIP ( addr len char -- addr1 len1 )
    Given the address and length of a string, and a character to look for, scan through
    the string while we continue to find the character. Leave the address of the mismatch and the length of the remaining string.
    AX POP Move char to AX register.
    CX POP Move len to CX register.
    DONE JCXZ If length of string is zero, jump to DONE and return.
    DI POP Move addr to DI register.
    DX DX MOV
    DX ES MOV Set ES=DS for string manipulations.
    REPZ BYTE SCAS Repeatedly scan the string until we find a character different from that in AX.
    0<> IF CX now has the count of characters in the remaining string. If CX is not zero,
    </quote>


    I'm pretty sure it should be:
    DX DS MOV
    before
    DX ES MOV Set ES=DS for string manipulations.

    A nice trick is to allow ES to be set from a variable. This allows SKIP
    and other string operators to be used on segments other than forth e.g.

    \ Return DOS environment segment
    : ENVSEG ( -- seg ) $2C @ ;

    \ Search DOS environment for string a u. Return null
    \ terminated remainder. Null not included in count.
    : GETENV ( a u -- seg zadr len true | false )
    2>r envseg dup sseg !
    0 begin 2dup @l while 1+ repeat 2+
    r@ 0 rot 2r> caps search
    if rot /string drop zcount true
    else 2drop 2drop 0 then cseg sseg ! ;

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From dxforth@21:1/5 to Hans Bezemer on Tue Jul 5 15:00:07 2022
    On 4/07/2022 23:30, Hans Bezemer wrote:
    On Monday, July 4, 2022 at 5:50:02 AM UTC+2, dxforth wrote:
    If forthers are avoiding SKIP/SCAN because it's 'not ANS' then I
    would say it's time to reconsider - not standardization as hell will
    freeze first - rather treat them as ubiquitously and with as little
    need of explanation or definition as is currently afforded PLACE.
    I rarely use SCAN/SKIP, because I read most strings from file - and
    there (in 4tH) I can use PARSE, PARSE-NAME - or numerous other
    (loadable) variations - including PARSE-CSV.

    Where SCAN/SKIP is concerned I have some other variations on that
    theme where the SCAN, SKIP or SPLIT function is a DEFERed word
    that can e.g. do numeric characters or non-alphabetic characters -
    you name it.

    Staying on that thought, Wil Baden did a 'generalized' SKIP/SCAN -
    macros in a BEGIN WHILE REPEAT. It could scan backwards, forwards,
    skip white-space etc. I've wondered who came up with the original
    SKIP/SCAN factors - Laxen & Perry - or perhaps another Baden suggestion
    like PLACE ?

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From minforth@arcor.de@21:1/5 to Heinrich Hohl on Tue Jul 5 02:37:51 2022
    Heinrich Hohl schrieb am Dienstag, 5. Juli 2022 um 11:23:47 UTC+2:
    On Tuesday, July 5, 2022 at 5:23:51 AM UTC+2, dxforth wrote:
    For those who use SKIP and SCAN, does it specially handle TABs?
    e.g. VFX versions treat TABs in the string as if they were BL.
    Has it caused any issues in practice?
    SKIP and SCAN are only supposed to skip or scan for the specified character. Space ($20) and tab ($09) are clearly not the same characters, and the two words should be able to distinguish them. You may want to distinguish them!

    In SwiftForth, SKIP and SCAN work as expected. They will distinguish space and tab.
    Both words are code definitions and written as short as possible with no extra actions.
    This is how it should be.

    I looked at VFX and yes, this is weird. The definitions for SKIP and SCAN are more
    complicated than necessary and contain extra tests for $09 and $20.

    In my eyes this is not a good solution. Treating space and tab as identical characters
    may be convenient at times, but this requirement should be handled differently.

    In Forth, basic words should perform simple actions. This makes their actions predictable
    and avoids unexpected side effects.

    The only good thing that I can say about it is that the VFX manual clearly describes the
    unusual behavior of SKIP and SCAN:
    "Note that when a space char is given, tabs are also ignored."


    Things shouldn't be taken too religiously. The standard speaks even of ignoring whitespaces for some words.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Heinrich Hohl@21:1/5 to dxforth on Tue Jul 5 02:23:45 2022
    On Tuesday, July 5, 2022 at 5:23:51 AM UTC+2, dxforth wrote:
    For those who use SKIP and SCAN, does it specially handle TABs?
    e.g. VFX versions treat TABs in the string as if they were BL.
    Has it caused any issues in practice?

    SKIP and SCAN are only supposed to skip or scan for the specified character. Space ($20) and tab ($09) are clearly not the same characters, and the two words should be able to distinguish them. You may want to distinguish them!

    In SwiftForth, SKIP and SCAN work as expected. They will distinguish space and tab.
    Both words are code definitions and written as short as possible with no extra actions.
    This is how it should be.

    I looked at VFX and yes, this is weird. The definitions for SKIP and SCAN are more
    complicated than necessary and contain extra tests for $09 and $20.

    In my eyes this is not a good solution. Treating space and tab as identical characters
    may be convenient at times, but this requirement should be handled differently.

    In Forth, basic words should perform simple actions. This makes their actions predictable
    and avoids unexpected side effects.

    The only good thing that I can say about it is that the VFX manual clearly describes the
    unusual behavior of SKIP and SCAN:
    "Note that when a space char is given, tabs are also ignored."

    Henry

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From dxforth@21:1/5 to Heinrich Hohl on Tue Jul 5 21:32:27 2022
    On 5/07/2022 19:23, Heinrich Hohl wrote:
    On Tuesday, July 5, 2022 at 5:23:51 AM UTC+2, dxforth wrote:
    For those who use SKIP and SCAN, does it specially handle TABs?
    e.g. VFX versions treat TABs in the string as if they were BL.
    Has it caused any issues in practice?

    SKIP and SCAN are only supposed to skip or scan for the specified character. Space ($20) and tab ($09) are clearly not the same characters, and the two words should be able to distinguish them. You may want to distinguish them!

    In SwiftForth, SKIP and SCAN work as expected. They will distinguish space and tab.
    Both words are code definitions and written as short as possible with no extra actions.
    This is how it should be.

    I looked at VFX and yes, this is weird. The definitions for SKIP and SCAN are more
    complicated than necessary and contain extra tests for $09 and $20.

    Specifically it checks input char read - if $09 it substitutes $20 and compares that against the reference.

    In my eyes this is not a good solution. Treating space and tab as identical characters
    may be convenient at times, but this requirement should be handled differently.

    It means SCASB can't be employed and $09 becomes opaque. OTOH it simplifies text parsing. Lines containing tabs won't require additional handling.

    In Forth, basic words should perform simple actions. This makes their actions predictable
    and avoids unexpected side effects.

    That's the question. I currently use the classic SKIP/SCAN. Am I gaining anything by staying with it, or would I be better off switching to what VFX
    and FlashForth uses? FlashForth likely hasn't had much use but VFX presumably has.

    The only good thing that I can say about it is that the VFX manual clearly describes the
    unusual behavior of SKIP and SCAN:
    "Note that when a space char is given, tabs are also ignored."

    What it omits to say is that when tab is given, it will never be found :)

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Stephen Pelc@21:1/5 to All on Tue Jul 5 14:29:54 2022
    On 5 Jul 2022 at 11:23:45 CEST, "Heinrich Hohl" <hheinrich.hohl@gmail.com> wrote:

    I looked at VFX and yes, this is weird. The definitions for SKIP and SCAN are more
    complicated than necessary and contain extra tests for $09 and $20.

    In my eyes this is not a good solution. Treating space and tab as identical characters
    may be convenient at times, but this requirement should be handled differently.

    In Forth, basic words should perform simple actions. This makes their actions predictable
    and avoids unexpected side effects.

    The only good thing that I can say about it is that the VFX manual clearly describes the
    unusual behavior of SKIP and SCAN:
    "Note that when a space char is given, tabs are also ignored."

    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.

    This behaviour has, to our knowledge, only inconvenienced one client
    in the last 30 years or more, and they just redefined SKIP and SCAN
    in their application. Apart from that client this behaviour has created no technical support. I believe it is in the spirit of the ANS and following standards use of the term "whitespace".

    Stephen

    --
    Stephen Pelc, stephen@vfxforth.com
    MicroProcessor Engineering, Ltd. - More Real, Less Time
    133 Hill Lane, Southampton SO15 5AF, England
    tel: +44 (0)23 8063 1441, +44 (0)78 0390 3612, +34 649 662 974 http://www.mpeforth.com - free VFX Forth downloads

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Anton Ertl@21:1/5 to Stephen Pelc on Tue Jul 5 15:32:51 2022
    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. And apparently
    that's what's happening. Let's see:

    s\" \x01\z\v\f\t abc" bl scan . c@ .


    Gforth prints 4 32
    iForth 5.1-mini prints 5 9
    lxf prints 4 32
    SwiftForth 3.11 prints 4 32
    vfx64 5.11 prints 5 9

    and following
    standards use of the term "whitespace".

    I'm not sure the standard uses that term. I certainly does not in the
    sentence I cited above.

    - 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: http://www.euroforth.org/ef22/cfp.html

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From dxforth@21:1/5 to Heinrich Hohl on Wed Jul 6 02:03:00 2022
    On 5/07/2022 19:23, Heinrich Hohl wrote:
    ...
    In SwiftForth, SKIP and SCAN work as expected. They will distinguish space and tab.
    Both words are code definitions and written as short as possible with no extra actions.
    This is how it should be.

    I looked at VFX and yes, this is weird. The definitions for SKIP and SCAN are more
    complicated than necessary and contain extra tests for $09 and $20.

    In my eyes this is not a good solution. Treating space and tab as identical characters
    may be convenient at times, but this requirement should be handled differently.

    It appears NT/FORTH has SKIP SCAN (as per F83, SwiftForth etc) and two additional
    ones:

    BL-SKIP ( adr len -- adr' len' )

    BL-SCAN ( adr len -- adr' len' )

    'BL' for these means $20 and below.

    This seems like a good solution. Most forths should be able to get by with one set in the kernel and the other as loadable source for when the need arises. Resource-restrained systems that can only afford one might consider a VFX-style SKIP/SCAN.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From none) (albert@21:1/5 to Anton Ertl on Tue Jul 5 19:09:02 2022
    In article <2022Jul5.173251@mips.complang.tuwien.ac.at>,
    Anton Ertl <anton@mips.complang.tuwien.ac.at> 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. And apparently
    that's what's happening. Let's see:

    s\" \x01\z\v\f\t abc" bl scan . c@ .


    Gforth prints 4 32
    iForth 5.1-mini prints 5 9
    lxf prints 4 32
    SwiftForth 3.11 prints 4 32
    vfx64 5.11 prints 5 9

    and following
    standards use of the term "whitespace".

    I'm not sure the standard uses that term. I certainly does not in the >sentence I cited above.

    I have separated out ?BLANK that decides whether a character is to
    be considered a blank in ciforth.
    This is default:
    : ?BLANK BL 1+ < ;

    [All colon definitions in ciforth can be revectored.]


    - anton


    Groetjes Albert
    --
    "in our communism country Viet Nam, people are forced to be
    alive and in the western country like US, people are free to
    die from Covid 19 lol" duc ha
    albert@spe&ar&c.xs4all.nl &=n http://home.hccnet.nl/a.w.m.van.der.horst

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Marcel Hendrix@21:1/5 to Anton Ertl on Tue Jul 5 09:42:34 2022
    On Tuesday, July 5, 2022 at 5:54:35 PM UTC+2, Anton Ertl wrote:
    Stephen Pelc <ste...@vfxforth.com> writes:
    [..]
    [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. And apparently
    that's what's happening. Let's see:

    s\" \x01\z\v\f\t abc" bl scan . c@ .


    Gforth prints 4 32
    iForth 5.1-mini prints 5 9
    lxf prints 4 32
    SwiftForth 3.11 prints 4 32
    vfx64 5.11 prints 5 9

    FORTH> help scan
    SCAN IFORTH
    ( c-addr1 u1 delimiter -- c-addr2 u2 )
    Scan the string identified by c-addr1 u1 for delimiter. If this
    character is found, leave its address in c-addr2 and the count remaining
    in u2, otherwise c-addr2 points after the string and u2 is 0.
    When the delimiter is not a <tab>, <lf> or <cr>, all three of these
    characters are considered equivalent to a space.
    This means BL SCAN is a special case.
    See also: SKIP

    -marcel

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From dxforth@21:1/5 to Anton Ertl on Wed Jul 6 09:31:53 2022
    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.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From NN@21:1/5 to dxforth on Wed Jul 6 11:26:45 2022
    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

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From NN@21:1/5 to All on Wed Jul 6 11:36:37 2022
    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 )
    r begin eol? 0= while
    rch 2r@ rot searchchar while
    nch repeat
    then 2r> 2drop ;

    ( ---------------------------------------------------------- )
    : scan[] ( a1 u1 a2 u2 -- a3 u3 )
    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

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From minforth@arcor.de@21:1/5 to All on Wed Jul 6 11:47:39 2022
    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 )
    r begin eol? 0= while
    rch 2r@ rot searchchar while
    nch repeat
    then 2r> 2drop ;

    ( ---------------------------------------------------------- )
    : scan[] ( a1 u1 a2 u2 -- a3 u3 )
    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.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From dxforth@21:1/5 to All on Thu Jul 7 11:27:09 2022
    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 ;

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From dxforth@21:1/5 to minf...@arcor.de on Thu Jul 7 12:17:35 2022
    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

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Hans Bezemer@21:1/5 to Marcel Hendrix on Fri Jul 8 08:56:00 2022
    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

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From none) (albert@21:1/5 to the.beez.speaks@gmail.com on Fri Jul 8 21:41:04 2022
    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

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From dxforth@21:1/5 to albert on Sat Jul 9 12:51:19 2022
    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 -

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)