• Parsing a file name with spaces

    From Krishna Myneni@krishna.myneni@ccreweb.org to comp.lang.forth on Tue Mar 24 08:51:28 2026
    From Newsgroup: comp.lang.forth

    Currently, INCLUDE and REQUIRE parse file names which are delimited by a
    space or white space character. These words preclude file names with
    spaces. There are, of course, INCLUDED and REQUIRED which take a string argument from the stack, and, thus, filenames with spaces can be processed.

    However, if a user wants to write a word which can parse file names with spaces, then some type of convention must be used. For example, one can
    define PARSE"

    : parse" [char] " parse ;

    and use it like this,

    parse" A file name with spaces.txt"

    PARSE" seems like a good solution, and is more readable than

    char " parse A file name with spaces.txt"

    or, equivalently in Forth-2012,

    '"' parse A filename with spaces.txt"

    What other methods do Forthers use for file names with spaces?

    --
    Krishna




    --- Synchronet 3.21f-Linux NewsLink 1.2
  • From peter@peter.noreply@tin.it to comp.lang.forth on Tue Mar 24 15:24:02 2026
    From Newsgroup: comp.lang.forth

    On Tue, 24 Mar 2026 08:51:28 -0500
    Krishna Myneni <krishna.myneni@ccreweb.org> wrote:

    Currently, INCLUDE and REQUIRE parse file names which are delimited by a space or white space character. These words preclude file names with
    spaces. There are, of course, INCLUDED and REQUIRED which take a string argument from the stack, and, thus, filenames with spaces can be processed.

    However, if a user wants to write a word which can parse file names with spaces, then some type of convention must be used. For example, one can define PARSE"

    : parse" [char] " parse ;

    and use it like this,

    parse" A file name with spaces.txt"

    PARSE" seems like a good solution, and is more readable than

    char " parse A file name with spaces.txt"

    or, equivalently in Forth-2012,

    '"' parse A filename with spaces.txt"

    What other methods do Forthers use for file names with spaces?

    --
    Krishna

    I have cd for setting the current directory.
    It parses the whole line and uses that. it is defined as

    : CD \ commandline utility cd d:\directory
    source dup >r >in @ /string r> >in ! setcd
    abort" Invalid directory" ;

    setcd ( addr len -- ior) does that actual change

    of course there can be no comments after the directory path!

    BR
    Peter

    --- Synchronet 3.21f-Linux NewsLink 1.2
  • From dxf@dxforth@gmail.com to comp.lang.forth on Wed Mar 25 01:28:58 2026
    From Newsgroup: comp.lang.forth

    On 25/03/2026 12:51 am, Krishna Myneni wrote:
    ...
    What other methods do Forthers use for file names with spaces?

    Don't recall the origin but I had this stashed away.

    : GETFILENAME ( -- c-addr u )
    >in @ char dup rot >in !
    [char] " - if drop bl then word count
    dup 0= abort" filename?" ;

    --- Synchronet 3.21f-Linux NewsLink 1.2
  • From Stephen Pelc@stephen@vfxforth.com to comp.lang.forth on Tue Mar 24 15:55:48 2026
    From Newsgroup: comp.lang.forth

    On 24 Mar 2026 at 14:51:28 CET, "Krishna Myneni" <krishna.myneni@ccreweb.org> wrote:

    Currently, INCLUDE and REQUIRE parse file names which are delimited by a space or white space character. These words preclude file names with
    spaces. There are, of course, INCLUDED and REQUIRED which take a string argument from the stack, and, thus, filenames with spaces can be processed.

    However, if a user wants to write a word which can parse file names with spaces, then some type of convention must be used. For example, one can define PARSE"

    : parse" [char] " parse ;

    and use it like this,

    parse" A file name with spaces.txt"

    PARSE" seems like a good solution, and is more readable than

    char " parse A file name with spaces.txt"

    or, equivalently in Forth-2012,

    '"' parse A filename with spaces.txt"

    What other methods do Forthers use for file names with spaces?

    --
    Krishna

    We see this problem most often when parsing file names. Some operating
    systems allow you to use " as a name separator. We (Wodni&Pelc, ex MPE)
    provide this in VFX Forth.

    : GetPathSpec \ -- c-addr u | c-addr 0 ; 0 if null string
    \ *G Parse the input stream for a file/path name and return
    \ ** the address and length. If the name starts with a '"'
    \ ** character the returned string contains the characters
    \ ** between the first and second '"' characters but does
    \ ** not include the '"' characters themselves. If you need
    \ ** to include names that include '"' characters, delimit
    \ ** the string with '(' and ')'. In all other cases a space
    \ ** is used as the delimiting character. *\fo{GetPathSpec} does
    \ ** not expand text macro names.

    The text is in DocGen format, which VFX uses to generate manuals.

    Stephen
    --
    Stephen Pelc, stephen@vfxforth.com
    Wodni & Pelc GmbH
    Vienna, Austria
    Tel: +44 (0)7803 903612, +34 649 662 974 http://www.vfxforth.com/downloads/VfxCommunity/
    free VFX Forth downloads
    --- Synchronet 3.21f-Linux NewsLink 1.2
  • From anton@anton@mips.complang.tuwien.ac.at (Anton Ertl) to comp.lang.forth on Tue Mar 24 17:58:26 2026
    From Newsgroup: comp.lang.forth

    Krishna Myneni <krishna.myneni@ccreweb.org> writes:
    However, if a user wants to write a word which can parse file names with >spaces, then some type of convention must be used. For example, one can >define PARSE"

    : parse" [char] " parse ;

    The result is very similar to the interpretation semantics of FILE S",
    except that with PARSE" the resulting parsed string is only valid
    while the current line is being parsed, while S" gives you two
    buffers, each with unlimited life time.

    For the problem with embedded quotes or other characters that cannot
    occur in S" strings, there is S\".

    - 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 2025 proceedings: http://www.euroforth.org/ef25/papers/
    --- Synchronet 3.21f-Linux NewsLink 1.2
  • From Krishna Myneni@krishna.myneni@ccreweb.org to comp.lang.forth on Tue Mar 24 13:41:57 2026
    From Newsgroup: comp.lang.forth

    On 3/24/26 12:58 PM, Anton Ertl wrote:
    Krishna Myneni <krishna.myneni@ccreweb.org> writes:
    ...

    : parse" [char] " parse ;

    The result is very similar to the interpretation semantics of FILE S",
    except that with PARSE" the resulting parsed string is only valid
    while the current line is being parsed, while S" gives you two
    buffers, each with unlimited life time.

    For the problem with embedded quotes or other characters that cannot
    occur in S" strings, there is S\".

    Your suggestion is that a better definition of PARSE" would be

    : PARSE" ( "text" -- c-addr u ) ['] s" execute ;

    because the buffer in which the string resides has persistence. What do
    you mean by S" gives you *two* buffers?

    --
    Krishna

    --- Synchronet 3.21f-Linux NewsLink 1.2
  • From anton@anton@mips.complang.tuwien.ac.at (Anton Ertl) to comp.lang.forth on Tue Mar 24 20:40:03 2026
    From Newsgroup: comp.lang.forth

    Krishna Myneni <krishna.myneni@ccreweb.org> writes:
    Your suggestion is that a better definition of PARSE" would be

    : PARSE" ( "text" -- c-addr u ) ['] s" execute ;

    My suggestion is to use S" or S\" instead of PARSE".

    What do
    you mean by S" gives you *two* buffers?

    According to
    <https://forth-standard.org/standard/file#subsection.11.3.4>:
    |[...] there shall be at least two buffers. The system should be able
    |to store two strings defined by sequential use of S" or S\".
    --
    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 2025 proceedings: http://www.euroforth.org/ef25/papers/
    --- Synchronet 3.21f-Linux NewsLink 1.2
  • From Krishna Myneni@krishna.myneni@ccreweb.org to comp.lang.forth on Tue Mar 24 20:26:59 2026
    From Newsgroup: comp.lang.forth

    On 3/24/26 3:40 PM, Anton Ertl wrote:
    ...
    What do
    you mean by S" gives you *two* buffers?

    According to
    <https://forth-standard.org/standard/file#subsection.11.3.4>:
    |[...] there shall be at least two buffers. The system should be able
    |to store two strings defined by sequential use of S" or S\".



    All S" strings are persistent for the life of the session in kForth, so
    I never worry about that.

    --
    KM

    --- Synchronet 3.21f-Linux NewsLink 1.2
  • From albert@albert@spenarnc.xs4all.nl to comp.lang.forth on Wed Mar 25 10:37:34 2026
    From Newsgroup: comp.lang.forth

    In article <10pu4t0$12cqm$1@dont-email.me>,
    Krishna Myneni <krishna.myneni@ccreweb.org> wrote:
    Currently, INCLUDE and REQUIRE parse file names which are delimited by a >space or white space character. These words preclude file names with
    spaces. There are, of course, INCLUDED and REQUIRED which take a string >argument from the stack, and, thus, filenames with spaces can be processed.

    However, if a user wants to write a word which can parse file names with >spaces, then some type of convention must be used. For example, one can >define PARSE"

    : parse" [char] " parse ;

    and use it like this,

    parse" A file name with spaces.txt"

    PARSE" seems like a good solution, and is more readable than

    char " parse A file name with spaces.txt"

    or, equivalently in Forth-2012,

    '"' parse A filename with spaces.txt"

    What other methods do Forthers use for file names with spaces?

    A better solution is to rename files that contains spaces. --------------------------------------------------
    for i in *
    do
    if ( echo "$i" | fgrep ' ' )
    then
    mv "$i" "`echo $i | sed -e s/\ /_/g`"
    fi
    done

    -----------------------------------------------------

    For what it is worth.
    "this is a ""silly filename with spaces and quotes" R/W OPEN-FILE

    at least shows what the file is.


    --
    Krishna

    Groetjes Albert
    --
    The Chinese government is satisfied with its military superiority over USA.
    The next 5 year plan has as primary goal to advance life expectancy
    over 80 years, like Western Europe.
    --- Synchronet 3.21f-Linux NewsLink 1.2
  • From Krishna Myneni@krishna.myneni@ccreweb.org to comp.lang.forth on Wed Mar 25 05:13:39 2026
    From Newsgroup: comp.lang.forth

    On 3/25/26 4:37 AM, albert@spenarnc.xs4all.nl wrote:
    In article <10pu4t0$12cqm$1@dont-email.me>,
    Krishna Myneni <krishna.myneni@ccreweb.org> wrote:
    Currently, INCLUDE and REQUIRE parse file names which are delimited by a
    space or white space character. These words preclude file names with
    spaces. There are, of course, INCLUDED and REQUIRED which take a string
    argument from the stack, and, thus, filenames with spaces can be processed. >>
    However, if a user wants to write a word which can parse file names with
    spaces, then some type of convention must be used. For example, one can
    define PARSE"

    : parse" [char] " parse ;

    and use it like this,

    parse" A file name with spaces.txt"

    PARSE" seems like a good solution, and is more readable than

    char " parse A file name with spaces.txt"

    or, equivalently in Forth-2012,

    '"' parse A filename with spaces.txt"

    What other methods do Forthers use for file names with spaces?

    A better solution is to rename files that contains spaces. --------------------------------------------------
    for i in *
    do
    if ( echo "$i" | fgrep ' ' )
    then
    mv "$i" "`echo $i | sed -e s/\ /_/g`"
    fi
    done

    -----------------------------------------------------

    For what it is worth.
    "this is a ""silly filename with spaces and quotes" R/W OPEN-FILE

    at least shows what the file is.



    Yes, but it doesn't reflect how general users name files today.

    --
    Krishna

    --- Synchronet 3.21f-Linux NewsLink 1.2
  • From dxf@dxforth@gmail.com to comp.lang.forth on Wed Mar 25 21:24:54 2026
    From Newsgroup: comp.lang.forth

    On 25/03/2026 1:28 am, dxf wrote:
    On 25/03/2026 12:51 am, Krishna Myneni wrote:
    ...
    What other methods do Forthers use for file names with spaces?

    Don't recall the origin but I had this stashed away.

    : GETFILENAME ( -- c-addr u )
    >in @ char dup rot >in !
    [char] " - if drop bl then word count
    dup 0= abort" filename?" ;

    Fixes some quirks.

    : GETFILENAME ( -- c-addr u )
    source >in @ /string tuck bl skip negate rot + >in +!
    c@ dup [char] " - if drop bl then word count
    dup 0= abort" filename?" ;

    : t getfilename cr type ;

    t foobar
    foobar ok
    t foobar
    foobar ok
    t "foobar"
    foobar ok
    t "foobar"
    foobar ok
    t "foo bar"
    foo bar ok
    t "foo bar"
    foo bar ok
    t filename?


    --- Synchronet 3.21f-Linux NewsLink 1.2
  • From albert@albert@spenarnc.xs4all.nl to comp.lang.forth on Wed Mar 25 14:57:42 2026
    From Newsgroup: comp.lang.forth

    In article <69c3b7f6$1@news.ausics.net>, dxf <dxforth@gmail.com> wrote:
    On 25/03/2026 1:28 am, dxf wrote:
    On 25/03/2026 12:51 am, Krishna Myneni wrote:
    ...
    What other methods do Forthers use for file names with spaces?

    Don't recall the origin but I had this stashed away.

    : GETFILENAME ( -- c-addr u )
    >in @ char dup rot >in !
    [char] " - if drop bl then word count
    dup 0= abort" filename?" ;

    Fixes some quirks.

    : GETFILENAME ( -- c-addr u )
    source >in @ /string tuck bl skip negate rot + >in +!
    c@ dup [char] " - if drop bl then word count
    dup 0= abort" filename?" ;

    : t getfilename cr type ;

    t foobar
    foobar ok
    t foobar
    foobar ok
    t "foobar"
    foobar ok
    t "foobar"
    foobar ok
    t "foo bar"
    foo bar ok
    t "foo bar"
    foo bar ok
    t filename?



    Not enthusiast about this approach. I use OS-IMPORT.

    The remainder of the line is passed as is to the shell, pretty thoughtless. This guarantees that the behaviour is the same than in $SHELL.

    SEE cat
    "cat" OS-IMPORT cat
    OK
    SEE OS-IMPORT
    : OS-IMPORT CREATE , ,
    DOES> 2@ cmdbuf $! BL cmdbuf $C+ ^J PARSE cmdbuf $+!
    cmdbuf $@ SYSTEM ;
    OK


    In 'lina -t'
    ------------------------------
    ...
    "123456" OK
    "" AAP "" " OK
    PUT-FILE OK
    cat *AAP*
    123456 OK
    ls -l *A* 2>/dev/null
    -rwxr-xr-x 1 albert albert 6 Mar 25 14:41 ' " AAP " '
    -rw-rw-r-- 1 albert albert 17323668 Dec 24 13:49 ADA364024.pdf
    -rw-rw-r-- 1 albert albert 2740 Dec 9 16:20 AvdH-2025-06-08--final.frt -rw-rw-r-- 1 albert albert 2144441 Dec 24 13:26 EFTA00009676.pdf
    -rw-rw-r-- 1 albert albert 1541273 Dec 24 13:32 EFTA00009767.pdf
    -rw-rw-r-- 1 albert albert 88700 Dec 24 13:35 EFTA00009823.pdf
    -rw-rw-r-- 1 albert albert 27771 Jan 27 14:02 MAINLP.ASM
    OK

    I guess you can't do
    OK
    cat *AAP* | od -c
    0000000 1 2 3 4 5 6
    0000006
    OK

    (This is from Forth )

    Groetjes Albert
    --
    The Chinese government is satisfied with its military superiority over USA.
    The next 5 year plan has as primary goal to advance life expectancy
    over 80 years, like Western Europe.
    --- Synchronet 3.21f-Linux NewsLink 1.2
  • From Krishna Myneni@krishna.myneni@ccreweb.org to comp.lang.forth on Wed Mar 25 10:05:36 2026
    From Newsgroup: comp.lang.forth

    On 3/24/26 10:55 AM, Stephen Pelc wrote:
    On 24 Mar 2026 at 14:51:28 CET, "Krishna Myneni" <krishna.myneni@ccreweb.org> wrote:

    Currently, INCLUDE and REQUIRE parse file names which are delimited by a
    space or white space character. These words preclude file names with
    spaces. There are, of course, INCLUDED and REQUIRED which take a string
    argument from the stack, and, thus, filenames with spaces can be processed. >>
    However, if a user wants to write a word which can parse file names with
    spaces, then some type of convention must be used. For example, one can
    define PARSE"

    : parse" [char] " parse ;

    and use it like this,

    parse" A file name with spaces.txt"

    PARSE" seems like a good solution, and is more readable than

    char " parse A file name with spaces.txt"

    or, equivalently in Forth-2012,

    '"' parse A filename with spaces.txt"

    What other methods do Forthers use for file names with spaces?

    --
    Krishna

    We see this problem most often when parsing file names. Some operating systems allow you to use " as a name separator. We (Wodni&Pelc, ex MPE) provide this in VFX Forth.

    : GetPathSpec \ -- c-addr u | c-addr 0 ; 0 if null string
    \ *G Parse the input stream for a file/path name and return
    \ ** the address and length. If the name starts with a '"'
    \ ** character the returned string contains the characters
    \ ** between the first and second '"' characters but does
    \ ** not include the '"' characters themselves. If you need
    \ ** to include names that include '"' characters, delimit
    \ ** the string with '(' and ')'. In all other cases a space
    \ ** is used as the delimiting character. *\fo{GetPathSpec} does
    \ ** not expand text macro names.


    It seems like Forth is overdue for a standard way of being able to parse modern file paths. Perhaps GetPathSpec is the correct approach. It is
    also close to dxforth's approach.

    --
    Krishna

    --- Synchronet 3.21f-Linux NewsLink 1.2
  • From anton@anton@mips.complang.tuwien.ac.at (Anton Ertl) to comp.lang.forth on Wed Mar 25 16:56:17 2026
    From Newsgroup: comp.lang.forth

    Krishna Myneni <krishna.myneni@ccreweb.org> writes:
    It seems like Forth is overdue for a standard way of being able to parse >modern file paths.

    FILE S" has been available since Forth-94, with all filename-handling
    words accepting c-addr u strings.

    For files that include double-quotes and control characters, S\" has
    been available since Forth-2012, with most filename-handling words
    accepting c-addr u strings, and the remaining ones having c-addr u alternatives.

    - 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 2025 proceedings: http://www.euroforth.org/ef25/papers/
    --- Synchronet 3.21f-Linux NewsLink 1.2
  • From Krishna Myneni@krishna.myneni@ccreweb.org to comp.lang.forth on Wed Mar 25 15:22:25 2026
    From Newsgroup: comp.lang.forth

    On 3/25/26 11:56 AM, Anton Ertl wrote:
    Krishna Myneni <krishna.myneni@ccreweb.org> writes:
    It seems like Forth is overdue for a standard way of being able to parse
    modern file paths.

    FILE S" has been available since Forth-94, with all filename-handling
    words accepting c-addr u strings.

    For files that include double-quotes and control characters, S\" has
    been available since Forth-2012, with most filename-handling words
    accepting c-addr u strings, and the remaining ones having c-addr u alternatives.


    A concrete example of a word which parses the filename/filepath from the
    input stream, based on S" or S\" would be helpful to see how it works
    in practice. For example, a word called TAIL which outputs the last 10
    lines of a file, similar to the GNU utility.

    \ From Forth, print the last 10 lines of a file specified by filepath
    \ The filepath should be able to specify a file name with spaces and/or
    \ other allowed special characters.

    tail filepath


    I will have a go at writing it, but feel free to post your solution.

    --
    Krishna



    --- Synchronet 3.21f-Linux NewsLink 1.2
  • From Bigtreeman@treecolin@gmail.com to comp.lang.forth on Thu Mar 26 09:16:59 2026
    From Newsgroup: comp.lang.forth

    Hi,
    Should the file name parsing be respectful to the underlying operating
    system.
    In Linux
    $ ls Vis*
    'VisionFive2 build.sh ' VisionFive2_get.sh
    first file name with two spaces, second with none

    sorry can't do a Windows example (no windows, no gates)

    I think null is a generic delimiter if a buffer was pre-filled with 1'b0

    Go well,
    Colin

    On 25/3/26 19:37, albert@spenarnc.xs4all.nl wrote:
    In article <10pu4t0$12cqm$1@dont-email.me>,
    Krishna Myneni <krishna.myneni@ccreweb.org> wrote:
    Currently, INCLUDE and REQUIRE parse file names which are delimited by a
    space or white space character. These words preclude file names with
    spaces. There are, of course, INCLUDED and REQUIRED which take a string
    argument from the stack, and, thus, filenames with spaces can be processed. >>
    However, if a user wants to write a word which can parse file names with
    spaces, then some type of convention must be used. For example, one can
    define PARSE"

    : parse" [char] " parse ;

    and use it like this,

    parse" A file name with spaces.txt"

    PARSE" seems like a good solution, and is more readable than

    char " parse A file name with spaces.txt"

    or, equivalently in Forth-2012,

    '"' parse A filename with spaces.txt"

    What other methods do Forthers use for file names with spaces?

    A better solution is to rename files that contains spaces. --------------------------------------------------
    for i in *
    do
    if ( echo "$i" | fgrep ' ' )
    then
    mv "$i" "`echo $i | sed -e s/\ /_/g`"
    fi
    done

    -----------------------------------------------------

    For what it is worth.
    "this is a ""silly filename with spaces and quotes" R/W OPEN-FILE

    at least shows what the file is.


    --
    Krishna

    Groetjes Albert
    --
    Go well,
    Colin

    --- Synchronet 3.21f-Linux NewsLink 1.2
  • From Krishna Myneni@krishna.myneni@ccreweb.org to comp.lang.forth on Wed Mar 25 20:57:13 2026
    From Newsgroup: comp.lang.forth

    On 3/25/26 6:16 PM, Bigtreeman wrote:
    Hi,
    Should the file name parsing be respectful to the underlying operating system.
    In Linux
    $ ls Vis*
    'VisionFive2 build.sh '   VisionFive2_get.sh
    first file name with two spaces, second with none

    sorry can't do a Windows example (no windows, no gates)

    I think null is a generic delimiter if a buffer was pre-filled with 1'b0


    Do you mean should the Forth system file name parsing conform to the
    operating system restrictions on file names? If so, yes, I think that
    would be a sensible thing to do.

    --
    Krishna

    --- Synchronet 3.21f-Linux NewsLink 1.2
  • From dxf@dxforth@gmail.com to comp.lang.forth on Sat Mar 28 12:02:53 2026
    From Newsgroup: comp.lang.forth

    On 26/03/2026 7:22 am, Krishna Myneni wrote:
    On 3/25/26 11:56 AM, Anton Ertl wrote:
    Krishna Myneni <krishna.myneni@ccreweb.org> writes:
    It seems like Forth is overdue for a standard way of being able to parse >>> modern file paths.

    FILE S" has been available since Forth-94, with all filename-handling
    words accepting c-addr u strings.

    For files that include double-quotes and control characters, S\" has
    been available since Forth-2012, with most filename-handling words
    accepting c-addr u strings, and the remaining ones having c-addr u
    alternatives.


    A concrete example of a word which parses the filename/filepath from the input stream, based on S" or S\"  would be helpful to see how it works in practice. For example, a word called TAIL which outputs the last 10 lines of a file, similar to the GNU utility.

    \ From Forth, print the last 10 lines of a file specified by filepath
    \ The filepath should be able to specify a file name with spaces and/or
    \ other allowed special characters.

    tail filepath


    I will have a go at writing it, but feel free to post your solution.

    A filename parser based on S\" is hardly practical. Who outside of forth
    would consider that :)

    --- Synchronet 3.21f-Linux NewsLink 1.2
  • From albert@albert@spenarnc.xs4all.nl to comp.lang.forth on Sat Mar 28 08:54:00 2026
    From Newsgroup: comp.lang.forth

    In article <69c728bb$1@news.ausics.net>, dxf <dxforth@gmail.com> wrote:
    On 26/03/2026 7:22 am, Krishna Myneni wrote:
    On 3/25/26 11:56 AM, Anton Ertl wrote:
    Krishna Myneni <krishna.myneni@ccreweb.org> writes:
    It seems like Forth is overdue for a standard way of being able to parse >>>> modern file paths.

    FILE S" has been available since Forth-94, with all filename-handling
    words accepting c-addr u strings.

    For files that include double-quotes and control characters, S\" has
    been available since Forth-2012, with most filename-handling words
    accepting c-addr u strings, and the remaining ones having c-addr u
    alternatives.


    A concrete example of a word which parses the filename/filepath from the input stream, based on S" or S\"  would be helpful to see how it works in practice. For example, a word called TAIL which outputs the last 10 lines of a file, similar to the GNU utility.

    \ From Forth, print the last 10 lines of a file specified by filepath
    \ The filepath should be able to specify a file name with spaces and/or
    \ other allowed special characters.

    tail filepath


    I will have a go at writing it, but feel free to post your solution.

    A filename parser based on S\" is hardly practical. Who outside of forth >would consider that :)


    I don't see that your tool can handle a file with leading spaces
    /tmp: ls -l *b
    -rw-rw-r-- 1 albert albert 27 Mar 28 08:48 ' a b'
    -rw-rw-r-- 1 albert albert 36 Mar 28 08:46 'a b'
    -rw-rw-r-- 1 albert albert 355328 Nov 29 12:33 forth.lab
    -rw-r--r-- 1 albert albert 136583 Jan 28 12:03 fw_dynamic.itb
    /tmp: lina

    AMDX86 ciforth 5.5.1
    " a b" GET-FILE TYPE
    jdskljdsldjs
    ds
    s
    s
    s
    s
    s

    OK
    BYE
    --
    The Chinese government is satisfied with its military superiority over USA.
    The next 5 year plan has as primary goal to advance life expectancy
    over 80 years, like Western Europe.
    --- Synchronet 3.21f-Linux NewsLink 1.2
  • From dxf@dxforth@gmail.com to comp.lang.forth on Sat Mar 28 19:37:46 2026
    From Newsgroup: comp.lang.forth

    On 28/03/2026 6:54 pm, albert@spenarnc.xs4all.nl wrote:
    In article <69c728bb$1@news.ausics.net>, dxf <dxforth@gmail.com> wrote:
    On 26/03/2026 7:22 am, Krishna Myneni wrote:
    On 3/25/26 11:56 AM, Anton Ertl wrote:
    Krishna Myneni <krishna.myneni@ccreweb.org> writes:
    It seems like Forth is overdue for a standard way of being able to parse >>>>> modern file paths.

    FILE S" has been available since Forth-94, with all filename-handling
    words accepting c-addr u strings.

    For files that include double-quotes and control characters, S\" has
    been available since Forth-2012, with most filename-handling words
    accepting c-addr u strings, and the remaining ones having c-addr u
    alternatives.


    A concrete example of a word which parses the filename/filepath from the input stream, based on S" or S\"  would be helpful to see how it works in practice. For example, a word called TAIL which outputs the last 10 lines of a file, similar to the GNU utility.

    \ From Forth, print the last 10 lines of a file specified by filepath
    \ The filepath should be able to specify a file name with spaces and/or
    \ other allowed special characters.

    tail filepath


    I will have a go at writing it, but feel free to post your solution.

    A filename parser based on S\" is hardly practical. Who outside of forth
    would consider that :)


    I don't see that your tool can handle a file with leading spaces
    /tmp: ls -l *b
    -rw-rw-r-- 1 albert albert 27 Mar 28 08:48 ' a b'
    -rw-rw-r-- 1 albert albert 36 Mar 28 08:46 'a b'
    -rw-rw-r-- 1 albert albert 355328 Nov 29 12:33 forth.lab
    -rw-r--r-- 1 albert albert 136583 Jan 28 12:03 fw_dynamic.itb
    /tmp: lina

    AMDX86 ciforth 5.5.1
    " a b" GET-FILE TYPE
    jdskljdsldjs
    ds
    s
    s
    s
    s
    s

    OK
    BYE

    My tool is GETFILENAME which handles " or BL delimited.

    --- Synchronet 3.21f-Linux NewsLink 1.2
  • From sjack@sjack@dontemail.me (sjack) to comp.lang.forth on Sat Mar 28 15:10:56 2026
    From Newsgroup: comp.lang.forth

    dxf <dxforth@gmail.com> wrote:

    My tool is GETFILENAME which handles " or BL delimited.


    Using SYS and /SYS
    SYS ls pad/systst

    SYS touch pad/systst/' foo bar '

    SYS ls pad/systst
    ' foo bar '

    s( (echo;ls pad/systst/' foo bar '|sed -e 's/foo bar/foo_bar/' -e 's/ //')) /SYS
    pad/systst/foo_bar
    --
    me
    --- Synchronet 3.21f-Linux NewsLink 1.2
  • From anton@anton@mips.complang.tuwien.ac.at (Anton Ertl) to comp.lang.forth on Sat Mar 28 18:59:01 2026
    From Newsgroup: comp.lang.forth

    Krishna Myneni <krishna.myneni@ccreweb.org> writes:
    On 3/25/26 11:56 AM, Anton Ertl wrote:
    FILE S" has been available since Forth-94, with all filename-handling
    words accepting c-addr u strings.

    For files that include double-quotes and control characters, S\" has
    been available since Forth-2012, with most filename-handling words
    accepting c-addr u strings, and the remaining ones having c-addr u
    alternatives.


    A concrete example of a word which parses the filename/filepath from the >input stream, based on S" or S\" would be helpful to see how it works
    in practice. For example, a word called TAIL which outputs the last 10
    lines of a file, similar to the GNU utility.

    My idea is that you define the word TAIL not as parsing word, but as a
    word taking a c-addr u string. Then the user can decide whether to
    use

    s" a filename with spaces" tail

    or

    s\" a filename\twith a special character" tail

    or use the string recognizer in Gforth

    "a filename\twith a special character" tail

    And the user can select whether to use S" or S\" depending on the
    filename.

    If you insist on a parsing word, then in order to cover all possible
    file names, you should base your parsing word on S\", and the usage
    would be

    tail\" a filename\twith a special character"

    The definition might be:

    : tail\" ['] s\" execute tail ;

    As discussed, a parsing word that takes the rest of the line as
    string-name argument has a certain cuteness:

    tail$ a filename with spaces

    but has the disadvantages that you cannot put comments on the same
    line, that trailing spaces are invisible, and that you cannot use
    special characters (tab may be ok, but is still problematic, because
    you usually do not see whether it is a tab or a series of spaces).
    The implementation of TAIL$ would be:

    : tail$ 0 parse tail ;

    - 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 2025 proceedings: http://www.euroforth.org/ef25/papers/
    --- Synchronet 3.21f-Linux NewsLink 1.2
  • From anton@anton@mips.complang.tuwien.ac.at (Anton Ertl) to comp.lang.forth on Sat Mar 28 19:14:29 2026
    From Newsgroup: comp.lang.forth

    Bigtreeman <treecolin@gmail.com> writes:
    Hi,
    Should the file name parsing be respectful to the underlying operating >system.

    For use in a portable program, no. It would be really nasty if the
    parsing behaviour of a given program worked one way on one OS, and
    differently on another. I also don't see how OS differences would
    make a differences in the parsing.

    The interpretation of filenames is a different issue, and OS and
    (probably OS-based) mentality differences have led to lack of common
    practice when dealing with relative filenames (including iForth not
    working for relative filenames at all, which has led me to exclude
    iForth from my tests in most cases where files are involved).

    - 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 2025 proceedings: http://www.euroforth.org/ef25/papers/
    --- Synchronet 3.21f-Linux NewsLink 1.2
  • From dxf@dxforth@gmail.com to comp.lang.forth on Sun Mar 29 11:11:52 2026
    From Newsgroup: comp.lang.forth

    On 29/03/2026 5:59 am, Anton Ertl wrote:
    ...
    If you insist on a parsing word, then in order to cover all possible
    file names, you should base your parsing word on S\", and the usage
    would be

    tail\" a filename\twith a special character"

    The definition might be:

    : tail\" ['] s\" execute tail ;

    As discussed, a parsing word that takes the rest of the line as
    string-name argument has a certain cuteness:

    tail$ a filename with spaces

    Many forths have INCLUDE and similar that parse filespecs. Why can't
    they be based on GETFILENAME or equivalent? Apparently VFX offers ( )
    as an additional delimiter. None of this was my idea. I spotted it
    years ago. Where I no longer recall but it caught my attention despite
    having no immediate application in the OS I was using.

    but has the disadvantages that you cannot put comments on the same
    line, that trailing spaces are invisible, and that you cannot use
    special characters (tab may be ok, but is still problematic, because
    you usually do not see whether it is a tab or a series of spaces).
    ...

    Why wouldn't a filespec delimited by " or BL allow comments? Who sensibly
    puts control characters in a filespec? Were one forced to deal with
    someone who foolishly did, as you say there's S\" to save the day but I
    expect it to be exceptional and can be handled if/when the need arises.

    --- Synchronet 3.21f-Linux NewsLink 1.2
  • From Bigtreeman@treecolin@gmail.com to comp.lang.forth on Sun Mar 29 12:22:09 2026
    From Newsgroup: comp.lang.forth

    On 29/3/26 05:14, Anton Ertl wrote:
    Bigtreeman <treecolin@gmail.com> writes:
    Hi,
    Should the file name parsing be respectful to the underlying operating
    system.

    For use in a portable program, no. It would be really nasty if the
    parsing behaviour of a given program worked one way on one OS, and differently on another. I also don't see how OS differences would
    make a differences in the parsing.

    The interpretation of filenames is a different issue, and OS and
    (probably OS-based) mentality differences have led to lack of common
    practice when dealing with relative filenames (including iForth not
    working for relative filenames at all, which has led me to exclude
    iForth from my tests in most cases where files are involved).

    - anton

    Some code I've read hard codes 20h as the delimiter

    Initially parse with a space delimiter

    variable delim
    32 delim !
    : isdelimiter delim @ = ;
    : isnotdelimiter delim @ <> ;

    if first character, isnotdelimiter is ' 39, delimiter becomes 39

    39 delim !

    I'm happy with the Linux method of using ' as a delimiter for a filename
    with spaces, but it's not going to work for everyone ?

    Windows? does ' work ?
    --
    Go well,
    Colin

    --- Synchronet 3.21f-Linux NewsLink 1.2
  • From Paul Rubin@no.email@nospam.invalid to comp.lang.forth on Sat Mar 28 20:55:00 2026
    From Newsgroup: comp.lang.forth

    Bigtreeman <treecolin@gmail.com> writes:
    I'm happy with the Linux method of using ' as a delimiter for a
    filename with spaces, but it's not going to work for everyone ?

    I'm having trouble understanding what's wrong with S" filename with spaces"
    for the usual case. S"\ helps with some slightly more difficult ones,
    but it's gforth-specific and still might not be that great with control characters and whatnot.

    Worst case: HERE DUP 'f' C, 'i' C, ... HERE SWAP - ( a u )
    --- Synchronet 3.21f-Linux NewsLink 1.2
  • From Bigtreeman@treecolin@gmail.com to comp.lang.forth on Sun Mar 29 17:00:23 2026
    From Newsgroup: comp.lang.forth



    On 29/3/26 13:55, Paul Rubin wrote:
    Bigtreeman <treecolin@gmail.com> writes:
    I'm happy with the Linux method of using ' as a delimiter for a
    filename with spaces, but it's not going to work for everyone ?

    I'm having trouble understanding what's wrong with S" filename with spaces" for the usual case. S"\ helps with some slightly more difficult ones,
    but it's gforth-specific and still might not be that great with control characters and whatnot.

    Worst case: HERE DUP 'f' C, 'i' C, ... HERE SWAP - ( a u )

    sorry ' (as used in Linux) clashes with tick i.e. ' word execute
    --
    Go well,
    Colin

    --- Synchronet 3.21f-Linux NewsLink 1.2
  • From anton@anton@mips.complang.tuwien.ac.at (Anton Ertl) to comp.lang.forth on Sun Mar 29 09:24:38 2026
    From Newsgroup: comp.lang.forth

    dxf <dxforth@gmail.com> writes:
    Many forths have INCLUDE and similar that parse filespecs. Why can't
    they be based on GETFILENAME or equivalent?

    I don't know and I don't care what GETFILENAME does. The
    specification for INCLUDE is clear:

    |Skip leading white space and parse name delimited by a white space
    |character.

    Why wouldn't a filespec delimited by " or BL allow comments?

    Who said it wouldn't?

    Who sensibly
    puts control characters in a filespec?

    Who sensibly puts white space in a file name? I think that for words
    that parse file names, the usual Forth way (e.g., INCLUDE) of parsing white-space-delimited file names is fine, and for the senseless cases,
    there is INCLUDED and S" or S\".

    Were one forced to deal with
    someone who foolishly did, as you say there's S\" to save the day but I >expect it to be exceptional and can be handled if/when the need arises.

    Exactly.

    - 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 2025 proceedings: http://www.euroforth.org/ef25/papers/
    --- Synchronet 3.21f-Linux NewsLink 1.2
  • From anton@anton@mips.complang.tuwien.ac.at (Anton Ertl) to comp.lang.forth on Sun Mar 29 09:32:01 2026
    From Newsgroup: comp.lang.forth

    Bigtreeman <treecolin@gmail.com> writes:
    I'm happy with the Linux method of using ' as a delimiter for a filename >with spaces, but it's not going to work for everyone ?

    I think you mean the Unix shell ways of providing arguments to
    programs and shell commands, including arguments that contain spaces
    or other characters that usually are treated as meta-characters in the
    shell (e.g., the semicolon). These ways all have some drawbacks that
    tend to appear in more advanced shell usage.

    In Unix, including Linux, file names (in system calls) can contain any character except NUL (because that is used for terminating file names)
    and / (because that is used for separating file names in file paths).
    The shells only support a subset conveniently (in particular, no
    white space), and the rest through extra syntax with various drawbacks.

    Forth is similar in that respect:

    We can have

    include sane-name.4th

    or

    s" insane name.4th" included

    or

    s\" totally\nbonkers\nname.4th" included

    And when we try to put such things into strings (which happens much
    less often in Forth code than in shell scripts), the disadvantages of
    the less-than-sane file names become even more visible:

    s" include sane-name.4th" evaluate
    s\" s\" insane name.4th\" included" evaluate
    s\" s\\\" totally\\nbonkers\\nname.4th\"" included

    - 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 2025 proceedings: http://www.euroforth.org/ef25/papers/
    --- Synchronet 3.21f-Linux NewsLink 1.2
  • From anton@anton@mips.complang.tuwien.ac.at (Anton Ertl) to comp.lang.forth on Sun Mar 29 09:52:33 2026
    From Newsgroup: comp.lang.forth

    Paul Rubin <no.email@nospam.invalid> writes:
    I'm having trouble understanding what's wrong with S" filename with spaces" >for the usual case. S"\ helps with some slightly more difficult ones,
    but it's gforth-specific

    S\" is in Forth-2012 and widely supported by Forth systems (Gforth,
    iForth, lxf, SwiftForth, VFX all have it).

    S"\ is not in Gforth, and therefore not Gforth-specific.

    - 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 2025 proceedings: http://www.euroforth.org/ef25/papers/
    --- Synchronet 3.21f-Linux NewsLink 1.2
  • From albert@albert@spenarnc.xs4all.nl to comp.lang.forth on Sun Mar 29 13:03:42 2026
    From Newsgroup: comp.lang.forth

    In article <2026Mar29.112438@mips.complang.tuwien.ac.at>,
    Anton Ertl <anton@mips.complang.tuwien.ac.at> wrote:
    dxf <dxforth@gmail.com> writes:
    Many forths have INCLUDE and similar that parse filespecs. Why can't
    they be based on GETFILENAME or equivalent?

    I don't know and I don't care what GETFILENAME does. The
    specification for INCLUDE is clear:

    |Skip leading white space and parse name delimited by a white space >|character.

    Why wouldn't a filespec delimited by " or BL allow comments?

    Who said it wouldn't?

    Who sensibly
    puts control characters in a filespec?

    Who sensibly puts white space in a file name? I think that for words
    that parse file names, the usual Forth way (e.g., INCLUDE) of parsing >white-space-delimited file names is fine, and for the senseless cases,
    there is INCLUDED and S" or S\".

    Were one forced to deal with
    someone who foolishly did, as you say there's S\" to save the day but I >>expect it to be exceptional and can be handled if/when the need arises.

    Exactly.

    Then there are dvd with chinese documentation.
    In order to get the file-name you can only use
    addr n
    and for the content of the buffer all bets are off.

    Groetjes Albert

    INCLUDE was introduced after INCLUDED.
    I consider it a user convenience like .S and FORGET.
    To be used in development, avoid it in real programs.

    - 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 2025 proceedings: http://www.euroforth.org/ef25/papers/
    --
    The Chinese government is satisfied with its military superiority over USA.
    The next 5 year plan has as primary goal to advance life expectancy
    over 80 years, like Western Europe.
    --- Synchronet 3.21f-Linux NewsLink 1.2
  • From dxf@dxforth@gmail.com to comp.lang.forth on Sun Mar 29 22:07:44 2026
    From Newsgroup: comp.lang.forth

    On 29/03/2026 8:24 pm, Anton Ertl wrote:
    dxf <dxforth@gmail.com> writes:
    Many forths have INCLUDE and similar that parse filespecs. Why can't
    they be based on GETFILENAME or equivalent?

    I don't know and I don't care what GETFILENAME does. The
    specification for INCLUDE is clear:

    |Skip leading white space and parse name delimited by a white space |character.

    Are you saying Gforth's INCLUDE is limited to that? Bernd had a solution
    in 2001:

    https://groups.google.com/g/comp.lang.forth/c/DIUoVsCq5Os/m/wYSJ_KuioRkJ

    Why wouldn't a filespec delimited by " or BL allow comments?

    Who said it wouldn't?

    Just checking.

    Who sensibly
    puts control characters in a filespec?

    Who sensibly puts white space in a file name?

    Like it or not such is the reality on today's major desktop systems.
    Serious forths for them have made an effort to meet that challenge.

    I think that for words
    that parse file names, the usual Forth way (e.g., INCLUDE) of parsing white-space-delimited file names is fine, and for the senseless cases,
    there is INCLUDED and S" or S\".

    Were one forced to deal with
    someone who foolishly did, as you say there's S\" to save the day but I
    expect it to be exceptional and can be handled if/when the need arises.

    Exactly.

    I wouldn't tolerate an INCLUDE that didn't handle likely cases.

    --- Synchronet 3.21f-Linux NewsLink 1.2
  • From Hans Bezemer@the.beez.speaks@gmail.com to comp.lang.forth on Sun Mar 29 13:22:28 2026
    From Newsgroup: comp.lang.forth

    On 24-03-2026 14:51, Krishna Myneni wrote:
    Currently, INCLUDE and REQUIRE parse file names which are delimited by a space or white space character. These words preclude file names with
    spaces. There are, of course, INCLUDED and REQUIRED which take a string argument from the stack, and, thus, filenames with spaces can be processed.

    However, if a user wants to write a word which can parse file names with spaces, then some type of convention must be used. For example, one can define PARSE"

    : parse" [char] " parse ;

    and use it like this,

    parse" A file name with spaces.txt"

    PARSE" seems like a good solution, and is more readable than

    char " parse A file name with spaces.txt"

    or, equivalently in Forth-2012,

    '"' parse A filename with spaces.txt"

    What other methods do Forthers use for file names with spaces?

    --
    Krishna





    Since including files is what the compiler does, 4tH has always had the
    [NEEDS word, that takes "]" as a delimiter. So, files with spaces have
    never been an issue in 4tH.

    For compatibility reasons, INCLUDE has been added. Since string
    constants only work in 4tH when interpreting (when the whole inclusion
    thingy has essentially been terminated), it was never supported in 4tH.

    So - if you REALLY want to embrace the bad habit of including spaces in
    your files, you can use [NEEDS. If not, you can use include.

    If you happen to fancy filenames with both closing square brackets as
    well as spaces, you need to get your head examined and refrain from
    walking among the general public without supervision.

    Hans Bezemer
    --- Synchronet 3.21f-Linux NewsLink 1.2
  • From anton@anton@mips.complang.tuwien.ac.at (Anton Ertl) to comp.lang.forth on Sun Mar 29 16:08:18 2026
    From Newsgroup: comp.lang.forth

    dxf <dxforth@gmail.com> writes:
    On 29/03/2026 8:24 pm, Anton Ertl wrote:
    I don't know and I don't care what GETFILENAME does. The
    specification for INCLUDE is clear:

    |Skip leading white space and parse name delimited by a white space
    |character.

    Are you saying Gforth's INCLUDE is limited to that?

    Gforth implements the standard INCLUDE

    Bernd had a solution
    in 2001:

    https://groups.google.com/g/comp.lang.forth/c/DIUoVsCq5Os/m/wYSJ_KuioRkJ

    The relevant posting by Bernd Paysan has the google link https://groups.google.com/g/comp.lang.forth/c/DIUoVsCq5Os/m/Zddh2mo0sv4J

    |That problem was one of the earlier complaints about the bigFORTH for
    |Windows port. I added into all file name parsing words (path, cd, use) a
    |test for the first character of the file name. If it's either " or ', it
    |will redo the parsing with parse of that character. I.e. you can
    |
    |cd 'foo bar'
    |
    |or
    |
    |use "steve's file.fs"

    I.e., he added this feature to words that were non-standard then and
    are non-standard now. He did not mention INCLUDE.

    And concerning USE, his latest implementation is:

    git blame blocks.fs #output redacted to fit in 80-char lines
    (Anton Ertl 1996-09-30) : use ( "file" -- ) \ gforth
    (Anton Ertl 2025-12-23) \g Open @i{file} as the current blocks file. (Bernd Paysan 2023-07-04) parse-name name-too-short? open-blocks ;

    Who sensibly
    puts control characters in a filespec?

    Who sensibly puts white space in a file name?

    Like it or not such is the reality on today's major desktop systems.

    As are all other kinds of file names supported by the file system.

    That does not mean one has to jump through extra hoops and complicate
    other uses to accomodate such files.

    I wouldn't tolerate an INCLUDE that didn't handle likely cases.

    The RfD/CfV that proposed INCLUDE for standardization <http://www.forth200x.org/required.html> was last changed in
    2006-02-12 and accepted for standardization in the 2006 Forth200x
    meeting (2006-09-14..15). The CfV happened sometimes between these
    two dates.

    Looking at the discussion in the proposal, it seems that nobody
    brought up the issue of file names containing white space, except a
    mention that 4th has a word [NEEDS used like "[NEEDS file name]".

    I think it's unlikely that a Forth programmer includes white space in
    the name of a file he wants to INCLUDE, and that's the reason why
    nobody brought it up at the time. Anyway, let's test the
    standard-compliance of a few Forth systems:

    In the shell:

    echo '.( foo) cr' >'"foo.4th'

    In the Forth system:

    cr include "foo.4th .( bar) cr

    Expected output:

    foo
    bar

    Gforth behaves as expected.

    iForth 5.1 mini says:

    No such file or directory `foo.4th .( bar) '
    Error -37
    can't open ?

    lxf behaves as expected

    SwiftForth reports

    File not found

    Looking at it with strace, I find that it tries to stat 'foo.4th .( bar)'
    and fails.

    When I try it with 'cr include "foo.4th', it tries to stat 'foo.4th'
    and fails.

    VFX64 reports:

    Including foo.4th .( bar)
    Err# -258 ERR: Failed to open requested file.
    cr include "foo.4th .( bar)
    ^

    - 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 2025 proceedings: http://www.euroforth.org/ef25/papers/
    --- Synchronet 3.21f-Linux NewsLink 1.2
  • From dxf@dxforth@gmail.com to comp.lang.forth on Mon Mar 30 09:34:39 2026
    From Newsgroup: comp.lang.forth

    On 30/03/2026 3:08 am, Anton Ertl wrote:
    dxf <dxforth@gmail.com> writes:
    On 29/03/2026 8:24 pm, Anton Ertl wrote:
    I don't know and I don't care what GETFILENAME does. The
    specification for INCLUDE is clear:

    |Skip leading white space and parse name delimited by a white space
    |character.

    Are you saying Gforth's INCLUDE is limited to that?

    Gforth implements the standard INCLUDE

    Christians cite Leviticus 20. What's your point?

    --- Synchronet 3.21f-Linux NewsLink 1.2
  • From Paul Rubin@no.email@nospam.invalid to comp.lang.forth on Sun Mar 29 19:05:14 2026
    From Newsgroup: comp.lang.forth

    Bigtreeman <treecolin@gmail.com> writes:
    sorry ' (as used in Linux) clashes with tick i.e. ' word execute

    ' is a word in its own right, i.e. it's only recognized as a word if
    followed by a space. Gforth 0.7.3:
    'a' . 97 ok
    --- Synchronet 3.21f-Linux NewsLink 1.2
  • From Bigtreeman@treecolin@gmail.com to comp.lang.forth on Mon Mar 30 21:58:28 2026
    From Newsgroup: comp.lang.forth



    On 30/3/26 12:05, Paul Rubin wrote:
    Bigtreeman <treecolin@gmail.com> writes:
    sorry ' (as used in Linux) clashes with tick i.e. ' word execute

    ' is a word in its own right, i.e. it's only recognized as a word if
    followed by a space. Gforth 0.7.3:
    'a' . 97 ok
    If the delimiter is changed to ' it won't recognise the following space
    as a delimiter
    I've dropped this approach
    --
    Go well,
    Colin

    --- Synchronet 3.21f-Linux NewsLink 1.2
  • From Bigtreeman@treecolin@gmail.com to comp.lang.forth on Mon Mar 30 22:10:33 2026
    From Newsgroup: comp.lang.forth



    On 29/3/26 19:32, Anton Ertl wrote:
    Bigtreeman <treecolin@gmail.com> writes:
    I'm happy with the Linux method of using ' as a delimiter for a filename
    with spaces, but it's not going to work for everyone ?

    I think you mean the Unix shell ways of providing arguments to
    programs and shell commands, including arguments that contain spaces
    or other characters that usually are treated as meta-characters in the
    shell (e.g., the semicolon). These ways all have some drawbacks that
    tend to appear in more advanced shell usage.

    In Unix, including Linux, file names (in system calls) can contain any character except NUL (because that is used for terminating file names)
    and / (because that is used for separating file names in file paths).
    The shells only support a subset conveniently (in particular, no
    white space), and the rest through extra syntax with various drawbacks.

    Forth is similar in that respect:

    We can have

    include sane-name.4th

    or

    s" insane name.4th" included

    or

    s\" totally\nbonkers\nname.4th" included

    And when we try to put such things into strings (which happens much
    less often in Forth code than in shell scripts), the disadvantages of
    the less-than-sane file names become even more visible:

    s" include sane-name.4th" evaluate
    s\" s\" insane name.4th\" included" evaluate
    s\" s\\\" totally\\nbonkers\\nname.4th\"" included

    - anton
    ok, so forth_sane would be no spaces or using underscores, etc,
    seeming like an easier convention, k.i.s.
    --
    Go well,
    Colin

    --- Synchronet 3.21f-Linux NewsLink 1.2
  • From dxf@dxforth@gmail.com to comp.lang.forth on Tue Mar 31 09:18:43 2026
    From Newsgroup: comp.lang.forth

    On 30/03/2026 9:34 am, dxf wrote:
    On 30/03/2026 3:08 am, Anton Ertl wrote:
    dxf <dxforth@gmail.com> writes:
    On 29/03/2026 8:24 pm, Anton Ertl wrote:
    I don't know and I don't care what GETFILENAME does. The
    specification for INCLUDE is clear:

    |Skip leading white space and parse name delimited by a white space
    |character.

    Are you saying Gforth's INCLUDE is limited to that?

    Gforth implements the standard INCLUDE

    Christians cite Leviticus 20. What's your point?

    LMAO. Woke up to discover Forth Inc has reverted to the standard's
    INCLUDE of 2006. It's worth repeating what they said in late 2006:

    SwiftForth 3.0.5 (22-Nov-2006)

    Changed the FILENAME parsing used by INCLUDE. Instead of repeatedly
    parsing for a space character and checking for file existence (which
    causes problems with file/directory name ambiguity), INCLUDE now uses
    the more standard technique of allowing optional double-quote delimited
    path names. The quotes are only required when the path name contains a
    space. In all other cases, this change has no impact.

    30 years after the world was introduced to filenames with spaces, forth
    does a taliban in favour of one that no longer exists.

    --- Synchronet 3.21f-Linux NewsLink 1.2
  • From Krishna Myneni@krishna.myneni@ccreweb.org to comp.lang.forth on Mon Mar 30 20:41:15 2026
    From Newsgroup: comp.lang.forth

    On 3/30/26 5:18 PM, dxf wrote:
    On 30/03/2026 9:34 am, dxf wrote:
    On 30/03/2026 3:08 am, Anton Ertl wrote:
    dxf <dxforth@gmail.com> writes:
    On 29/03/2026 8:24 pm, Anton Ertl wrote:
    I don't know and I don't care what GETFILENAME does. The
    specification for INCLUDE is clear:

    |Skip leading white space and parse name delimited by a white space
    |character.

    Are you saying Gforth's INCLUDE is limited to that?

    Gforth implements the standard INCLUDE

    Christians cite Leviticus 20. What's your point?

    LMAO. Woke up to discover Forth Inc has reverted to the standard's
    INCLUDE of 2006. It's worth repeating what they said in late 2006:

    SwiftForth 3.0.5 (22-Nov-2006)

    Changed the FILENAME parsing used by INCLUDE. Instead of repeatedly
    parsing for a space character and checking for file existence (which
    causes problems with file/directory name ambiguity), INCLUDE now uses
    the more standard technique of allowing optional double-quote delimited
    path names. The quotes are only required when the path name contains a
    space. In all other cases, this change has no impact.

    30 years after the world was introduced to filenames with spaces, forth
    does a taliban in favour of one that no longer exists.


    INCLUDE per the Forth-2012 standard is inadequate for modern desktop
    systems, which was the starting point of this thread.

    While changing the long-standing behavior of INCLUDE is not a good idea,
    using a consistent method for parsing file names in use currently is
    needed. It doesn't matter whether or not one thinks such names are
    insane. Such names are a reality we have to address.

    --
    Krishna

    --- Synchronet 3.21f-Linux NewsLink 1.2
  • From dxf@dxforth@gmail.com to comp.lang.forth on Tue Mar 31 14:14:49 2026
    From Newsgroup: comp.lang.forth

    On 31/03/2026 12:41 pm, Krishna Myneni wrote:
    ...
    INCLUDE per the Forth-2012 standard is inadequate for modern desktop systems, which was the starting point of this thread.

    While changing the long-standing behavior of INCLUDE is not a good idea, using a consistent method for parsing file names in use currently is needed. It doesn't matter whether or not one thinks such names are insane. Such names are a reality we have to address.

    Some behaviours were never properly formulated. AFAIK no explicit rationale was ever given for INCLUDE vs. INCLUDED other than the former already existed in several forths. So I'll present mine.

    When dealing with command-line OS of times past, it was commonplace to enter commands in the form:

    rename oldfilename newfilename

    For convenience I wanted to duplicate this familiar setup in forth - hence the addition of INCLUDE RENAME DELETE etc. Critically these words will be parsing *filenames* which are going to be OS-specific. To limit the scope to filenames that conform to forth's notion of a 'word' completely misses the intent behind these functions. I see no point to having INCLUDE et al if I'm told I can use INCLUDED RENAME-FILE DELETE-FILE etc instead.

    --- Synchronet 3.21f-Linux NewsLink 1.2
  • From anton@anton@mips.complang.tuwien.ac.at (Anton Ertl) to comp.lang.forth on Tue Mar 31 07:36:20 2026
    From Newsgroup: comp.lang.forth

    dxf <dxforth@gmail.com> writes:
    When dealing with command-line OS of times past, it was commonplace to enter >commands in the form:

    rename oldfilename newfilename

    For convenience I wanted to duplicate this familiar setup in forth - hence the >addition of INCLUDE RENAME DELETE etc.

    Gforth and VFX64 provide SH and SwiftForth includes $; these words
    pass the rest of the line to the shell, so you can the use OS
    commands, with the filename given in the syntax of the shell, and use
    the shell syntax for comments. E.g., with Gforth invoking bash with
    Unix commands:

    sh echo test >sane-file-name
    sh mv sane-file-name insane\ file\ name # mv (as in "move") renames
    sh cat "insane file name" # prints "test"
    sh rm 'insane file name' # rm (as in "remove") deletes

    Critically these words will be parsing
    *filenames* which are going to be OS-specific.

    And the cool thing is, with SH all the shell-specific syntax for file
    names works; three different ways of specifying "insane file name" in
    bash were shown in the example above.

    I see no point to having INCLUDE et al if I'm told I can use
    INCLUDED RENAME-FILE DELETE-FILE etc instead.

    No programmer is required to use INCLUDE, and no system is required to implement INCLUDE. INCLUDE is an optional word in the FILE EXT
    extension in Forth-2012. If you see no point, just don't use it and
    don't implement it.

    - 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 2025 proceedings: http://www.euroforth.org/ef25/papers/
    --- Synchronet 3.21f-Linux NewsLink 1.2
  • From anton@anton@mips.complang.tuwien.ac.at (Anton Ertl) to comp.lang.forth on Tue Mar 31 07:54:56 2026
    From Newsgroup: comp.lang.forth

    Krishna Myneni <krishna.myneni@ccreweb.org> writes:
    While changing the long-standing behavior of INCLUDE is not a good idea, >using a consistent method for parsing file names in use currently is
    needed. It doesn't matter whether or not one thinks such names are
    insane. Such names are a reality we have to address.

    File name with just spaces have been addressed by INCLUDED long before
    INCLUDE was standardized in Forth-2012. Forth-2012 also added 'S\"',
    which makes it easier than before to also include file names that
    contain double quotes or special characters.

    - 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 2025 proceedings: http://www.euroforth.org/ef25/papers/
    --- Synchronet 3.21f-Linux NewsLink 1.2
  • From Krishna Myneni@krishna.myneni@ccreweb.org to comp.lang.forth on Tue Mar 31 05:03:39 2026
    From Newsgroup: comp.lang.forth

    On 3/31/26 2:54 AM, Anton Ertl wrote:
    Krishna Myneni <krishna.myneni@ccreweb.org> writes:
    While changing the long-standing behavior of INCLUDE is not a good idea,
    using a consistent method for parsing file names in use currently is
    needed. It doesn't matter whether or not one thinks such names are
    insane. Such names are a reality we have to address.

    File name with just spaces have been addressed by INCLUDED long before INCLUDE was standardized in Forth-2012. ...

    INCLUDED is not a parsing form, which is needed in some use cases.


    Forth-2012 also added 'S\"',
    which makes it easier than before to also include file names that
    contain double quotes or special characters.

    S" and S\" are useful factors for writing a more general file name
    parser e.g. for file names with spaces. Their use implies that the text
    being parsed will be delimited by a double quote.

    It's not clear whether or not S" and S\" will be sufficient for parsing general UTF-8 encoded Unicode file names supporting other languages. I
    use a number of such files on my Linux computer. The present discussion, however, was only about file names with spaces.

    --Krishna


    --- Synchronet 3.21f-Linux NewsLink 1.2
  • From anton@anton@mips.complang.tuwien.ac.at (Anton Ertl) to comp.lang.forth on Tue Mar 31 10:32:37 2026
    From Newsgroup: comp.lang.forth

    Krishna Myneni <krishna.myneni@ccreweb.org> writes:
    INCLUDED is not a parsing form, which is needed in some use cases.

    In which use cases?

    Forth-2012 also added 'S\"',
    which makes it easier than before to also include file names that
    contain double quotes or special characters.

    S" and S\" are useful factors for writing a more general file name
    parser e.g. for file names with spaces.

    They are not particularly well-suited as factors (in git terminology,
    they are not "plumbing", but "porcelain"). For uninterpreted strings
    that are processed right away, as in an INCLUDE" word,

    '"' parse

    is a good factor to use instead of S". For S\", the factor has not
    been standardized; Gforth has \"-parse.

    However, I think it's better to provide words that take strings in
    c-addr u form, and if you want to pass a literal string to them,
    generate it with S" or S\".

    It's not clear whether or not S" and S\" will be sufficient for parsing >general UTF-8 encoded Unicode file names

    According to <https://forth-standard.org/standard/xchar#section.18.1>:

    |All words dealing with strings shall handle xchars when the xchar word
    |set is present. This includes dictionary definitions. White space
    |parsing does not have to treat code points greater than $20 as white
    |space.

    So if the Forth system implements the standard and the xchar wordset
    and uses UTF-8 as xchar, S" and S\" are guarenteed to work for parsing UTF-8-encoded filenames.

    Practically, thanks to the ingenuity of UTF-8, S" and S\" actually
    work for UTF-8 strings on any Forth system that treat bytes with
    values >=128 as plain parts of the string (e.g., like letters). AFAIK
    most Forth systems have that property, even those that do not
    implement the xchar wordset.

    - 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 2025 proceedings: http://www.euroforth.org/ef25/papers/
    --- Synchronet 3.21f-Linux NewsLink 1.2
  • From albert@albert@spenarnc.xs4all.nl to comp.lang.forth on Tue Mar 31 13:41:56 2026
    From Newsgroup: comp.lang.forth

    In article <10qf8nr$2vaat$1@dont-email.me>,
    Krishna Myneni <krishna.myneni@ccreweb.org> wrote:
    On 3/30/26 5:18 PM, dxf wrote:
    On 30/03/2026 9:34 am, dxf wrote:
    On 30/03/2026 3:08 am, Anton Ertl wrote:
    dxf <dxforth@gmail.com> writes:
    On 29/03/2026 8:24 pm, Anton Ertl wrote:
    I don't know and I don't care what GETFILENAME does. The
    specification for INCLUDE is clear:

    |Skip leading white space and parse name delimited by a white space >>>>>> |character.

    Are you saying Gforth's INCLUDE is limited to that?

    Gforth implements the standard INCLUDE

    Christians cite Leviticus 20. What's your point?

    LMAO. Woke up to discover Forth Inc has reverted to the standard's
    INCLUDE of 2006. It's worth repeating what they said in late 2006:

    SwiftForth 3.0.5 (22-Nov-2006)

    Changed the FILENAME parsing used by INCLUDE. Instead of repeatedly
    parsing for a space character and checking for file existence (which
    causes problems with file/directory name ambiguity), INCLUDE now uses
    the more standard technique of allowing optional double-quote delimited >> path names. The quotes are only required when the path name contains a
    space. In all other cases, this change has no impact.

    30 years after the world was introduced to filenames with spaces, forth
    does a taliban in favour of one that no longer exists.


    INCLUDE per the Forth-2012 standard is inadequate for modern desktop
    systems, which was the starting point of this thread.

    No. INCLUDED is the proper way, and once proper string denotation
    is introduced by recognizers e.g. "foor bar.c" there is no reason
    to use INCLUDE apart from an interactive convenience.

    In the time of blocks, nobody had the idea of
    LOAD 13
    instead of
    13 LOAD

    Krishna

    Groetjes Albert
    --
    The Chinese government is satisfied with its military superiority over USA.
    The next 5 year plan has as primary goal to advance life expectancy
    over 80 years, like Western Europe.
    --- Synchronet 3.21f-Linux NewsLink 1.2
  • From albert@albert@spenarnc.xs4all.nl to comp.lang.forth on Tue Mar 31 14:03:10 2026
    From Newsgroup: comp.lang.forth

    In article <2026Mar31.093620@mips.complang.tuwien.ac.at>,
    Anton Ertl <anton@mips.complang.tuwien.ac.at> wrote:
    dxf <dxforth@gmail.com> writes:
    When dealing with command-line OS of times past, it was commonplace to enter >>commands in the form:

    rename oldfilename newfilename

    For convenience I wanted to duplicate this familiar setup in forth - hence the
    addition of INCLUDE RENAME DELETE etc.

    Gforth and VFX64 provide SH and SwiftForth includes $; these words
    pass the rest of the line to the shell, so you can the use OS
    commands, with the filename given in the syntax of the shell, and use
    the shell syntax for comments. E.g., with Gforth invoking bash with
    Unix commands:

    sh echo test >sane-file-name
    sh mv sane-file-name insane\ file\ name # mv (as in "move") renames
    sh cat "insane file name" # prints "test"
    sh rm 'insane file name' # rm (as in "remove") deletes

    Critically these words will be parsing
    *filenames* which are going to be OS-specific.

    And the cool thing is, with SH all the shell-specific syntax for file
    names works; three different ways of specifying "insane file name" in
    bash were shown in the example above.
    This is a sound advantage, it makes no sense to learn two disparate
    ways to escape weird filenames.

    I have used `` !! '' for this functionality, compare similar escapes
    with ! in ftp etc. I admit that `` sh '' is a better name.
    Maybe I'll change it:

    "grep" OS-IMPORT grep
    "" OS-IMPORT sh \ was: "" OS-IMPORT !!

    CREATE cmdbuf 1000 ALLOT
    : OS-IMPORT ( sc "name-forth" -- )
    CREATE , ,
    DOES>
    2@ cmdbuf $! BL cmdbuf $C+ \ Command
    ^J PARSE cmdbuf $+! \ Append
    cmdbuf $@ SYSTEM \ Execute
    ;

    anton
    --
    The Chinese government is satisfied with its military superiority over USA.
    The next 5 year plan has as primary goal to advance life expectancy
    over 80 years, like Western Europe.
    --- Synchronet 3.21f-Linux NewsLink 1.2
  • From Krishna Myneni@krishna.myneni@ccreweb.org to comp.lang.forth on Tue Mar 31 10:18:31 2026
    From Newsgroup: comp.lang.forth

    On 3/31/26 6:41 AM, albert@spenarnc.xs4all.nl wrote:
    In article <10qf8nr$2vaat$1@dont-email.me>,
    ... there is no reason
    to use INCLUDE apart from an interactive convenience.

    And that was my point in my original post. It is still necessary to have
    a file name parsing word for some applications. Standard INCLUDE and
    INCLUDED are not sufficient for that purpose.

    --
    KM

    --- Synchronet 3.21f-Linux NewsLink 1.2
  • From Krishna Myneni@krishna.myneni@ccreweb.org to comp.lang.forth on Tue Mar 31 10:26:56 2026
    From Newsgroup: comp.lang.forth

    On 3/31/26 5:32 AM, Anton Ertl wrote:
    Krishna Myneni <krishna.myneni@ccreweb.org> writes:
    INCLUDED is not a parsing form, which is needed in some use cases.

    In which use cases?


    In cases such as the TAIL example I gave earlier. For those case where
    you want to provide a Forth word to the user in the form

    <wordname> <file1> <file2> ...

    Forth-2012 also added 'S\"',
    which makes it easier than before to also include file names that
    contain double quotes or special characters.

    S" and S\" are useful factors for writing a more general file name
    parser e.g. for file names with spaces.

    They are not particularly well-suited as factors (in git terminology,
    they are not "plumbing", but "porcelain"). For uninterpreted strings
    that are processed right away, as in an INCLUDE" word,

    '"' parse

    is a good factor to use instead of S".

    This was my original approach.
    ...
    It's not clear whether or not S" and S\" will be sufficient for parsing
    general UTF-8 encoded Unicode file names

    According to <https://forth-standard.org/standard/xchar#section.18.1>:

    |All words dealing with strings shall handle xchars when the xchar word
    |set is present. This includes dictionary definitions. White space
    |parsing does not have to treat code points greater than $20 as white
    |space.

    So if the Forth system implements the standard and the xchar wordset
    and uses UTF-8 as xchar, S" and S\" are guarenteed to work for parsing UTF-8-encoded filenames.
    ...

    I had forgotten about this requirement. Good to know.

    --
    KM

    --- Synchronet 3.21f-Linux NewsLink 1.2
  • From albert@albert@spenarnc.xs4all.nl to comp.lang.forth on Wed Apr 1 00:19:49 2026
    From Newsgroup: comp.lang.forth

    In article <10qgp41$3ejgv$2@dont-email.me>,
    Krishna Myneni <krishna.myneni@ccreweb.org> wrote:
    On 3/31/26 5:32 AM, Anton Ertl wrote:
    Krishna Myneni <krishna.myneni@ccreweb.org> writes:
    INCLUDED is not a parsing form, which is needed in some use cases.

    In which use cases?


    In cases such as the TAIL example I gave earlier. For those case where
    you want to provide a Forth word to the user in the form

    <wordname> <file1> <file2> ...
    That is not Forth like. If you go this route you have to provide
    two boxes in a gui where you fill in filenames.

    KM

    Groetjes Albert
    --
    The Chinese government is satisfied with its military superiority over USA.
    The next 5 year plan has as primary goal to advance life expectancy
    over 80 years, like Western Europe.
    --- Synchronet 3.21f-Linux NewsLink 1.2
  • From Krishna Myneni@krishna.myneni@ccreweb.org to comp.lang.forth on Tue Mar 31 18:04:03 2026
    From Newsgroup: comp.lang.forth

    On 3/31/26 5:19 PM, albert@spenarnc.xs4all.nl wrote:
    In article <10qgp41$3ejgv$2@dont-email.me>,
    Krishna Myneni <krishna.myneni@ccreweb.org> wrote:
    On 3/31/26 5:32 AM, Anton Ertl wrote:
    Krishna Myneni <krishna.myneni@ccreweb.org> writes:
    INCLUDED is not a parsing form, which is needed in some use cases.

    In which use cases?


    In cases such as the TAIL example I gave earlier. For those case where
    you want to provide a Forth word to the user in the form

    <wordname> <file1> <file2> ...
    That is not Forth like. If you go this route you have to provide
    two boxes in a gui where you fill in filenames.


    Of course not. Is all the software you write intended to be used only by yourself?

    --
    Krishna
    --- Synchronet 3.21f-Linux NewsLink 1.2
  • From dxf@dxforth@gmail.com to comp.lang.forth on Wed Apr 1 11:28:41 2026
    From Newsgroup: comp.lang.forth

    On 31/03/2026 10:41 pm, albert@spenarnc.xs4all.nl wrote:
    In article <10qf8nr$2vaat$1@dont-email.me>,
    Krishna Myneni <krishna.myneni@ccreweb.org> wrote:
    ...
    INCLUDE per the Forth-2012 standard is inadequate for modern desktop
    systems, which was the starting point of this thread.

    No. INCLUDED is the proper way, and once proper string denotation
    is introduced by recognizers e.g. "foor bar.c" there is no reason
    to use INCLUDE apart from an interactive convenience.

    In the time of blocks, nobody had the idea of
    LOAD 13
    instead of
    13 LOAD

    Given CHAR [CHAR] what reason is there for 'c' ? Some swear for it
    while others at it. For me it wasn't merely redundant, it required
    hacking the forth interpreter to implement.

    With INCLUDE which was added on the basis of 'common practice', it's
    at least based on INCLUDED and therefore relatively easy for a user
    to implement should it not be provided. What I object to are appeals
    to authority which apparently have caused otherwise sane people to do
    insane things.

    "A victory dependent upon authority is unreal and illusory."
    - Bertrand Russell

    --- Synchronet 3.21f-Linux NewsLink 1.2
  • From dxf@dxforth@gmail.com to comp.lang.forth on Wed Apr 1 12:22:39 2026
    From Newsgroup: comp.lang.forth

    On 31/03/2026 6:36 pm, Anton Ertl wrote:
    dxf <dxforth@gmail.com> writes:
    When dealing with command-line OS of times past, it was commonplace to enter >> commands in the form:

    rename oldfilename newfilename

    For convenience I wanted to duplicate this familiar setup in forth - hence the
    addition of INCLUDE RENAME DELETE etc.

    Gforth and VFX64 provide SH and SwiftForth includes $; these words
    pass the rest of the line to the shell, so you can the use OS
    commands, with the filename given in the syntax of the shell, and use
    the shell syntax for comments. E.g., with Gforth invoking bash with
    Unix commands:

    sh echo test >sane-file-name
    sh mv sane-file-name insane\ file\ name # mv (as in "move") renames
    sh cat "insane file name" # prints "test"
    sh rm 'insane file name' # rm (as in "remove") deletes

    It's not a solution under MS-DOS (lots of buffers and code) nor under CP/M where AFAIK shelling is impossible.

    Critically these words will be parsing
    *filenames* which are going to be OS-specific.

    And the cool thing is, with SH all the shell-specific syntax for file
    names works; three different ways of specifying "insane file name" in
    bash were shown in the example above.

    I see no point to having INCLUDE et al if I'm told I can use
    INCLUDED RENAME-FILE DELETE-FILE etc instead.

    No programmer is required to use INCLUDE, and no system is required to implement INCLUDE. INCLUDE is an optional word in the FILE EXT
    extension in Forth-2012. If you see no point, just don't use it and
    don't implement it.

    What is the point - according to you since the standard never explains?

    --- Synchronet 3.21f-Linux NewsLink 1.2
  • From dxf@dxforth@gmail.com to comp.lang.forth on Wed Apr 1 19:13:29 2026
    From Newsgroup: comp.lang.forth

    On 31/03/2026 9:03 pm, Krishna Myneni wrote:
    On 3/31/26 2:54 AM, Anton Ertl wrote:
    Krishna Myneni <krishna.myneni@ccreweb.org> writes:
    While changing the long-standing behavior of INCLUDE is not a good idea, >>> using a consistent method for parsing file names in use currently is
    needed. It doesn't matter whether or not one thinks such names are
    insane. Such names are a reality we have to address.

    File name with just spaces have been addressed by INCLUDED long before
    INCLUDE was standardized in Forth-2012. ...

    INCLUDED is not a parsing form, which is needed in some use cases.
    ...

    FORTH-94 didn't have any words that parsed a filename so it was never an issue. That changed when 200x introduced REQUIRE and INCLUDE. The culprit in their stack comment was the continued use of the token <name>. Properly a new token representing filenames should have been defined and added to 2.2.3 'Parsed-text notation'. This would have covered what forth systems were using in real life.

    --- Synchronet 3.21f-Linux NewsLink 1.2
  • From anton@anton@mips.complang.tuwien.ac.at (Anton Ertl) to comp.lang.forth on Wed Apr 1 07:54:00 2026
    From Newsgroup: comp.lang.forth

    Krishna Myneni <krishna.myneni@ccreweb.org> writes:
    On 3/31/26 5:32 AM, Anton Ertl wrote:
    Krishna Myneni <krishna.myneni@ccreweb.org> writes:
    INCLUDED is not a parsing form, which is needed in some use cases.

    In which use cases?


    In cases such as the TAIL example I gave earlier.

    I doubt that INCLUDE is a factor of TAIL, so how INCLUDE parses its
    file name is independent of how TAIL gets its file name.

    For those case where
    you want to provide a Forth word to the user in the form

    <wordname> <file1> <file2> ...

    Ok, you "want", probably because you think it's more convenient for
    the user, i.e., no technical reason.

    You have the choices:

    1) Pass each file names as c-addr u on the stack. Advantages:

    a) This word can deal with all kinds of file names.

    b) The user can use whatever is appropriate for the file name: S"
    for a file name with only blanks; or S\" for a file name that
    contain " or control characters. The user can use the
    appropriate way for each file name.

    c) The word is more flexible for use as factor in other words.

    2) Write a parsing word that uses PARSE-NAME. Advantages:

    a) Easy to implement.

    b) fits with the usual white-space-delimited Forth syntax

    Disadvantage: Cannot deal with file names containing white space.

    3) Write a parsing word that uses '"' PARSE.

    Advantage: Can deal with file names containing white space.

    Disadvantage: Cannot deal with file names containing " or control
    characters.

    4) Write a parsing word that uses ['] S\" EXECUTE.

    Advantage: Can deal with all kinds of file names.

    Disadvantage: The user needs to escape \ (supported by 2 and 3) and
    " (supported by 2), and to use appropriate sequences for control
    characters (supported by neither 2 nor 3).

    If you want to provide parsing words to the user, for convenience and completeness you might want to provide 2, 3, and 4, and implement 1 as
    common factor, and document at least 2-4. But is the result really
    more convenient for the user than just providing 1?

    - 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 2025 proceedings: http://www.euroforth.org/ef25/papers/
    --- Synchronet 3.21f-Linux NewsLink 1.2
  • From anton@anton@mips.complang.tuwien.ac.at (Anton Ertl) to comp.lang.forth on Wed Apr 1 08:17:49 2026
    From Newsgroup: comp.lang.forth

    dxf <dxforth@gmail.com> writes:
    What I object to are appeals to authority

    Look who's talking.

    - 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 2025 proceedings: http://www.euroforth.org/ef25/papers/
    --- Synchronet 3.21f-Linux NewsLink 1.2
  • From anton@anton@mips.complang.tuwien.ac.at (Anton Ertl) to comp.lang.forth on Wed Apr 1 08:22:01 2026
    From Newsgroup: comp.lang.forth

    dxf <dxforth@gmail.com> writes:
    On 31/03/2026 6:36 pm, Anton Ertl wrote:
    Gforth and VFX64 provide SH and SwiftForth includes $; these words
    pass the rest of the line to the shell, so you can the use OS
    commands, with the filename given in the syntax of the shell, and use
    the shell syntax for comments. E.g., with Gforth invoking bash with
    Unix commands:

    sh echo test >sane-file-name
    sh mv sane-file-name insane\ file\ name # mv (as in "move") renames
    sh cat "insane file name" # prints "test"
    sh rm 'insane file name' # rm (as in "remove") deletes

    It's not a solution under MS-DOS (lots of buffers and code) nor under CP/M >where AFAIK shelling is impossible.

    That's fine, given that you wrote <69cb3c29$1@news.ausics.net>:

    |Critically these words will be parsing
    |*filenames* which are going to be OS-specific.

    So here you have an OS-specific solution.

    Concerning MS-DOS and CP/M, how do their commands handle file names
    with spaces? Write your RENAME etc. in an OS-specific way that parses
    these file names in an OS-specific way. Those who want an
    OS-independent way can use RENAME-FILE.

    INCLUDE is an optional word in the FILE EXT
    extension in Forth-2012. If you see no point, just don't use it and
    don't implement it.

    What is the point - according to you since the standard never explains?

    The proposal <http://www.forth200x.org/required.html> contains:

    |INCLUDE is implemented and used widely, so we might just as well
    |standardize it

    - 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 2025 proceedings: http://www.euroforth.org/ef25/papers/
    --- Synchronet 3.21f-Linux NewsLink 1.2
  • From dxf@dxforth@gmail.com to comp.lang.forth on Wed Apr 1 19:42:24 2026
    From Newsgroup: comp.lang.forth

    On 1/04/2026 7:17 pm, Anton Ertl wrote:
    dxf <dxforth@gmail.com> writes:
    What I object to are appeals to authority

    Look who's talking.

    200x creator, defender and goalkeeper?

    --- Synchronet 3.21f-Linux NewsLink 1.2
  • From dxf@dxforth@gmail.com to comp.lang.forth on Wed Apr 1 20:06:56 2026
    From Newsgroup: comp.lang.forth

    On 1/04/2026 7:22 pm, Anton Ertl wrote:
    dxf <dxforth@gmail.com> writes:
    On 31/03/2026 6:36 pm, Anton Ertl wrote:
    Gforth and VFX64 provide SH and SwiftForth includes $; these words
    pass the rest of the line to the shell, so you can the use OS
    commands, with the filename given in the syntax of the shell, and use
    the shell syntax for comments. E.g., with Gforth invoking bash with
    Unix commands:

    sh echo test >sane-file-name
    sh mv sane-file-name insane\ file\ name # mv (as in "move") renames
    sh cat "insane file name" # prints "test"
    sh rm 'insane file name' # rm (as in "remove") deletes

    It's not a solution under MS-DOS (lots of buffers and code) nor under CP/M >> where AFAIK shelling is impossible.

    That's fine, given that you wrote <69cb3c29$1@news.ausics.net>:

    |Critically these words will be parsing
    |*filenames* which are going to be OS-specific.

    So here you have an OS-specific solution.

    Concerning MS-DOS and CP/M, how do their commands handle file names
    with spaces? Write your RENAME etc. in an OS-specific way that parses
    these file names in an OS-specific way. Those who want an
    OS-independent way can use RENAME-FILE.

    Since each OS has its own rules regard filenames there is no 'OS-independent use of RENAME-FILE' or indeed any forth function that uses filenames.

    INCLUDE is an optional word in the FILE EXT
    extension in Forth-2012. If you see no point, just don't use it and
    don't implement it.

    What is the point - according to you since the standard never explains?

    The proposal <http://www.forth200x.org/required.html> contains:

    |INCLUDE is implemented and used widely, so we might just as well |standardize it

    But you didn't standardize the INCLUDE used by Bigforth, Win32Forth and
    likely VFX (it had GetPathSpec in 2001). 20 years on, they're still
    waiting.

    --- Synchronet 3.21f-Linux NewsLink 1.2
  • From albert@albert@spenarnc.xs4all.nl to comp.lang.forth on Wed Apr 1 12:13:43 2026
    From Newsgroup: comp.lang.forth

    In article <69cc66b6$1@news.ausics.net>, dxf <dxforth@gmail.com> wrote:
    On 31/03/2026 10:41 pm, albert@spenarnc.xs4all.nl wrote:
    In article <10qf8nr$2vaat$1@dont-email.me>,
    Krishna Myneni <krishna.myneni@ccreweb.org> wrote:
    ...
    INCLUDE per the Forth-2012 standard is inadequate for modern desktop
    systems, which was the starting point of this thread.

    No. INCLUDED is the proper way, and once proper string denotation
    is introduced by recognizers e.g. "foor bar.c" there is no reason
    to use INCLUDE apart from an interactive convenience.

    In the time of blocks, nobody had the idea of
    LOAD 13
    instead of
    13 LOAD

    Given CHAR [CHAR] what reason is there for 'c' ? Some swear for it
    while others at it. For me it wasn't merely redundant, it required
    hacking the forth interpreter to implement.

    In view of the ' character playing a special role in Forth it
    was a bad idea to copy this c-notation.

    Groetjes Albert
    --
    The Chinese government is satisfied with its military superiority over USA.
    The next 5 year plan has as primary goal to advance life expectancy
    over 80 years, like Western Europe.
    --- Synchronet 3.21f-Linux NewsLink 1.2
  • From albert@albert@spenarnc.xs4all.nl to comp.lang.forth on Wed Apr 1 12:25:02 2026
    From Newsgroup: comp.lang.forth

    In article <2026Apr1.102201@mips.complang.tuwien.ac.at>,
    Anton Ertl <anton@mips.complang.tuwien.ac.at> wrote:
    dxf <dxforth@gmail.com> writes:
    On 31/03/2026 6:36 pm, Anton Ertl wrote:
    Gforth and VFX64 provide SH and SwiftForth includes $; these words
    pass the rest of the line to the shell, so you can the use OS
    commands, with the filename given in the syntax of the shell, and use
    the shell syntax for comments. E.g., with Gforth invoking bash with
    Unix commands:

    sh echo test >sane-file-name
    sh mv sane-file-name insane\ file\ name # mv (as in "move") renames
    sh cat "insane file name" # prints "test"
    sh rm 'insane file name' # rm (as in "remove") deletes

    It's not a solution under MS-DOS (lots of buffers and code) nor under CP/M >>where AFAIK shelling is impossible.

    That's fine, given that you wrote <69cb3c29$1@news.ausics.net>:

    |Critically these words will be parsing
    |*filenames* which are going to be OS-specific.

    So here you have an OS-specific solution.

    Concerning MS-DOS and CP/M, how do their commands handle file names
    with spaces? Write your RENAME etc. in an OS-specific way that parses
    these file names in an OS-specific way. Those who want an
    OS-independent way can use RENAME-FILE.

    INCLUDE is an optional word in the FILE EXT
    extension in Forth-2012. If you see no point, just don't use it and
    don't implement it.

    What is the point - according to you since the standard never explains?

    The proposal <http://www.forth200x.org/required.html> contains:

    |INCLUDE is implemented and used widely, so we might just as well >|standardize it

    And we could add a phrase:
    The filename is blank limited and can only contain Forth characters.
    Whether the filename is case-insensitive is implementation defined.
    The implementation documents what characters (like % $ ' " ( / \ ) are forbidden in the filename.

    This is better than opening a Pandora's box on how the filename is
    interpreted in a general way.
    INCLUDE testris.4th
    is fine
    INCLUDE aap$"skls
    is dubious.

    - anton

    Groetjes Albert
    --
    The Chinese government is satisfied with its military superiority over USA.
    The next 5 year plan has as primary goal to advance life expectancy
    over 80 years, like Western Europe.
    --- Synchronet 3.21f-Linux NewsLink 1.2
  • From Krishna Myneni@krishna.myneni@ccreweb.org to comp.lang.forth on Wed Apr 1 06:23:04 2026
    From Newsgroup: comp.lang.forth

    On 4/1/26 2:54 AM, Anton Ertl wrote:
    Krishna Myneni <krishna.myneni@ccreweb.org> writes:
    On 3/31/26 5:32 AM, Anton Ertl wrote:
    Krishna Myneni <krishna.myneni@ccreweb.org> writes:
    INCLUDED is not a parsing form, which is needed in some use cases.

    In which use cases?


    In cases such as the TAIL example I gave earlier.

    I doubt that INCLUDE is a factor of TAIL, so how INCLUDE parses its
    file name is independent of how TAIL gets its file name.


    ??

    We are talking about a file name parsing word as a factor for writing
    other words, not about using INCLUDE as a factor for doing that.

    For those case where
    you want to provide a Forth word to the user in the form

    <wordname> <file1> <file2> ...

    Ok, you "want", probably because you think it's more convenient for
    the user, i.e., no technical reason.

    You have the choices:

    1) Pass each file names as c-addr u on the stack. Advantages:

    a) This word can deal with all kinds of file names.

    b) The user can use whatever is appropriate for the file name: S"
    for a file name with only blanks; or S\" for a file name that
    contain " or control characters. The user can use the
    appropriate way for each file name.

    c) The word is more flexible for use as factor in other words.

    2) Write a parsing word that uses PARSE-NAME. Advantages:

    a) Easy to implement.

    b) fits with the usual white-space-delimited Forth syntax

    Disadvantage: Cannot deal with file names containing white space.

    3) Write a parsing word that uses '"' PARSE.

    Advantage: Can deal with file names containing white space.

    Disadvantage: Cannot deal with file names containing " or control
    characters.

    4) Write a parsing word that uses ['] S\" EXECUTE.

    Advantage: Can deal with all kinds of file names.

    Disadvantage: The user needs to escape \ (supported by 2 and 3) and
    " (supported by 2), and to use appropriate sequences for control
    characters (supported by neither 2 nor 3).

    If you want to provide parsing words to the user, for convenience and completeness you might want to provide 2, 3, and 4, and implement 1 as
    common factor, and document at least 2-4. But is the result really
    more convenient for the user than just providing 1?


    INCLUDE (a parsing word) has been standardized after common usage
    because system's implementers thought it was useful. Otherwise everyone
    would just have stuck with INCLUDED as the default mechanism. But it
    wasn't convenient enough because

    1. back then there was no S" in interpretation state.
    2. no one wanted to force users to write s" <filename>" included
    after common usage INCLUDE was around

    Similarly systems implementers provided a general purpose parsing word
    for file names which were usable under the OS's they were dealing with.
    VFX implemented GetPathSpec for that purpose. dxforth implemented his
    own file name parser, GetFileName. Obviously there is a perceived need
    by system implementers for such a word. This discussion is about how to implement such words and maybe find a portable name for such a word.

    --
    Krishna




    --- Synchronet 3.21f-Linux NewsLink 1.2
  • From dxf@dxforth@gmail.com to comp.lang.forth on Thu Apr 2 00:07:19 2026
    From Newsgroup: comp.lang.forth

    On 1/04/2026 9:25 pm, albert@spenarnc.xs4all.nl wrote:
    In article <2026Apr1.102201@mips.complang.tuwien.ac.at>,
    Anton Ertl <anton@mips.complang.tuwien.ac.at> wrote:
    dxf <dxforth@gmail.com> writes:
    On 31/03/2026 6:36 pm, Anton Ertl wrote:
    Gforth and VFX64 provide SH and SwiftForth includes $; these words
    pass the rest of the line to the shell, so you can the use OS
    commands, with the filename given in the syntax of the shell, and use
    the shell syntax for comments. E.g., with Gforth invoking bash with
    Unix commands:

    sh echo test >sane-file-name
    sh mv sane-file-name insane\ file\ name # mv (as in "move") renames
    sh cat "insane file name" # prints "test"
    sh rm 'insane file name' # rm (as in "remove") deletes

    It's not a solution under MS-DOS (lots of buffers and code) nor under CP/M >>> where AFAIK shelling is impossible.

    That's fine, given that you wrote <69cb3c29$1@news.ausics.net>:

    |Critically these words will be parsing
    |*filenames* which are going to be OS-specific.

    So here you have an OS-specific solution.

    Concerning MS-DOS and CP/M, how do their commands handle file names
    with spaces? Write your RENAME etc. in an OS-specific way that parses
    these file names in an OS-specific way. Those who want an
    OS-independent way can use RENAME-FILE.

    INCLUDE is an optional word in the FILE EXT
    extension in Forth-2012. If you see no point, just don't use it and
    don't implement it.

    What is the point - according to you since the standard never explains?

    The proposal <http://www.forth200x.org/required.html> contains:

    |INCLUDE is implemented and used widely, so we might just as well
    |standardize it

    And we could add a phrase:
    The filename is blank limited and can only contain Forth characters.
    Whether the filename is case-insensitive is implementation defined.
    The implementation documents what characters (like % $ ' " ( / \ ) are forbidden in the filename.

    This is better than opening a Pandora's box on how the filename is interpreted in a general way.
    INCLUDE testris.4th
    is fine
    INCLUDE aap$"skls
    is dubious.

    The standard itself makes few restrictions on filenames:

    11.1 Introduction

    These words provide access to mass storage in the form of "files"
    under the following assumptions:

    - file names are represented as character strings;
    - the format of file names is determined by the host operating system;


    --- Synchronet 3.21f-Linux NewsLink 1.2
  • From Gerry Jackson@do-not-use@swldwa.uk to comp.lang.forth on Wed Apr 1 19:43:42 2026
    From Newsgroup: comp.lang.forth

    On 01/04/2026 01:28, dxf wrote:
    On 31/03/2026 10:41 pm, albert@spenarnc.xs4all.nl wrote:
    In article <10qf8nr$2vaat$1@dont-email.me>,
    Krishna Myneni <krishna.myneni@ccreweb.org> wrote:
    ...
    INCLUDE per the Forth-2012 standard is inadequate for modern desktop
    systems, which was the starting point of this thread.

    No. INCLUDED is the proper way, and once proper string denotation
    is introduced by recognizers e.g. "foor bar.c" there is no reason
    to use INCLUDE apart from an interactive convenience.

    In the time of blocks, nobody had the idea of
    LOAD 13
    instead of
    13 LOAD

    Given CHAR [CHAR] what reason is there for 'c' ? Some swear for it
    while others at it. For me it wasn't merely redundant, it required
    hacking the forth interpreter to implement.

    I'm curious - why did you implement it if redundant and you clearly hate it?
    --
    Gerry
    --- Synchronet 3.21f-Linux NewsLink 1.2
  • From dxf@dxforth@gmail.com to comp.lang.forth on Thu Apr 2 12:18:32 2026
    From Newsgroup: comp.lang.forth

    On 2/04/2026 5:43 am, Gerry Jackson wrote:
    On 01/04/2026 01:28, dxf wrote:
    On 31/03/2026 10:41 pm, albert@spenarnc.xs4all.nl wrote:
    In article <10qf8nr$2vaat$1@dont-email.me>,
    Krishna Myneni  <krishna.myneni@ccreweb.org> wrote:
      ...
    INCLUDE per the Forth-2012 standard is inadequate for modern desktop
    systems, which was the starting point of this thread.

    No. INCLUDED is the proper way, and once proper string denotation
    is introduced by recognizers e.g. "foor bar.c" there is no reason
    to use INCLUDE apart from an interactive convenience.

    In the time of blocks, nobody had the idea of
         LOAD 13
    instead of
         13 LOAD

    Given CHAR [CHAR] what reason is there for 'c' ?  Some swear for it
    while others at it.  For me it wasn't merely redundant, it required
    hacking the forth interpreter to implement.

    I'm curious - why did you implement it if redundant and you clearly hate it?

    An undocumented feature disabled by default. I was curious enough to find
    out what it would take. For me, it was 34 bytes better spent elsewhere.

    : number ( c-addr -- n|d|r xt )
    dup 2@ swap $FF00 and $27002703. d= if 2+ c@ postpone literal exit then
    count ...

    hdr x,'NUMBER',,1
    numb: call docol
    if 0 ; 200x char literal 'c'
    dw dupp,tat
    dw swap
    dw lit,0ff00h
    dw andd
    dw tlit
    dw 2700h,2703h
    dw dequ
    dw zbran,numb0
    dw twop,cat
    dw lit,liter
    dw exit
    numb0 = $
    endif
    dw count
    ...

    --- Synchronet 3.21f-Linux NewsLink 1.2
  • From dxf@dxforth@gmail.com to comp.lang.forth on Thu Apr 2 12:43:09 2026
    From Newsgroup: comp.lang.forth

    On 2/04/2026 12:18 pm, dxf wrote:
    ...

    : number ( c-addr -- n|d|r xt )
    dup 2@ swap $FF00 and $27002703. d= if 2+ c@ postpone literal exit then
    count ...

    Let's try that again. Assumes a 16-bit forth.

    : number ( c-addr -- n|d|r xt )
    dup 2@ swap $FF00 and $27002703. d= if 2+ c@ ['] literal exit then
    count ...

    --- Synchronet 3.21f-Linux NewsLink 1.2
  • From anton@anton@mips.complang.tuwien.ac.at (Anton Ertl) to comp.lang.forth on Thu Apr 2 05:55:55 2026
    From Newsgroup: comp.lang.forth

    dxf <dxforth@gmail.com> writes:
    FORTH-94 didn't have any words that parsed a filename so it was never an issue.
    That changed when 200x introduced REQUIRE and INCLUDE. The culprit in their >stack comment was the continued use of the token <name>. Properly a new token >representing filenames should have been defined and added to 2.2.3 'Parsed-text
    notation'. This would have covered what forth systems were using in real life.

    What Gforth has been using in real life is parsing
    white-space-delimited file names, which goes back to the time that
    Gforth first implemented INCLUDE and REQUIRE (they already were
    present in Gforth-0.2 in 1996). There have been no complaints about
    that behaviour in the last 3 decades, and I have no intention to
    change it.

    - 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 2025 proceedings: http://www.euroforth.org/ef25/papers/
    --- Synchronet 3.21f-Linux NewsLink 1.2
  • From anton@anton@mips.complang.tuwien.ac.at (Anton Ertl) to comp.lang.forth on Thu Apr 2 06:05:00 2026
    From Newsgroup: comp.lang.forth

    dxf <dxforth@gmail.com> writes:
    Since each OS has its own rules regard filenames there is no 'OS-independent >use of RENAME-FILE' or indeed any forth function that uses filenames.

    If that was true, we could not use any of the words portably that deal
    with filenames. In particular, we could not use INCLUDED and friends
    in portable programs. Fortunately, that is not the case.

    There actually are OS-independent file names, and POSIX has
    standardized the "Portable filename character set" in POSIX 2004 3.276 <https://pubs.opengroup.org/onlinepubs/009695399/basedefs/xbd_chap03.html#tag_03_276>
    (possibly earlier). In POSIX 2024 this section is 3.265 <https://pubs.opengroup.org/onlinepubs/9799919799/basedefs/V1_chap03.html#tag_03_265>.

    I proposed adopting that specification to the Forth standard <http://www.forth200x.org/directories1.html>, but there was zero
    interest in that proposal, so I withdrew it.

    The proposal <http://www.forth200x.org/required.html> contains:

    |INCLUDE is implemented and used widely, so we might just as well
    |standardize it

    But you didn't standardize the INCLUDE used by Bigforth, Win32Forth and >likely VFX (it had GetPathSpec in 2001). 20 years on, they're still
    waiting.

    In the first 20 years none of their implementors or users have ever
    mentioned that these systems do not implement the standardized INCLUDE
    and REQUIRE, much less made a proposal that would make the behaviour
    of these systems standard-compliant. And the best time to bring that
    up would have been when the proposal was in the RfD stage, but nobody
    mentioned it at the time.

    Apparently this particular aspect has not been on anybody's mind
    during the proposal stage or in the two decades since then, only
    surfacing recently with bombastic claims about the importance of using
    file names with blanks in INCLUDE.

    - 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 2025 proceedings: http://www.euroforth.org/ef25/papers/
    --- Synchronet 3.21f-Linux NewsLink 1.2
  • From dxf@dxforth@gmail.com to comp.lang.forth on Thu Apr 2 17:44:38 2026
    From Newsgroup: comp.lang.forth

    On 2/04/2026 4:55 pm, Anton Ertl wrote:
    dxf <dxforth@gmail.com> writes:
    FORTH-94 didn't have any words that parsed a filename so it was never an issue.
    That changed when 200x introduced REQUIRE and INCLUDE. The culprit in their >> stack comment was the continued use of the token <name>. Properly a new token
    representing filenames should have been defined and added to 2.2.3 'Parsed-text
    notation'. This would have covered what forth systems were using in real life.

    What Gforth has been using in real life is parsing
    white-space-delimited file names, which goes back to the time that
    Gforth first implemented INCLUDE and REQUIRE (they already were
    present in Gforth-0.2 in 1996). There have been no complaints about
    that behaviour in the last 3 decades, and I have no intention to
    change it.

    Standard forth has obligations to a wider audience.

    --- Synchronet 3.21f-Linux NewsLink 1.2
  • From dxf@dxforth@gmail.com to comp.lang.forth on Thu Apr 2 18:09:50 2026
    From Newsgroup: comp.lang.forth

    On 2/04/2026 5:05 pm, Anton Ertl wrote:
    dxf <dxforth@gmail.com> writes:
    Since each OS has its own rules regard filenames there is no 'OS-independent >> use of RENAME-FILE' or indeed any forth function that uses filenames.

    If that was true, we could not use any of the words portably that deal
    with filenames. In particular, we could not use INCLUDED and friends
    in portable programs. Fortunately, that is not the case.

    Of course they can be used. What is not guaranteed to work is the
    filename passed to the function. If the application specifies one,
    it's a dependency since the standard declined to say anything more
    about filenames than what is contained in section 11.1. To my mind
    they made the right call as filenames pertain to an OS - not to a
    language.

    ...

    --- Synchronet 3.21f-Linux NewsLink 1.2
  • From anton@anton@mips.complang.tuwien.ac.at (Anton Ertl) to comp.lang.forth on Thu Apr 2 08:34:33 2026
    From Newsgroup: comp.lang.forth

    Krishna Myneni <krishna.myneni@ccreweb.org> writes:
    On 4/1/26 2:54 AM, Anton Ertl wrote:
    Krishna Myneni <krishna.myneni@ccreweb.org> writes:
    On 3/31/26 5:32 AM, Anton Ertl wrote:
    Krishna Myneni <krishna.myneni@ccreweb.org> writes:
    INCLUDED is not a parsing form, which is needed in some use cases.

    In which use cases?


    In cases such as the TAIL example I gave earlier.

    I doubt that INCLUDE is a factor of TAIL, so how INCLUDE parses its
    file name is independent of how TAIL gets its file name.


    ??

    We are talking about a file name parsing word as a factor for writing
    other words, not about using INCLUDE as a factor for doing that.

    Much of this discussion has been about INCLUDE vs. INCLUDED, including
    the sentence cited first above. If you were talking about something
    else, you have not made that clear earlier.

    For those case where
    you want to provide a Forth word to the user in the form

    <wordname> <file1> <file2> ...

    Ok, you "want", probably because you think it's more convenient for
    the user, i.e., no technical reason.

    You have the choices:

    1) Pass each file names as c-addr u on the stack. Advantages:

    a) This word can deal with all kinds of file names.

    b) The user can use whatever is appropriate for the file name: S"
    for a file name with only blanks; or S\" for a file name that
    contain " or control characters. The user can use the
    appropriate way for each file name.

    c) The word is more flexible for use as factor in other words.

    2) Write a parsing word that uses PARSE-NAME. Advantages:

    a) Easy to implement.

    b) fits with the usual white-space-delimited Forth syntax

    Disadvantage: Cannot deal with file names containing white space.

    3) Write a parsing word that uses '"' PARSE.

    Advantage: Can deal with file names containing white space.

    Disadvantage: Cannot deal with file names containing " or control
    characters.

    4) Write a parsing word that uses ['] S\" EXECUTE.

    Advantage: Can deal with all kinds of file names.

    Disadvantage: The user needs to escape \ (supported by 2 and 3) and
    " (supported by 2), and to use appropriate sequences for control
    characters (supported by neither 2 nor 3).

    If you want to provide parsing words to the user, for convenience and
    completeness you might want to provide 2, 3, and 4, and implement 1 as
    common factor, and document at least 2-4. But is the result really
    more convenient for the user than just providing 1?


    INCLUDE (a parsing word) has been standardized after common usage
    because system's implementers thought it was useful. Otherwise everyone >would just have stuck with INCLUDED as the default mechanism.

    My guess is that INCLUDE had already been common practice when
    Forth-94 was standardized. Forth-94 standardized INCLUDED, for
    whatever reasons. The issues discussed above may have played a role,
    although at the time of standarization the use of white space for
    Forth source file names probably hardly existed (you don't do it when
    you use a CLI). The better usability of INCLUDED as a factor probably
    played a bigger role, and they then apparently did not think that they
    also needed to standardize INCLUDE, and that users would switch to
    using INCLUDED.

    But it
    wasn't convenient enough because

    1. back then there was no S" in interpretation state.

    FILE S" (which standardizes the interpretation semantics of S") has
    been present in Forth-94. BTW, there is nothing in Forth-94 that
    prevents the compilation semantics of S" (standardized in CORE) from
    being performed in interpretation state, but I don't think that that's
    what you had in mind.

    2. no one wanted to force users to write s" <filename>" included
    after common usage INCLUDE was around

    This! Users did not switch to using INCLUDED, and when some of them
    wanted to INCLUDE file names with spaces, apparently some system
    implementors decided to add frills to INCLUDE to support file names
    with spaces rather than recommend that the users use INCLUDED.

    When I compare

    s" file name with spaces.4th" included \ Forth-94
    "file name with spaces.4th" included \ with string recognizer
    include "file name with spaces.4th" \ non-standard even in Forth-2012

    I see extremely little benefit to using INCLUDE. The advantage of
    INCLUDE is slightly better when comparing

    s" file-name.4th" included \ Forth-94
    "file-name.4th" included \ with string recognizer
    include file-name.4th \ Forth-2012

    Similarly systems implementers provided a general purpose parsing word
    for file names which were usable under the OS's they were dealing with.
    VFX implemented GetPathSpec for that purpose. dxforth implemented his
    own file name parser, GetFileName. Obviously there is a perceived need
    by system implementers for such a word.

    I have never heard of for such a thing before the present thread, and
    I certainly don't perceive any need now. Passing c-addr u on the
    stack is good enough.

    - 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 2025 proceedings: http://www.euroforth.org/ef25/papers/
    --- Synchronet 3.21f-Linux NewsLink 1.2
  • From anton@anton@mips.complang.tuwien.ac.at (Anton Ertl) to comp.lang.forth on Thu Apr 2 09:07:15 2026
    From Newsgroup: comp.lang.forth

    dxf <dxforth@gmail.com> writes:
    On 2/04/2026 5:43 am, Gerry Jackson wrote:
    On 01/04/2026 01:28, dxf wrote:
    Given CHAR [CHAR] what reason is there for 'c' ?
    ...
    For me, it was 34 bytes better spent elsewhere.

    How much do CHAR and [CHAR] cost in your system?

    [I applied the correction from <69cdc9ac$1@news.ausics.net>]
    : number ( c-addr -- n|d|r xt )
    dup 2@ swap $FF00 and $27002703. d= if 2+ c@ ['] literal exit then
    count ...

    Clever!

    - 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 2025 proceedings: http://www.euroforth.org/ef25/papers/
    --- Synchronet 3.21f-Linux NewsLink 1.2
  • From anton@anton@mips.complang.tuwien.ac.at (Anton Ertl) to comp.lang.forth on Thu Apr 2 09:11:28 2026
    From Newsgroup: comp.lang.forth

    dxf <dxforth@gmail.com> writes:
    Given CHAR [CHAR] what reason is there for 'c' ?

    My reasons are:

    1) Shorter source code

    2) source code that can be copied and pasted from interpreted code to
    compiled code and vice versa.

    Looking at <http://www.forth200x.org/number-prefixes.html>, the
    proposal does not give this reasons, but focuses on existing practice.

    For me it wasn't merely redundant, it required
    hacking the forth interpreter to implement.

    Yes, like the Chuck Moore hacked the interpreter when he included a
    number recognizer instead of adding parsing words for numbers. If he had added, e.g.

    single -single double -double
    [single] [-single] [double] [-double]

    instead, he would have spared himself and us all the complexity of
    dealing with negative numbers and doubles in the number recognizer. I
    am happy that he did not (admittedly, his double syntax is debatable).

    - 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 2025 proceedings: http://www.euroforth.org/ef25/papers/
    --- Synchronet 3.21f-Linux NewsLink 1.2
  • From dxf@dxforth@gmail.com to comp.lang.forth on Thu Apr 2 21:50:59 2026
    From Newsgroup: comp.lang.forth

    On 2/04/2026 8:07 pm, Anton Ertl wrote:
    dxf <dxforth@gmail.com> writes:
    On 2/04/2026 5:43 am, Gerry Jackson wrote:
    On 01/04/2026 01:28, dxf wrote:
    Given CHAR [CHAR] what reason is there for 'c' ?
    ...
    For me, it was 34 bytes better spent elsewhere.

    How much do CHAR and [CHAR] cost in your system?

    Everything in my system costs. It comes down to what can I afford to lose.

    --- Synchronet 3.21f-Linux NewsLink 1.2
  • From albert@albert@spenarnc.xs4all.nl to comp.lang.forth on Thu Apr 2 13:54:44 2026
    From Newsgroup: comp.lang.forth

    In article <69ce163d$1@news.ausics.net>, dxf <dxforth@gmail.com> wrote:
    On 2/04/2026 5:05 pm, Anton Ertl wrote:
    dxf <dxforth@gmail.com> writes:
    Since each OS has its own rules regard filenames there is no 'OS-independent
    use of RENAME-FILE' or indeed any forth function that uses filenames.

    If that was true, we could not use any of the words portably that deal
    with filenames. In particular, we could not use INCLUDED and friends
    in portable programs. Fortunately, that is not the case.

    Of course they can be used. What is not guaranteed to work is the
    filename passed to the function. If the application specifies one,
    it's a dependency since the standard declined to say anything more
    about filenames than what is contained in section 11.1. To my mind
    they made the right call as filenames pertain to an OS - not to a
    language.

    An OS requires a filename sitting in a buffer. Unix allows a BELL, quotes,blanks or an ACKnowledge in a filename. Chinese Unix allows
    more. All this can be accommodated with a (byte-address count ).
    INCLUDE talks about (caddr n) but this is the same in practice.
    What is not guaranteed to work? Opening a file certainly succeeds.
    Maybe TYPEing the (caddr n) to a VT100 terminal fails, or you
    could physically damage a 640x480 color terminal.

    All that is outside of the scope of INCLUDED.

    You could e.g. program a recursive copy in Forth, without
    examining the filenames, just using them.

    Groetjes Albert
    --
    The Chinese government is satisfied with its military superiority over USA.
    The next 5 year plan has as primary goal to advance life expectancy
    over 80 years, like Western Europe.
    --- Synchronet 3.21f-Linux NewsLink 1.2
  • From Krishna Myneni@krishna.myneni@ccreweb.org to comp.lang.forth on Thu Apr 2 07:18:32 2026
    From Newsgroup: comp.lang.forth

    On 4/2/26 3:34 AM, Anton Ertl wrote:
    Krishna Myneni <krishna.myneni@ccreweb.org> writes:
    ...

    Similarly systems implementers provided a general purpose parsing word
    for file names which were usable under the OS's they were dealing with.
    VFX implemented GetPathSpec for that purpose. dxforth implemented his
    own file name parser, GetFileName. Obviously there is a perceived need
    by system implementers for such a word.

    I have never heard of for such a thing before the present thread, and
    I certainly don't perceive any need now. Passing c-addr u on the
    stack is good enough.


    Not really. Let's say you wanted a word which operates on an arbitrary
    number of files (which fit on a single line).

    Parsing form:

    <wordname> <file_1> <file_2> <file_3> ... <file_n>

    Stack method:

    S" <file_1>" S" <file_2> S" <file_3>" ... S" <file_n>" n wordname

    The parsing form is able to determine the file count and there is no
    visual clutter with S" .

    It's a user convenience feature.

    Forth is often advertised as a useful language for writing DSLs. Parsing
    words are critical for writing a DSL when it doesn't use stack passing
    of parameters.

    --
    Krishna

    --- Synchronet 3.21f-Linux NewsLink 1.2
  • From anton@anton@mips.complang.tuwien.ac.at (Anton Ertl) to comp.lang.forth on Thu Apr 2 14:43:19 2026
    From Newsgroup: comp.lang.forth

    Krishna Myneni <krishna.myneni@ccreweb.org> writes:
    Not really. Let's say you wanted a word which operates on an arbitrary >number of files (which fit on a single line).

    Such a requirement has not surfaced for my Forth programs in the last 4 decades.

    If you have such a requirement, PARSE-NAME is good enough, because
    "modern file paths" (i.e., those that tend to contain spaces) tend to
    be too long to fit several comfortably on a single line. E.g., here's
    one of the files I have on my file system:

    /home/anton/stuko/curricula/Informatik/Masterstudium_Medizinische_Informatik/module/MethodologicalFoundationsOfPublicHealthInformatics.tex

    And these are not even using spaces. If this was using spaces instead
    of CamelCase, it would be even longer. Here's another one:

    /home/anton/stuko/curricula/Informatik/Masterstudium_Software_Engineering/module/AdvancedTopicsInDistributedAndNextGenerationComputing.tex

    Even a single component of this path is up to 53 characters.

    Let's take a look at file names that actually contain spaces:

    /home/cds/tracks/1999 Compilation--Short Music for Short People/99.Caustic Soda; Misfits; Wizo--Welcome To Dumpsville, Population: You; NY Ranger; The Count.ogg

    That's a nasty one, because this CD contains more then 99 songs, but
    the CD format only supports 99 tracks, so the last track contains
    several songs. Let's take a look at another one:

    /home/cds/tracks/2007 Marilyn Manson--Eat Me, Drink Me/12.Heart-Shaped Glasses (When The Heart Guides The Hand) (Inhuman Remix By Jade E Puget).ogg

    The users and programs that create filenames with spaces, whether it
    is scripts, as in the track cases, or whether it is users using GUIs
    don't avoid longish file names, unlike human CLI users.

    So if you design an interface for human CLI users like

    <wordname> <file_1> <file_2> <file_3> ... <file_n>

    then I see little point in designing it for filenames coming out of
    GUIs etc. Just use PARSE-NAME (appropriate for CLI filenames), and
    leave file names containing spaces to a word like

    S" <file_1>" S" <file_2> S" <file_3>" ... S" <file_n>" n wordname

    Here the user can write

    "MethodologicalFoundationsOfPublicHealthInformatics.tex"
    "99.Caustic Soda; Misfits; Wizo--Welcome To Dumpsville, Population: You; NY Ranger; The Count.ogg"
    "12.Heart-Shaped Glasses (When The Heart Guides The Hand) (Inhuman Remix By Jade E Puget).ogg"
    3 wordname

    [note that these are only the last components of several of the file
    names shown above]

    (or do it with S" if you want, and include something like SAVE-MEM if
    necessary on your system)

    This still does not look particularly neat, but better than putting
    all the file names in one line (and AFAIK some widely used Forth
    systems still have hard limits on line length, and do not even do
    proper error reporting when the limits are exceeded).

    Plus, you can use comments between file names, which parsing words
    usually do not support.

    Forth is often advertised as a useful language for writing DSLs. Parsing >words are critical for writing a DSL when it doesn't use stack passing
    of parameters.

    Use stack-passing of parameters. For a variable number, a pair of
    words that does the counting for you may be useful; something like:

    stack<
    ...
    2stack#

    implemented nestably as

    variable initial-stack-depth

    : stack< ( -- old )
    initial-stack-depth @
    depth initial-stack-depth ! ;

    : >stack# ( old i*x -- i*x u )
    depth initial-stack-depth @ - dup 1+ roll initial-stack-depth ! ;

    : >2stack# ( old i*x -- i*x u )
    >stack# 2/ ; \ maybe add a chack for evenness

    If you don't require nesting, this can be simplified by leaving all
    the "old" handling away.

    As for being useful for DSLs, I have often seen the claim, but not
    examples. At least not examples where some syntax that requires
    significant parsing is involved. If you go there, you no longer can
    mix Forth and DSL code, and Forth loses a lot of its benefits.

    - 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 2025 proceedings: http://www.euroforth.org/ef25/papers/
    --- Synchronet 3.21f-Linux NewsLink 1.2
  • From dxf@dxforth@gmail.com to comp.lang.forth on Fri Apr 3 11:57:29 2026
    From Newsgroup: comp.lang.forth

    On 2/04/2026 10:54 pm, albert@spenarnc.xs4all.nl wrote:
    In article <69ce163d$1@news.ausics.net>, dxf <dxforth@gmail.com> wrote:
    On 2/04/2026 5:05 pm, Anton Ertl wrote:
    dxf <dxforth@gmail.com> writes:
    Since each OS has its own rules regard filenames there is no 'OS-independent
    use of RENAME-FILE' or indeed any forth function that uses filenames.

    If that was true, we could not use any of the words portably that deal
    with filenames. In particular, we could not use INCLUDED and friends
    in portable programs. Fortunately, that is not the case.

    Of course they can be used. What is not guaranteed to work is the
    filename passed to the function. If the application specifies one,
    it's a dependency since the standard declined to say anything more
    about filenames than what is contained in section 11.1. To my mind
    they made the right call as filenames pertain to an OS - not to a
    language.

    An OS requires a filename sitting in a buffer. Unix allows a BELL, quotes,blanks or an ACKnowledge in a filename. Chinese Unix allows
    more. All this can be accommodated with a (byte-address count ).
    INCLUDE talks about (caddr n) but this is the same in practice.
    What is not guaranteed to work? Opening a file certainly succeeds.
    Maybe TYPEing the (caddr n) to a VT100 terminal fails, or you
    could physically damage a 640x480 color terminal.

    All that is outside of the scope of INCLUDED.

    You could e.g. program a recursive copy in Forth, without
    examining the filenames, just using them.

    An OS requires a valid filename. It's not for a Forth standard to
    specify or limit what that is - is all I'm saying. The standard
    violated that when it specified INCLUDE REQUIRE. I'd like to think
    the latter was an oversight but given certain statements made in
    this thread, I fear it wasn't.

    --- Synchronet 3.21f-Linux NewsLink 1.2
  • From Krishna Myneni@krishna.myneni@ccreweb.org to comp.lang.forth on Thu Apr 2 20:52:34 2026
    From Newsgroup: comp.lang.forth

    On 4/2/26 9:43 AM, Anton Ertl wrote:
    Krishna Myneni <krishna.myneni@ccreweb.org> writes:
    Not really. Let's say you wanted a word which operates on an arbitrary
    number of files (which fit on a single line).

    Such a requirement has not surfaced for my Forth programs in the last 4 decades.

    If you have such a requirement, PARSE-NAME is good enough, because
    "modern file paths" (i.e., those that tend to contain spaces) tend to
    be too long to fit several comfortably on a single line. E.g., here's
    one of the files I have on my file system:

    /home/anton/stuko/curricula/Informatik/Masterstudium_Medizinische_Informatik/module/MethodologicalFoundationsOfPublicHealthInformatics.tex

    And these are not even using spaces. If this was using spaces instead
    of CamelCase, it would be even longer. Here's another one:

    /home/anton/stuko/curricula/Informatik/Masterstudium_Software_Engineering/module/AdvancedTopicsInDistributedAndNextGenerationComputing.tex

    Even a single component of this path is up to 53 characters.

    Let's take a look at file names that actually contain spaces:

    /home/cds/tracks/1999 Compilation--Short Music for Short People/99.Caustic Soda; Misfits; Wizo--Welcome To Dumpsville, Population: You; NY Ranger; The Count.ogg

    That's a nasty one, because this CD contains more then 99 songs, but
    the CD format only supports 99 tracks, so the last track contains
    several songs. Let's take a look at another one:

    /home/cds/tracks/2007 Marilyn Manson--Eat Me, Drink Me/12.Heart-Shaped Glasses (When The Heart Guides The Hand) (Inhuman Remix By Jade E Puget).ogg

    The users and programs that create filenames with spaces, whether it
    is scripts, as in the track cases, or whether it is users using GUIs
    don't avoid longish file names, unlike human CLI users.

    So if you design an interface for human CLI users like

    <wordname> <file_1> <file_2> <file_3> ... <file_n>

    then I see little point in designing it for filenames coming out of
    GUIs etc. Just use PARSE-NAME (appropriate for CLI filenames), and
    leave file names containing spaces to a word like

    S" <file_1>" S" <file_2> S" <file_3>" ... S" <file_n>" n wordname

    Here the user can write

    "MethodologicalFoundationsOfPublicHealthInformatics.tex"
    "99.Caustic Soda; Misfits; Wizo--Welcome To Dumpsville, Population: You; NY Ranger; The Count.ogg"
    "12.Heart-Shaped Glasses (When The Heart Guides The Hand) (Inhuman Remix By Jade E Puget).ogg"
    3 wordname

    [note that these are only the last components of several of the file
    names shown above]

    (or do it with S" if you want, and include something like SAVE-MEM if necessary on your system)

    This still does not look particularly neat, but better than putting
    all the file names in one line (and AFAIK some widely used Forth
    systems still have hard limits on line length, and do not even do
    proper error reporting when the limits are exceeded).

    Plus, you can use comments between file names, which parsing words
    usually do not support.


    Sure, both methods have their advantages in specific situations. There
    is no need to insist on "use one method always."

    Forth is often advertised as a useful language for writing DSLs. Parsing
    words are critical for writing a DSL when it doesn't use stack passing
    of parameters.

    Use stack-passing of parameters. For a variable number, a pair of
    words that does the counting for you may be useful; something like:

    ...
    As for being useful for DSLs, I have often seen the claim, but not
    examples. At least not examples where some syntax that requires
    significant parsing is involved. If you go there, you no longer can
    mix Forth and DSL code, and Forth loses a lot of its benefits.


    I wouldn't make a strong claim that you can't mix a DSL with Forth, and
    yes, significant parsing is involved.

    Here's an example where Forth and a DSL are mixed. The DSL provides
    Lisp-like notation to simplify the Forth words.

    https://github.com/mynenik/kForth-64/blob/master/forth-src/qm/lsterms.4th


    The following snippet defines a Forth word QTOTAL using a mix of Forth
    along with DSL words FIRST CONS REST

    \ Given a list of sets of quantum numbers for n electrons:
    \
    \ { ( m_l1 m_s1 m_l2 m_s2 ... m_ln m_sn ) }
    \
    \ return a list of total quantum numbers { ( M_L M_S ) }
    : qtotal ( 'l -- 'MLMS )
    nil swap
    BEGIN dup nil? 0= WHILE
    dup >r first >qtot swap cons
    r> rest
    REPEAT
    drop ;

    Creating lists is done with a parsing word which can span multiple lines:

    '( apple pear banana grape kiwi papaya mango tomato
    orange grapefruit tangerine watermelon cantaloupe ) to fruits

    See

    https://github.com/mynenik/kForth-64/blob/master/forth-src/lists-test.4th

    --
    KM


    --- Synchronet 3.21f-Linux NewsLink 1.2
  • From albert@albert@spenarnc.xs4all.nl to comp.lang.forth on Fri Apr 3 11:40:28 2026
    From Newsgroup: comp.lang.forth

    In article <2026Apr2.164319@mips.complang.tuwien.ac.at>,
    Anton Ertl <anton@mips.complang.tuwien.ac.at> wrote:
    Krishna Myneni <krishna.myneni@ccreweb.org> writes:
    Not really. Let's say you wanted a word which operates on an arbitrary >>number of files (which fit on a single line).

    Such a requirement has not surfaced for my Forth programs in the last 4 >decades.
    <SNIP>
    Let's take a look at file names that actually contain spaces:

    /home/cds/tracks/1999 Compilation--Short Music for Short People/99.Caustic Soda; Misfits; Wizo--Welcome To Dumpsville, Population: You; NY Ranger; The Count.ogg


    Assuming you want forego a GUI:
    If you want to play songs from this cd you probably want something as play

    play Caustic

    `` play '' searches recursively for a file name containing Caustic and plays them

    I find search really useful:
    -------- search ----
    #!/bin/sh
    find . -name \*$1\* 2>/dev/null
    ------------------

    I can't believe someone attempts to type in :
    /home/cds/tracks/1999 Compilation--Short Music for Short People/99.Caustic Soda; Misfits; Wizo--Welcome To Dumpsville, Population: You; NY Ranger; The Count.ogg
    by hand, proper paying attention tp spaces and escapes.
    Not to speak of French titles and uemlauts.

    <SNIP>
    As for being useful for DSLs, I have often seen the claim, but not
    examples. At least not examples where some syntax that requires
    significant parsing is involved. If you go there, you no longer can
    mix Forth and DSL code, and Forth loses a lot of its benefits.
    Right

    - anton
    --
    The Chinese government is satisfied with its military superiority over USA.
    The next 5 year plan has as primary goal to advance life expectancy
    over 80 years, like Western Europe.
    --- Synchronet 3.21f-Linux NewsLink 1.2
  • From albert@albert@spenarnc.xs4all.nl to comp.lang.forth on Fri Apr 3 11:44:51 2026
    From Newsgroup: comp.lang.forth

    In article <69cf1078$1@news.ausics.net>, dxf <dxforth@gmail.com> wrote:
    An OS requires a valid filename. It's not for a Forth standard to
    specify or limit what that is - is all I'm saying. The standard
    violated that when it specified INCLUDE REQUIRE. I'd like to think
    the latter was an oversight but given certain statements made in
    this thread, I fear it wasn't.

    Not an oversight. An optional convenience that works in a great
    many cases.

    Groetjes Albert
    --
    The Chinese government is satisfied with its military superiority over USA.
    The next 5 year plan has as primary goal to advance life expectancy
    over 80 years, like Western Europe.
    --- Synchronet 3.21f-Linux NewsLink 1.2
  • From dxf@dxforth@gmail.com to comp.lang.forth on Sat Apr 4 00:23:40 2026
    From Newsgroup: comp.lang.forth

    On 3/04/2026 8:44 pm, albert@spenarnc.xs4all.nl wrote:
    In article <69cf1078$1@news.ausics.net>, dxf <dxforth@gmail.com> wrote:
    An OS requires a valid filename. It's not for a Forth standard to
    specify or limit what that is - is all I'm saying. The standard
    violated that when it specified INCLUDE REQUIRE. I'd like to think
    the latter was an oversight but given certain statements made in
    this thread, I fear it wasn't.

    Not an oversight. An optional convenience that works in a great
    many cases.

    It would handle many more cases were it defined:

    11.6.2.1714 INCLUDE

    ( i*x “fname”–– j*x )

    Skip leading white space and parse fname delimited by a white space
    character. Push the address and length of the file name represented
    by fname on the stack and perform the function of INCLUDED


    2.2.3 Parsed-text notation

    Table 2.1: Parsed text abbreviations
    ...
    fname a token equivalent to name representing a file name.
    translation from fname to file name is implementation defined.


    --- Synchronet 3.21f-Linux NewsLink 1.2
  • From sjack@sjack@dontemail.me (sjack) to comp.lang.forth on Sat Apr 4 06:21:28 2026
    From Newsgroup: comp.lang.forth

    Krishna Myneni <krishna.myneni@ccreweb.org> wrote:
    In cases such as the TAIL example I gave earlier. For those case where
    you want to provide a Forth word to the user in the form

    <wordname> <file1> <file2> ...

    "proxy" /demo

    Demo Forth proxy for Bash command
    -- FigForth with Toad extensions
    --
    -- /SYS ( s -- )
    -- Send string to OS as a command.
    --
    -- APPEND_AT ( s1 s2 a -- s3 )
    -- At address 'a' append string 's2' to string 's2'
    -- push result as string 's3'.
    --
    -- "..." ( "<">ccc<">" -- s)
    -- Bounded string where double quotes are used as
    -- delimiters
    --
    -- TAIL ( filelist -- )
    -- Blank parse each item listed.
    -- Add spacing as needed and append
    -- to string 'tail '
    -- Send string to system
    --
    : TAIL
    CR
    PAD 0 OVER C!
    "tail " PAD append_at
    BEGIN BL WORD HERE
    1+ C@ WHILE HERE PAD append_at
    " " PAD append_at
    REPEAT /sys ;


    TAIL example
    --

    TAIL pad/txt/rubyatXLIX pad/txt/ovid pad/txt/wlan
    pad/txt/rubyatXLIX <==
    XLIX.
    Tis all a Chequer-board of Nights and Days,
    Where Destiny with Men for Pieces plays:
    Hither and thither moves, and mates, and slays,
    And one by one back in the Closet lays.

    pad/txt/ovid <==
    Dixit `ut auctoris sortem in contraria mutet,
    Nunc quoque vos feriam! percussis anguibus isdem
    Forma prior rediit genetivaque venit imago.
    Arbiter hic igitur sumptus de lite iocosa
    Dicta Iovis firmat; gravius Saturnia iusto
    Nec pro materia fertur doluisse suique
    Iudicis aeterna damnavit lumina nocte,
    At pater omnipotens (neque enim licet inrita cuiquam
    Facta dei fecisse deo) pro lumine adempto
    Scire futura dedit poenamque levavit honore.

    pad/txt/wlan <==
    April is the cruellest month, breeding
    Lilacs out of the dead land, mixing
    Memory and desire, stirring
    Dull roots with spring rain.

    PRCD ( "rcd" "filepath" -- )
    -- Pretty print record
    -- rcd Record title
    -- filepath Record file
    -- Note
    -- Forth word names can be used as record titles so
    -- escapes will be needed in many cases.
    -- PRCD checks the title and provides any needed escapes.
    --
    i. PRCD (CALL) pad/rtc.f -->

    [r] (CALL)
    : (CALL) R REF+ >RR< REF@ >R ;


    i. PRCD ./LREAD pad/fio.f -->

    [r] ./LREAD ( xt fam s -- )
    -- File line data read and process
    -- s string, name of input data file
    -- fam ( -- n ) file access method
    -- xt ( a u -- ) process line of input data
    : ./LREAD
    RTC BACK
    FCMN HDI FIO .CLOSE
    RTC TREK CUT:
    FCMN FIO ./OPEN HDI !
    .HDREAD
    ;


    RCDI ( "filepath" -- )
    -- List file records
    -- "filepath" record file
    --
    i. RCDI pad/zui -->

    [#] zui -- TOAD notes
    [r] Conflict of 'x and 'x ...'
    [r] *P and *A
    [r] Compiling state smart words.
    [r] null word
    [r] is
    [s]
    [r] USRINIT updates
    [r] Remove blank lines from edit scripts
    [r] TOAD OP WRKS
    [s]
    [r] MON
    [#] //
    i. PRCD MON pad/zui -->


    [r] MON
    -- MON ( "<dl>ccc<dl>" -- )
    -- Monitor
    : MON [compile] s /sys ;
    //
    MON is a parsing word like SYS but while SYS parses the rest of the
    line, MON parses a bounded string thereby allowing for comments, or
    more code, on the same line as the command:
    MON |command| \ comment
    Note "|" is the delimiter of the bounded string containing the command.
    For a bounded string any printable character may be used for the
    delimiter.

    -fin-
    OK
    ===
    The last record extracted can be found at /tmp/foo
    so load and use it.
    ===
    OK
    fload /tmp/foo OK
    ===( cr MON |(cd f;o rcdt aids.f bdisplay.f bktif.f)|)
    ===
    aids.f: [#] aids.f -- Development aids
    bdisplay.f: [#] bdisplay.f -- Back Display
    bktif.f: [#] bktif.f -- Bracket if

    === OK
    --
    me
    --- Synchronet 3.21f-Linux NewsLink 1.2
  • From Krishna Myneni@krishna.myneni@ccreweb.org to comp.lang.forth on Sat Apr 4 08:00:46 2026
    From Newsgroup: comp.lang.forth

    On 4/4/26 1:21 AM, sjack wrote:
    Krishna Myneni <krishna.myneni@ccreweb.org> wrote:
    In cases such as the TAIL example I gave earlier. For those case where
    you want to provide a Forth word to the user in the form

    <wordname> <file1> <file2> ...

    "proxy" /demo

    Demo Forth proxy for Bash command
    -- FigForth with Toad extensions
    --
    -- /SYS ( s -- )
    -- Send string to OS as a command.
    --
    -- APPEND_AT ( s1 s2 a -- s3 )
    -- At address 'a' append string 's2' to string 's2'
    -- push result as string 's3'.
    --
    -- "..." ( "<">ccc<">" -- s)
    -- Bounded string where double quotes are used as
    -- delimiters
    --
    -- TAIL ( filelist -- )
    -- Blank parse each item listed.
    -- Add spacing as needed and append
    -- to string 'tail '
    -- Send string to system

    Your parsing word here is WORD with a space delimiter, so standard
    PARSE-NAME should work here as well since you did not treat the case of
    file names with spaces. How would you extend this to the case where file
    names are allowed to have spaces?

    --
    Krishna


    --- Synchronet 3.21f-Linux NewsLink 1.2
  • From sjack@sjack@dontemail.me (sjack) to comp.lang.forth on Sat Apr 4 22:01:30 2026
    From Newsgroup: comp.lang.forth

    Krishna Myneni <krishna.myneni@ccreweb.org> wrote:

    Your parsing word here is WORD with a space delimiter, so standard PARSE-NAME should work here as well since you did not treat the case of
    file names with spaces. How would you extend this to the case where file names are allowed to have spaces?

    -- TAIL ( filelist -- )
    -- Blank parse each item listed.
    -- Add spacing as needed.
    -- Append to string 'tail ' and send to system
    --
    : TAIL
    CR
    PAD 0 OVER C!
    "tail " PAD append_at
    BEGIN BL WORD HERE
    1+ C@ WHILE HERE PAD append_at
    " " PAD append_at
    REPEAT /sys ;
    --
    -- You only need to enclose the nasty file name in single quotes.
    --

    tail pad/' nasty "name" file.f ' pad/txt/wlan pad/txt/ovid
    pad/ nasty "name" file.f <==
    This is a nasty named file. The file name needs to be quoted in
    single quotes.

    bye

    pad/txt/wlan <==
    April is the cruellest month, breeding
    Lilacs out of the dead land, mixing
    Memory and desire, stirring
    Dull roots with spring rain.

    pad/txt/ovid <==
    Dixit `ut auctoris sortem in contraria mutet,
    Nunc quoque vos feriam! percussis anguibus isdem
    Forma prior rediit genetivaque venit imago.
    Arbiter hic igitur sumptus de lite iocosa
    Dicta Iovis firmat; gravius Saturnia iusto
    Nec pro materia fertur doluisse suique
    Iudicis aeterna damnavit lumina nocte,
    At pater omnipotens (neque enim licet inrita cuiquam
    Facta dei fecisse deo) pro lumine adempto
    Scire futura dedit poenamque levavit honore.

    -fin-
    OK
    --
    me

    --- Synchronet 3.21f-Linux NewsLink 1.2
  • From dxf@dxforth@gmail.com to comp.lang.forth on Sun Apr 5 10:55:26 2026
    From Newsgroup: comp.lang.forth

    On 4/04/2026 12:23 am, dxf wrote:
    On 3/04/2026 8:44 pm, albert@spenarnc.xs4all.nl wrote:
    In article <69cf1078$1@news.ausics.net>, dxf <dxforth@gmail.com> wrote:
    An OS requires a valid filename. It's not for a Forth standard to
    specify or limit what that is - is all I'm saying. The standard
    violated that when it specified INCLUDE REQUIRE. I'd like to think
    the latter was an oversight but given certain statements made in
    this thread, I fear it wasn't.

    Not an oversight. An optional convenience that works in a great
    many cases.

    It would handle many more cases were it defined:

    11.6.2.1714 INCLUDE

    ( i*x “fname”–– j*x )

    Skip leading white space and parse fname delimited by a white space
    character. Push the address and length of the file name represented
    by fname on the stack and perform the function of INCLUDED


    2.2.3 Parsed-text notation

    Table 2.1: Parsed text abbreviations
    ...
    fname a token equivalent to name representing a file name.
    translation from fname to file name is implementation defined.

    This one is better worded should anyone wish to use it as a basis for a proposal.

    11.6.2.1714 INCLUDE

    ( i*x "fname"-- j*x )

    Skip leading white space and parse fname delimited by either a white
    space or an implementation defined character. Push the address and
    length of the file name represented by fname on the stack and perform
    the function of INCLUDED.


    11.6.2.2144.10 REQUIRE

    ( i*x "name"-- i*x )

    Skip leading white space and parse name delimited by either a white
    space or an implementation defined character. Push the address and
    length of the name on the stack and perform the function of REQUIRED.


    2.2.3 Parsed-text notation

    Table 2.1: Parsed text abbreviations
    ...
    fname a sequence of characters corresponding to the name of a file.
    the file name may be blank-delimited or enclosed by delimiter
    characters which are implementation defined. the format of
    the file name is implementation defined.


    --- Synchronet 3.21f-Linux NewsLink 1.2
  • From dxf@dxforth@gmail.com to comp.lang.forth on Sun Apr 5 11:50:39 2026
    From Newsgroup: comp.lang.forth

    On 5/04/2026 10:55 am, dxf wrote:
    ...
    This one is better worded should anyone wish to use it as a basis for a proposal.

    11.6.2.1714 INCLUDE

    ( i*x "fname"-- j*x )

    Skip leading white space and parse fname delimited by either a white
    space or an implementation defined character. Push the address and
    length of the file name represented by fname on the stack and perform
    the function of INCLUDED.


    11.6.2.2144.10 REQUIRE

    ( i*x "name"-- i*x )

    Skip leading white space and parse name delimited by either a white
    space or an implementation defined character. Push the address and
    length of the name on the stack and perform the function of REQUIRED.


    2.2.3 Parsed-text notation

    Table 2.1: Parsed text abbreviations
    ...
    fname a sequence of characters corresponding to the name of a file.
    the file name may be blank-delimited or enclosed by delimiter
    characters which are implementation defined. the format of
    the file name is implementation defined.

    REQUIRE definition has copy/paste errors. Use INCLUDE as the model.

    --- Synchronet 3.21f-Linux NewsLink 1.2
  • From dxf@dxforth@gmail.com to comp.lang.forth on Tue Apr 7 10:23:34 2026
    From Newsgroup: comp.lang.forth

    On 5/04/2026 8:01 am, sjack wrote:
    Krishna Myneni <krishna.myneni@ccreweb.org> wrote:

    Your parsing word here is WORD with a space delimiter, so standard
    PARSE-NAME should work here as well since you did not treat the case of
    file names with spaces. How would you extend this to the case where file
    names are allowed to have spaces?

    -- TAIL ( filelist -- )
    -- Blank parse each item listed.
    -- Add spacing as needed.
    -- Append to string 'tail ' and send to system
    : TAIL
    CR
    PAD 0 OVER C!
    "tail " PAD append_at
    BEGIN BL WORD HERE
    1+ C@ WHILE HERE PAD append_at
    " " PAD append_at
    REPEAT /sys ;
    -
    - You only need to enclose the nasty file name in single quotes.
    -

    tail pad/' nasty "name" file.f ' pad/txt/wlan pad/txt/ovid
    pad/ nasty "name" file.f <==
    This is a nasty named file. The file name needs to be quoted in
    single quotes.

    Wouldn't the blank delimited parse loop fail in the case of two or more consecutive spaces? Apparently this was the reason behind Forth Inc's
    change to FILENAME in 2006 to recognize " as delimiter.

    There's going to be uses for a dedicated filename parsing word such as
    FI's FILENAME that go beyond the Standard's chosen scope. In addition
    to RENAME DELETE in DX-Forth already mentioned, I have USING SAVE FLOAD
    and the command-line parser when forth first boots.

    --- Synchronet 3.21f-Linux NewsLink 1.2
  • From sjack@sjack@dontemail.me (sjack) to comp.lang.forth on Tue Apr 7 14:26:43 2026
    From Newsgroup: comp.lang.forth

    dxf <dxforth@gmail.com> wrote:
    Wouldn't the blank delimited parse loop fail in the case of two or more consecutive spaces? Apparently this was the reason behind Forth Inc's


    Nope.
    tail pad/' nasty "name" file ' pad/' yucky file '
    pad/ nasty "name" file <==

    pad/ yucky file <==
    OK
    Much spaces between the two above filepaths.
    The command line above is sent to Bash as one null terminated string,
    spaces and all, which Bash can handle.
    --
    me
    --- Synchronet 3.21f-Linux NewsLink 1.2
  • From sjack@sjack@dontemail.me (sjack) to comp.lang.forth on Tue Apr 7 15:05:41 2026
    From Newsgroup: comp.lang.forth

    sjack <sjack@dontemail.me> wrote:
    dxf <dxforth@gmail.com> wrote:
    Wouldn't the blank delimited parse loop fail in the case of two or more
    consecutive spaces? Apparently this was the reason behind Forth Inc's


    Nope.
    tail pad/' nasty "name" file ' pad/' yucky file '
    pad/ nasty "name" file <==

    pad/ yucky file <==
    OK
    Much spaces between the two above filepaths.
    The command line above is sent to Bash as one null terminated string,
    spaces and all, which Bash can handle.

    The answer is still 'no, not a problem' but the other comment of
    that command sent with spaces was not correct. However, sending
    the entered command using SYS would output the line, spaces and all,
    without a problem:

    sys tail ...pad/' nasty "name" file '......pad/' yucky file '

    (the dots represent spacing; used because usrnet collapes space)
    --
    me

    --- Synchronet 3.21f-Linux NewsLink 1.2
  • From sjack@sjack@dontemail.me (sjack) to comp.lang.forth on Tue Apr 7 17:09:23 2026
    From Newsgroup: comp.lang.forth

    sjack <sjack@dontemail.me> wrote:
    sjack <sjack@dontemail.me> wrote:
    dxf <dxforth@gmail.com> wrote:
    Wouldn't the blank delimited parse loop fail in the case of two or more
    consecutive spaces? Apparently this was the reason behind Forth Inc's

    anew job OK
    fload job
    -echo
    -- TAIL ( filelist -- )
    -- Blank parse each item listed.
    -- Add spacing as needed.
    -- Append to string 'tail ' and send to system
    --
    : TAILTAIL ISN'T UNIQUE

    CR
    PAD 0 OVER C!
    "tail " PAD append_at
    BEGIN BL WORD HERE
    dup i. cr tell
    1+ C@ WHILE HERE PAD append_at
    " " PAD append_at
    REPEAT cr i. tell ;

    tail pad/' bad file1 ' pad/' bad file2 '

    pad/' -->
    bad -->
    file1 -->
    ' -->
    pad/' -->
    bad -->
    file2 -->
    ' -->

    tail pad/' bad file1 ' pad/' bad file2 '


    -fin-
    OK
    ===
    You be right; There be problem with multiple spaces within the
    filespace; the spaces become collapsed.

    SYS parses a whole line; so no problem there.
    MON parses bounded string; so no problem there either.
    ===

    --
    me
    --- Synchronet 3.21f-Linux NewsLink 1.2
  • From dxf@dxforth@gmail.com to comp.lang.forth on Wed Apr 8 12:25:27 2026
    From Newsgroup: comp.lang.forth

    On 8/04/2026 3:09 am, sjack wrote:
    sjack <sjack@dontemail.me> wrote:
    sjack <sjack@dontemail.me> wrote:
    dxf <dxforth@gmail.com> wrote:
    Wouldn't the blank delimited parse loop fail in the case of two or more >>>> consecutive spaces? Apparently this was the reason behind Forth Inc's

    anew job OK
    fload job
    -echo
    -- TAIL ( filelist -- )
    -- Blank parse each item listed.
    -- Add spacing as needed.
    -- Append to string 'tail ' and send to system
    --
    : TAILTAIL ISN'T UNIQUE

    CR
    PAD 0 OVER C!
    "tail " PAD append_at
    BEGIN BL WORD HERE
    dup i. cr tell
    1+ C@ WHILE HERE PAD append_at
    " " PAD append_at
    REPEAT cr i. tell ;

    tail pad/' bad file1 ' pad/' bad file2 '

    pad/' -->
    bad -->
    file1 -->
    ' -->
    pad/' -->
    bad -->
    file2 -->
    ' -->

    tail pad/' bad file1 ' pad/' bad file2 '


    -fin-
    OK
    ===
    You be right; There be problem with multiple spaces within the
    filespace; the spaces become collapsed.

    SYS parses a whole line; so no problem there.
    MON parses bounded string; so no problem there either.
    ===

    A special word like GetPathSpec wouldn't have helped much (if at all)
    in the TAIL example which uses the OS to unmunge the filespec and
    perform the command.

    AFAICS GetPathSpec etc is useful only for executing forth functions,
    and even then use is likely to be limited. OTOH 200x elected to
    define parsing words INCLUDE REQUIRE which let the cat out of the bag.

    --- Synchronet 3.21f-Linux NewsLink 1.2
  • From Stephen Pelc@stephen@vfxforth.com to comp.lang.forth on Thu Apr 9 10:22:52 2026
    From Newsgroup: comp.lang.forth

    On 8 Apr 2026 at 04:25:27 CEST, "dxf" <dxforth@gmail.com> wrote:

    AFAICS GetPathSpec etc is useful only for executing forth functions,
    and even then use is likely to be limited. OTOH 200x elected to
    define parsing words INCLUDE REQUIRE which let the cat out of the bag.

    GetPathSpec is a Forth word. It is only useful where Forth words are useful.

    The cat has probably been chased away by the dog.

    Stephen
    --
    Stephen Pelc, stephen@vfxforth.com
    Wodni & Pelc GmbH
    Vienna, Austria
    Tel: +44 (0)7803 903612, +34 649 662 974 http://www.vfxforth.com/downloads/VfxCommunity/
    free VFX Forth downloads
    --- Synchronet 3.21f-Linux NewsLink 1.2
  • From Hans Bezemer@the.beez.speaks@gmail.com to comp.lang.forth on Sun Apr 12 19:37:12 2026
    From Newsgroup: comp.lang.forth

    On 01-04-2026 02:28, dxf wrote:
    What I object to are appeals
    to authority which apparently have caused otherwise sane people to do
    insane things.

    Agreed. Never outsource your ability to think, reason or decide. It were always the rebels that brought humanity forward, never the rulers.


    Hans Bezemer
    --- Synchronet 3.21f-Linux NewsLink 1.2
  • From Hans Bezemer@the.beez.speaks@gmail.com to comp.lang.forth on Sun Apr 12 19:44:25 2026
    From Newsgroup: comp.lang.forth

    On 31-03-2026 00:18, dxf wrote:
    LMAO. Woke up to discover Forth Inc has reverted to the standard's
    INCLUDE of 2006. It's worth repeating what they said in late 2006:

    SwiftForth 3.0.5 (22-Nov-2006)

    Changed the FILENAME parsing used by INCLUDE. Instead of repeatedly
    parsing for a space character and checking for file existence (which
    causes problems with file/directory name ambiguity), INCLUDE now uses
    the more standard technique of allowing optional double-quote delimited
    path names. The quotes are only required when the path name contains a
    space. In all other cases, this change has no impact.

    30 years after the world was introduced to filenames with spaces, forth
    does a taliban in favour of one that no longer exists.

    Was that the standard? Really? I'm already ashamed I must try to open an include file twice - because the $DIR4TH environment variable may be
    involved. ;-)

    No, the first space is the delimiter of the filename. Ik ben gekke
    Henkie niet..

    Hans Bezemer


    --- Synchronet 3.21f-Linux NewsLink 1.2
  • From dxf@dxforth@gmail.com to comp.lang.forth on Mon Apr 13 11:05:02 2026
    From Newsgroup: comp.lang.forth

    On 13/04/2026 3:44 am, Hans Bezemer wrote:
    On 31-03-2026 00:18, dxf wrote:
    LMAO.  Woke up to discover Forth Inc has reverted to the standard's
    INCLUDE of 2006.  It's worth repeating what they said in late 2006:

       SwiftForth 3.0.5 (22-Nov-2006)

       Changed the FILENAME parsing used by INCLUDE. Instead of repeatedly
       parsing for a space character and checking for file existence (which
       causes problems with file/directory name ambiguity), INCLUDE now uses >>    the more standard technique of allowing optional double-quote delimited >>    path names. The quotes are only required when the path name contains a >>    space. In all other cases, this change has no impact.

    30 years after the world was introduced to filenames with spaces, forth
    does a taliban in favour of one that no longer exists.

    Was that the standard? Really? I'm already ashamed I must try to open an include file twice - because the $DIR4TH environment variable may be involved. ;-)

    No, the first space is the delimiter of the filename. Ik ben gekke Henkie niet..

    I should mention that Forth Inc has back-flipped on their recent decision
    and restored what they had. User complaints?

    --- Synchronet 3.21f-Linux NewsLink 1.2
  • From Hans Bezemer@the.beez.speaks@gmail.com to comp.lang.forth on Tue Apr 14 14:45:00 2026
    From Newsgroup: comp.lang.forth

    On 13-04-2026 03:05, dxf wrote:
    On 13/04/2026 3:44 am, Hans Bezemer wrote:
    On 31-03-2026 00:18, dxf wrote:
    LMAO.  Woke up to discover Forth Inc has reverted to the standard's
    INCLUDE of 2006.  It's worth repeating what they said in late 2006:

       SwiftForth 3.0.5 (22-Nov-2006)

       Changed the FILENAME parsing used by INCLUDE. Instead of repeatedly >>>    parsing for a space character and checking for file existence (which >>>    causes problems with file/directory name ambiguity), INCLUDE now uses >>>    the more standard technique of allowing optional double-quote delimited
       path names. The quotes are only required when the path name contains a
       space. In all other cases, this change has no impact.

    30 years after the world was introduced to filenames with spaces, forth
    does a taliban in favour of one that no longer exists.

    Was that the standard? Really? I'm already ashamed I must try to open an include file twice - because the $DIR4TH environment variable may be involved. ;-)

    No, the first space is the delimiter of the filename. Ik ben gekke Henkie niet..

    I should mention that Forth Inc has back-flipped on their recent decision
    and restored what they had. User complaints?


    Probably. I mean - the problem with this "solution" is that you
    effectively need a SECOND delimiter - or blow up the compiler. Why, well
    look at this thingy:

    include lib/fp0.4tt include lib/zenfsqrt.4th

    Now - let's assume I specified the first filename incorrectly - so it
    won't load. Pull in "INCLUDE". No such luck. Pull in "lib/zenfsqrt.4th".
    Since it's "everything since "lib/fp0.4tt"" it won't load either. Etc. etc.

    Until EOF. Unless we artificially terminate this string at EOL.

    BTW, that's what I always hated about "\", but let's not go in there.
    The additional "terminator" Bernd introduced is an elegant kludge, but nonetheless - it breaks a lot of code.

    So - always did "INCLUDE" as it is specified:

    "Skip leading white space and parse name delimited by a white space
    character. Push the address and length of the name on the stack and
    perform the function of INCLUDED."

    .. except for the "INCLUDED" part, because 4tH doesn't have "INCLUDED" -
    not is inclusion done at runtime (but at compile time).

    Fallback is [NEEDS, which was even in 4tH *before* INCLUDE. Nowadays I'm
    an avid INCLUDE user. And that works for me because I don't like
    filenames with spaces. It makes my skin crawl. Most files are included
    through $DIR4TH - so even in Windows it doesn't bother me much. And I
    never got a report it bothered others. So...?

    Hans Bezemer


    --- Synchronet 3.21f-Linux NewsLink 1.2
  • From Hans Bezemer@the.beez.speaks@gmail.com to comp.lang.forth on Wed Apr 15 15:51:19 2026
    From Newsgroup: comp.lang.forth

    On 14-04-2026 14:45, Hans Bezemer wrote:
    I should mention that Forth Inc has back-flipped on their recent decision
    and restored what they had.  User complaints?

    Probably.

    What I meant here is that "user complaints" were probably the reason
    they rolled it back. *NOT* that the rollback *CAUSED* user complaints.

    I thought I should clarify that. ;-)

    Hans Bezemer

    --- Synchronet 3.21f-Linux NewsLink 1.2