Date: Wed, 1 Apr 2026 12:22:39 +1100 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: Parsing a file name with spaces Newsgroups: comp.lang.forth References: <10pu4t0$12cqm$1@dont-email.me> <10puc64$15opg$1@dont-email.me> <10q0tk0$21j3r$1@dont-email.me> <2026Mar25.175617@mips.complang.tuwien.ac.at> <10q1g61$28qpv$1@dont-email.me> <2026Mar28.195901@mips.complang.tuwien.ac.at> <69c86e47$1@news.ausics.net> <2026Mar29.112438@mips.complang.tuwien.ac.at> <69c90800$1@news.ausics.net> <2026Mar29.180818@mips.complang.tuwien.ac.at> <69c9a8fe$1@news.ausics.net> <69caf6c3@news.ausics.net> <10qf8nr$2vaat$1@dont-email.me> <69cb3c29$1@news.ausics.net> <2026Mar31.093620@mips.complang.tuwien.ac.at> Content-Language: en-GB From: dxf In-Reply-To: <2026Mar31.093620@mips.complang.tuwien.ac.at> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit NNTP-Posting-Host: news.ausics.net Message-ID: <69cc7360@news.ausics.net> Organization: Ausics - https://newsgroups.ausics.net Lines: 41 X-Complaints: abuse@ausics.net Path: csiph.com!news.samoylyk.net!news.ausics.net!not-for-mail Xref: csiph.com comp.lang.forth:134830 On 31/03/2026 6:36 pm, Anton Ertl wrote: > dxf 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?