🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.lang.forth
Article #278

Re: $trings

#278
From: Hans Bezemer
Date: Wed, 02 Dec 2026 15:16
64 lines
4211 bytes
On 01-12-2026 09:09, Anton Ertl wrote:
> Forthunately, the designers of Forth-94 already recognized this over
> three decades ago, and focussed on the c-addr u representation, with
> only a few words existing for dealing with the counted-string legacy.
> 
>> With great pleasure I see that Gforth has adopted the use of a cell
>> to store the count of a string, officially.
>> $@ replaces COUNT.
> 
> Not really, as explained below.
> 
>> $! has no equivalent in brain damaged strings
> 
> Exactly.
> 
> The $tring implementation differs from COUNTed strings in more than
> just the count size.

Well, it's a beautiful day, let's start another flame war over strings. 
Because, although everyone still curses "counted strings", it's the only 
accepted "standard". You know, the only words you need for a string are:
1. COUNT;
2. PLACE;
3. +PLACE.

And it's easy to prove -- they're the only words I got and it works 
FINE! Okay, if you really want to may be a word like C>S to convert a 
character to a valid string. But that's it. And it works for all well 
designed Forth programs.

And how did I do that? Simply by abstracting the whole thing. As long as 
you don't use COUNT to increment a string pointer and fetch the next 
character -- but simply return the string in addr/u form, we're fine -- 
no matter how your string is formed.

We could have arranged that ages ago. Fortunately, you didn't use S@, S! 
and S+! - because I'd very much like to see an abstracted string design, 
where all the schools are united -- no matter whether they use counted 
strings with a character, counted strings with a cell, ASCIIZ characters 
(like little me), counted ASCIIZ strings with a character or counted 
ASCIIZ strings with a cell, we're finally all brothers. We can use S! 
and can be assured our addr/u string is securely saved -- no matter what 
hides under the hood.

Because -- no matter how much I love addr/u, under ANS-Forth (or its 
2012 variant), there is still no standard way to store a string. Unless 
you want to get your hands very, very dirty.

Note I *really* have no problem. I've used ASCIIZ strings since 4tH's 
inception -- for the very simple reason 4tH has a tight connection with 
C. Now, you're free to condemn ASCIIZ strings till kingdom come, but for 
me it has worked fine. COUNT returns *EXACTLY* what is required, so I 
have no problem (PLACE and +PLACE aren't defined in ANS-Forth -- so I 
can pretty much do what I want).

But what amazes me is that after fifty years people still lose URLs in 
counted strings. I mean -- can't we really define a lousy three words 
and make everyone happy?

And again -- I'm not saying that for me. I fired my shot and it went out 
like a candle in the night. And I don't have no problem -- as I stated. 
Things are fine. Forthers must REALLY love their problems! :-)

Hans Bezemer
Technical Details
Message-ID: <11epcob$35ubv$1@dont-email.me>
Path: mbox-mo1.pugleaf.net!srv.newsdeef.eu.MISMATCH!feed-us-txt.newsdeef.eu!feed-us-ny.newsdeef.eu!srv.newsdeef.eu!news.hispagatos.org!eternal-september.org!feeder.eternal-september.org!nntp.eternal-september.org!.POSTED!not-for-mail
References: <nnd$2790af4d$71f56696@06eb3ea8c34cc53c> <2026Dec1.090920@mips.complang.tuwien.ac.at>

Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!srv.newsdeef.eu.MISMATCH!feed-us-txt.newsdeef.eu!feed-us-ny.newsdeef.eu!srv.newsdeef.eu!news.hispagatos.org!eternal-september.org!feeder.eternal-september.org!nntp.eternal-september.org!.POSTED!not-for-mail
From: Hans Bezemer <the.beez.speaks@gmail.com>
Newsgroups: comp.lang.forth
Subject: Re: $trings
Date: Wed, 2 Dec 2026 16:16:26 +0100
Organization: A noiseless patient Spider
Lines: 64
Message-ID: <11epcob$35ubv$1@dont-email.me>
References: <nnd$2790af4d$71f56696@06eb3ea8c34cc53c>
 <2026Dec1.090920@mips.complang.tuwien.ac.at>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Wed, 02 Dec 2026 15:16:28 +0000 (UTC)
Injection-Info: dont-email.me;
	logging-data="3340671"; mail-complaints-to="abuse@eternal-september.org";	posting-account="U2FsdGVkX1+YjjLI5uNRxf2+kqJf5kAR"; posting-host="2e10b2584a9d8eca19631fdb169e5790"
User-Agent: Mozilla Thunderbird
Cancel-Lock: sha1:mU6pXt7sPhTzv9si6nKuZw8+Tcw= sha256:+OG5WtuyyfIXTZmEMcrPprdXmYT0sHJXVSC8Pl0jJyU=
	sha1:t3OJSZn4YRT+doULFar8Zpzgl0Q= sha256:tmCfx320SZRkfdB3/kgZ9qN7+t+Q+4XP3D2InRIDzaQ=
In-Reply-To: <2026Dec1.090920@mips.complang.tuwien.ac.at>
Content-Language: en-US