Rocksolid Light

Welcome to novaBBS (click a section below)

mail  files  register  newsreader  groups  login

Message-ID:  

Garbage In, Gospel Out


devel / comp.lang.forth / a few strings and ipc

SubjectAuthor
* a few strings and ipcS Jack
`* Re: a few strings and ipcS Jack
 `* Re: a few strings and ipcKrishna Myneni
  +- Re: a few strings and ipcKrishna Myneni
  `* Re: a few strings and ipcS Jack
   `* Re: a few strings and ipcKrishna Myneni
    `* Re: a few strings and ipcS Jack
     `- Re: a few strings and ipcS Jack

1
a few strings and ipc

<32473cf9-9773-4e7b-9603-0783a7405cc9n@googlegroups.com>

 copy mid

https://www.novabbs.com/devel/article-flat.php?id=16805&group=comp.lang.forth#16805

 copy link   Newsgroups: comp.lang.forth
X-Received: by 2002:a05:600c:1f14:b0:37b:c475:2de0 with SMTP id bd20-20020a05600c1f1400b0037bc4752de0mr168102wmb.70.1645052519022;
Wed, 16 Feb 2022 15:01:59 -0800 (PST)
X-Received: by 2002:a37:d281:0:b0:479:cd57:7c84 with SMTP id
f123-20020a37d281000000b00479cd577c84mr55680qkj.485.1645052518812; Wed, 16
Feb 2022 15:01:58 -0800 (PST)
Path: i2pn2.org!i2pn.org!aioe.org!news.uzoreto.com!feeder1.cambriumusenet.nl!feed.tweak.nl!209.85.128.88.MISMATCH!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.forth
Date: Wed, 16 Feb 2022 15:01:58 -0800 (PST)
Injection-Info: google-groups.googlegroups.com; posting-host=2600:1700:3f7a:20d0:2da1:513d:d104:bd3d;
posting-account=V5nGoQoAAAC_P2U0qnxm2kC0s1jNJXJa
NNTP-Posting-Host: 2600:1700:3f7a:20d0:2da1:513d:d104:bd3d
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <32473cf9-9773-4e7b-9603-0783a7405cc9n@googlegroups.com>
Subject: a few strings and ipc
From: sdwjac...@gmail.com (S Jack)
Injection-Date: Wed, 16 Feb 2022 23:01:59 +0000
Content-Type: text/plain; charset="UTF-8"
 by: S Jack - Wed, 16 Feb 2022 23:01 UTC

:) frogd
ELF32X86_64 Frog Version 1.0d

"~/cdrom/books" wa ok ( place text in string var SWA )
sys:bash ok ( assign Bash as system shell )
swa /ls ( tell Bash to list directory )
aeschyls bronte_e confucus firdausi hubbard lincoln pascal tacitus
aesop buddha crane france hume locke plato the_cid
alcott bulfinch dana franklin ibsen london plotinus thoreau
andersen bulwer_l darwin galen ireland longfell plutarch thucydds
antonius burke defoe gassett irving machiavl poe tolstoy
aristotl burton dickens giovanni james magna_ca prescott twain
arstphns butler dictonry goethe japanese marx roosevel un
augustin byron dostvsky gov_doc japan_no melville rousseau verne
austen carrol douglass gray jeffersn mill s_court virgil
bacon carus doyle hammurab kant milton shakespr voltaire
barrie cather dreiser hardy keats montaign shelley wallac_a
bastiat census dumas hawthorn kennedy moore_c shirazi wallac_l
baum cervants egyptian herland khyyam mormon smith wells
behn chaucer eliot herodots king movies sophocle whitman
berkeley churchhl emerson hindu kipling nietzsch spenser wilde
bible_1 cia epictets hippcrts koran orczy stoker wollstnc
bible_2 coleridg euripids hobbes legal ovid summers x.bat
bronte_c computer fielding homer leibniz paine swift yeats_wb
ok
swa pad smv ok ( prep PAD to build up string )
"/poe" pad s+ ok ( append sub-directory )
pad /ls
00_index.txt coliseum for_anni l_breath m_roget romance the_man
a_g_pym con_worm four_bea lenore ms_in_bo scenes to__1
al_aaraf criticis f_s__o_d l_garden murders schehera to__2
alone d_belfry gold_bug ligeia mystific science to_river
a_mummy diddling happiest lionizng neverbet serenade to_zante
angel dream haunted l_life_t oblong_b shadow tt_heart
annabel dreamlan helen_1 m__ omlette silence ulalame
arnheim dreams helen_2 maelstrm paradise silence2 used_up
assignat dream_wi hop_frog manos_un paragrab sleeper usher
balloon eiros_ch how_to_w marginal p_burial song valdemar
bells eldorado h_phaall m_crowd pit_pend spectacl valentin
berenice eleonora hymn mellonta p_letter sphinx valley_u
blackcat elizabet imp_perv mesmeric portrait spirits von_kemp
bon_bon enigma island_f metzengr predicam stanzas whyhand
bridal eulalie israfel mls p_words sundays w_wilson
business eve_star jerusalm morella ragged_m system
cask_amo f__ kingpest morning raven tamerlan
city_sea fairylan landors mother reddeath the_lake
ok
"/song" pad s+ ok ( append file )
pad /cat
1827
SONG
by Edgar Allan Poe
SONG

I saw thee on thy bridal day-
When a burning blush came o'er thee,
Though happiness around thee lay,
The world all love before thee:

And in thine eye a kindling light
(Whatever it might be)
Was all on Earth my aching sight
Of Loveliness could see.

That blush, perhaps, was maiden shame-
As such it well may pass-
Though its glow hath raised a fiercer flame
In the breast of him, alas!

Who saw thee on that bridal day,
When that deep blush would come o'er thee,
Though happiness around thee lay;
The world all love before thee.

-THE END-
ok

Re: a few strings and ipc

<2b3d8cea-6357-4f68-bdcf-6892b306a73en@googlegroups.com>

 copy mid

https://www.novabbs.com/devel/article-flat.php?id=16823&group=comp.lang.forth#16823

 copy link   Newsgroups: comp.lang.forth
X-Received: by 2002:adf:fa92:0:b0:1e7:e760:49dd with SMTP id h18-20020adffa92000000b001e7e76049ddmr2574581wrr.99.1645108691679;
Thu, 17 Feb 2022 06:38:11 -0800 (PST)
X-Received: by 2002:a05:620a:170b:b0:4b2:acf5:d06a with SMTP id
az11-20020a05620a170b00b004b2acf5d06amr1730524qkb.327.1645108691114; Thu, 17
Feb 2022 06:38:11 -0800 (PST)
Path: i2pn2.org!i2pn.org!weretis.net!feeder6.news.weretis.net!news.misty.com!border2.nntp.dca1.giganews.com!nntp.giganews.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.forth
Date: Thu, 17 Feb 2022 06:38:10 -0800 (PST)
In-Reply-To: <32473cf9-9773-4e7b-9603-0783a7405cc9n@googlegroups.com>
Injection-Info: google-groups.googlegroups.com; posting-host=2600:1700:3f7a:20d0:2da1:513d:d104:bd3d;
posting-account=V5nGoQoAAAC_P2U0qnxm2kC0s1jNJXJa
NNTP-Posting-Host: 2600:1700:3f7a:20d0:2da1:513d:d104:bd3d
References: <32473cf9-9773-4e7b-9603-0783a7405cc9n@googlegroups.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <2b3d8cea-6357-4f68-bdcf-6892b306a73en@googlegroups.com>
Subject: Re: a few strings and ipc
From: sdwjac...@gmail.com (S Jack)
Injection-Date: Thu, 17 Feb 2022 14:38:11 +0000
Content-Type: text/plain; charset="UTF-8"
Lines: 36
 by: S Jack - Thu, 17 Feb 2022 14:38 UTC

Bash has nice string assignments:
bar="some variables."
foo="Some text mixed with ${bar}"
echo ${foo} #==> Some text mixed with some variables.
Very straight forward.

In Forth to do the same:
create mBAR 100 allot
c" some variables." dup count mBAR place value ${bar}
create mFOO 100 allot
c" Some text mixed with " dup count mFOO place value ${foo}
${foo} ${bar} append \ assume this works
${foo} count type \ ==> Some text mixed with some variables.
Kind of clunky.

Frog tries to make it a little smoother:
"Some text mixed with " wa "some variables." ga s+ tell
\ ==> Some text mixed with some variables.

wa ( s -- swa ) \ place string s in string variable swa
ga ( s -- sga) \ place string s in string variable sga
s+ ( s1 s2 -- s1' ) \ append string s2 to string s1

I changed these from what I had been using, as seen in previous post.
Destination string is placed first and all return string.

With destination string first and always returned, it can stay on the
the stack accumulating data for multiple operations:
"Today's date: " wa
getdate s+
"and temperatue is" s+
gettemp s+
asc . c+
tell \ Today's date: 01/01/2525 and temperature is 50C.
--
me

Re: a few strings and ipc

<sulu4k$bal$1@dont-email.me>

 copy mid

https://www.novabbs.com/devel/article-flat.php?id=16825&group=comp.lang.forth#16825

 copy link   Newsgroups: comp.lang.forth
Path: i2pn2.org!i2pn.org!eternal-september.org!reader02.eternal-september.org!.POSTED!not-for-mail
From: krishna....@ccreweb.org (Krishna Myneni)
Newsgroups: comp.lang.forth
Subject: Re: a few strings and ipc
Date: Thu, 17 Feb 2022 10:46:10 -0600
Organization: A noiseless patient Spider
Lines: 53
Message-ID: <sulu4k$bal$1@dont-email.me>
References: <32473cf9-9773-4e7b-9603-0783a7405cc9n@googlegroups.com>
<2b3d8cea-6357-4f68-bdcf-6892b306a73en@googlegroups.com>
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Thu, 17 Feb 2022 16:46:12 -0000 (UTC)
Injection-Info: reader02.eternal-september.org; posting-host="7ad11c5406c9b2689267ce23e55e6c53";
logging-data="11605"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18AiWDLQGhiElRFvG07FUzj"
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101
Thunderbird/91.4.0
Cancel-Lock: sha1:YHbfzBQ8ncZqbcIfTUeAKncIS7A=
In-Reply-To: <2b3d8cea-6357-4f68-bdcf-6892b306a73en@googlegroups.com>
Content-Language: en-US
 by: Krishna Myneni - Thu, 17 Feb 2022 16:46 UTC

On 2/17/22 08:38, S Jack wrote:
> Bash has nice string assignments:
> bar="some variables."
> foo="Some text mixed with ${bar}"
> echo ${foo} #==> Some text mixed with some variables.
> Very straight forward.
>
> In Forth to do the same:
> create mBAR 100 allot
> c" some variables." dup count mBAR place value ${bar}
> create mFOO 100 allot
> c" Some text mixed with " dup count mFOO place value ${foo}
> ${foo} ${bar} append \ assume this works
> ${foo} count type \ ==> Some text mixed with some variables.
> Kind of clunky.
>
....You may easily define string words to accomplish this in standard
Forth, so that you can write,

---
s" some variables" $constant bar
ok
s" Some text mixed with " $constant foo
ok
foo bar strcat type
Some text mixed with some variables ok
---

In the above, $CONSTANT is 2CONSTANT in standard Forth and STRCAT has
the same effect as your S+, but uses a circular string buffer. STRCAT
returns the new string address and count on the stack so that you can
perform a series of string concatenations, e.g.

str1 str2 STRCAT str3 STRCAT str4 STRCAT ...

There is no need even to keep strings in string variables, i.e. you can
simply use STRCAT (or call it S+ if you prefer) in the following way,

s" Some text mixed with some variables"
s" some variables" STRCAT
getdate ( a word which returns a caddr count pair ) STRCAT
s" and the temperature is " STRCAT
gettemp ( another word which returns a string ) STRCAT
TYPE

The default size of the circular string buffer is 16K, and I have never
had a need, so far, to increase this size in practice.

kForth32/64 provides various circular buffer string words in strings.4th.

--
Krishna

Re: a few strings and ipc

<sulurb$qff$1@dont-email.me>

 copy mid

https://www.novabbs.com/devel/article-flat.php?id=16826&group=comp.lang.forth#16826

 copy link   Newsgroups: comp.lang.forth
Path: i2pn2.org!i2pn.org!eternal-september.org!reader02.eternal-september.org!.POSTED!not-for-mail
From: krishna....@ccreweb.org (Krishna Myneni)
Newsgroups: comp.lang.forth
Subject: Re: a few strings and ipc
Date: Thu, 17 Feb 2022 10:58:17 -0600
Organization: A noiseless patient Spider
Lines: 65
Message-ID: <sulurb$qff$1@dont-email.me>
References: <32473cf9-9773-4e7b-9603-0783a7405cc9n@googlegroups.com>
<2b3d8cea-6357-4f68-bdcf-6892b306a73en@googlegroups.com>
<sulu4k$bal$1@dont-email.me>
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
Injection-Date: Thu, 17 Feb 2022 16:58:20 -0000 (UTC)
Injection-Info: reader02.eternal-september.org; posting-host="7ad11c5406c9b2689267ce23e55e6c53";
logging-data="27119"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+Mr0YOUNJz/hEiWvY1d6pi"
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101
Thunderbird/91.4.0
Cancel-Lock: sha1:WN8w7tlAwLbJz7cNZTII93fYVy8=
In-Reply-To: <sulu4k$bal$1@dont-email.me>
Content-Language: en-US
 by: Krishna Myneni - Thu, 17 Feb 2022 16:58 UTC

On 2/17/22 10:46, Krishna Myneni wrote:
> On 2/17/22 08:38, S Jack wrote:
>> Bash has nice string assignments:
>>     bar="some variables."
>>     foo="Some text mixed with ${bar}"
>>     echo ${foo}   #==> Some text mixed with some variables.
>> Very straight forward.
>>
>> In Forth to do the same:
>>     create mBAR 100 allot
>>     c" some variables." dup count mBAR place value ${bar}
>>     create mFOO 100 allot
>>     c" Some text mixed with " dup count mFOO place value ${foo}
>>     ${foo} ${bar} append   \ assume this works
>>     ${foo} count type      \ ==> Some text mixed with some variables.
>> Kind of clunky.
>>
> ...You may easily define string words to accomplish this in standard
> Forth, so that you can write,
>
> ---
> s" some variables" $constant bar
>  ok
> s" Some text mixed with " $constant foo
>  ok
> foo bar strcat type
> Some text mixed with some variables ok
> ---
>
> In the above, $CONSTANT is 2CONSTANT in standard Forth and STRCAT has
> the same effect as your S+, but uses a circular string buffer. STRCAT
> returns the new string address and count on the stack so that you can
> perform a series of string concatenations, e.g.
>
> str1 str2 STRCAT  str3 STRCAT str4 STRCAT ...
>
> There is no need even to keep strings in string variables, i.e. you can
> simply use STRCAT (or call it S+ if you prefer) in the following way,
>
> s" Some text mixed with some variables"
> s" some variables" STRCAT
> getdate   ( a word which returns a caddr count pair ) STRCAT
> s" and the temperature is " STRCAT
> gettemp   ( another word which returns a string )  STRCAT
> TYPE
>
....

I should mention that S" in the CORE word set has no interpretation
semantics; however, in Forth 2012, the File Access word set 11.6.1.2165
extends S" to have interpretations semantics to place the string in a
transient buffer.

A correction to my previous post: In kForth, S" strings declared in
interpretation state have guaranteed storage, but this is not true of
standard Forth. Thus $CONSTANT is not the same as 2CONSTANT in standard
Forth -- it should be defined to provide persistent storage for string
constants in standard Forth.

The point is that standard Forth will allow you to define the string
operations you want to use.

--
Krishna

Re: a few strings and ipc

<522c15b0-4bca-4ab1-87b9-beda1edf08d0n@googlegroups.com>

 copy mid

https://www.novabbs.com/devel/article-flat.php?id=16829&group=comp.lang.forth#16829

 copy link   Newsgroups: comp.lang.forth
X-Received: by 2002:adf:f001:0:b0:1e4:b7b1:87c1 with SMTP id j1-20020adff001000000b001e4b7b187c1mr3282521wro.238.1645120255606;
Thu, 17 Feb 2022 09:50:55 -0800 (PST)
X-Received: by 2002:a05:620a:170b:b0:4b2:acf5:d06a with SMTP id
az11-20020a05620a170b00b004b2acf5d06amr2357346qkb.327.1645120255386; Thu, 17
Feb 2022 09:50:55 -0800 (PST)
Path: i2pn2.org!i2pn.org!weretis.net!feeder6.news.weretis.net!1.us.feeder.erje.net!feeder.erje.net!border1.nntp.dca1.giganews.com!nntp.giganews.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.forth
Date: Thu, 17 Feb 2022 09:50:55 -0800 (PST)
In-Reply-To: <sulu4k$bal$1@dont-email.me>
Injection-Info: google-groups.googlegroups.com; posting-host=2600:1700:3f7a:20d0:f99b:bb0a:1cf7:5894;
posting-account=V5nGoQoAAAC_P2U0qnxm2kC0s1jNJXJa
NNTP-Posting-Host: 2600:1700:3f7a:20d0:f99b:bb0a:1cf7:5894
References: <32473cf9-9773-4e7b-9603-0783a7405cc9n@googlegroups.com>
<2b3d8cea-6357-4f68-bdcf-6892b306a73en@googlegroups.com> <sulu4k$bal$1@dont-email.me>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <522c15b0-4bca-4ab1-87b9-beda1edf08d0n@googlegroups.com>
Subject: Re: a few strings and ipc
From: sdwjac...@gmail.com (S Jack)
Injection-Date: Thu, 17 Feb 2022 17:50:55 +0000
Content-Type: text/plain; charset="UTF-8"
Lines: 30
 by: S Jack - Thu, 17 Feb 2022 17:50 UTC

On Thursday, February 17, 2022 at 10:46:14 AM UTC-6, Krishna Myneni wrote:
>
> In the above, $CONSTANT is 2CONSTANT in standard Forth and STRCAT has
> the same effect as your S+, but uses a circular string buffer. STRCAT
> returns the new string address and count on the stack so that you can
> perform a series of string concatenations, e.g.
>
> str1 str2 STRCAT str3 STRCAT str4 STRCAT ...
>
> There is no need even to keep strings in string variables, i.e. you can
> simply use STRCAT (or call it S+ if you prefer) in the following way,
>
> s" Some text mixed with some variables"
> s" some variables" STRCAT
> getdate ( a word which returns a caddr count pair ) STRCAT
> s" and the temperature is " STRCAT
> gettemp ( another word which returns a string ) STRCAT
> TYPE
>
>
> The default size of the circular string buffer is 16K, and I have never
> had a need, so far, to increase this size in practice.
>

Tks Krishna, good input.
When I enter a string, it goes to a ring buffer for some persistence. But it's then a fixed size so I had to be careful not
to try and append into it. I assume your STRCAT copies both strings to the new string area which is ok by me.
SWA and SGA are working string variables of maximum size, 256 bytes (byte counted strings are my norm). Once a string
is loaded into it only the appended string needs to be moved. I also use S+ for building strings in PAD, MPAD or wherever.
--
me

Re: a few strings and ipc

<sun68s$ccu$1@dont-email.me>

 copy mid

https://www.novabbs.com/devel/article-flat.php?id=16833&group=comp.lang.forth#16833

 copy link   Newsgroups: comp.lang.forth
Path: i2pn2.org!i2pn.org!eternal-september.org!reader02.eternal-september.org!.POSTED!not-for-mail
From: krishna....@ccreweb.org (Krishna Myneni)
Newsgroups: comp.lang.forth
Subject: Re: a few strings and ipc
Date: Thu, 17 Feb 2022 22:11:06 -0600
Organization: A noiseless patient Spider
Lines: 56
Message-ID: <sun68s$ccu$1@dont-email.me>
References: <32473cf9-9773-4e7b-9603-0783a7405cc9n@googlegroups.com>
<2b3d8cea-6357-4f68-bdcf-6892b306a73en@googlegroups.com>
<sulu4k$bal$1@dont-email.me>
<522c15b0-4bca-4ab1-87b9-beda1edf08d0n@googlegroups.com>
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Fri, 18 Feb 2022 04:11:08 -0000 (UTC)
Injection-Info: reader02.eternal-september.org; posting-host="633859354ddce5fcc7217e11deb4091c";
logging-data="12702"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+kwx3r/ja3KZcAStwz7O+M"
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101
Thunderbird/91.4.0
Cancel-Lock: sha1:Qcovt4iP7LJBFRWvHx0hCL7tzec=
In-Reply-To: <522c15b0-4bca-4ab1-87b9-beda1edf08d0n@googlegroups.com>
Content-Language: en-US
 by: Krishna Myneni - Fri, 18 Feb 2022 04:11 UTC

On 2/17/22 11:50, S Jack wrote:
> On Thursday, February 17, 2022 at 10:46:14 AM UTC-6, Krishna Myneni wrote:
>>
>> In the above, $CONSTANT is 2CONSTANT in standard Forth and STRCAT has
>> the same effect as your S+, but uses a circular string buffer. STRCAT
>> returns the new string address and count on the stack so that you can
>> perform a series of string concatenations, e.g.
>>
>> str1 str2 STRCAT str3 STRCAT str4 STRCAT ...
>>
>> There is no need even to keep strings in string variables, i.e. you can
>> simply use STRCAT (or call it S+ if you prefer) in the following way,
>>
>> s" Some text mixed with some variables"
>> s" some variables" STRCAT
>> getdate ( a word which returns a caddr count pair ) STRCAT
>> s" and the temperature is " STRCAT
>> gettemp ( another word which returns a string ) STRCAT
>> TYPE
>>
>>
>> The default size of the circular string buffer is 16K, and I have never
>> had a need, so far, to increase this size in practice.
>>
>
> Tks Krishna, good input.
> When I enter a string, it goes to a ring buffer for some persistence. But it's then a fixed size so I had to be careful not
> to try and append into it. I assume your STRCAT copies both strings to the new string area which is ok by me.

Yes, the appended string is placed in the circular buffer, even if both
strings have addresses within the buffer.

> SWA and SGA are working string variables of maximum size, 256 bytes (byte counted strings are my norm). Once a string
> is loaded into it only the appended string needs to be moved.

So the appended string has to be within the 256 byte limit of a
byte-counted string. This can be a bit too restrictive for general
purpose use. Strings represented by an address, count pair (like those
compiled by S" ) are better for general purpose use. I do still use C"
strings quite a bit, though.

The entire circular buffer code and its words are portable to standard
Forth and may be found at the link below.

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

Not all of the code in the file is relevant. The string buffer words are
somewhat ugly but have been used successfully for a couple of decades
now. The word names, STRCPY STRCAT STRPCK etc. originate from LMI Forths.

Cheers,
Krishna

Re: a few strings and ipc

<2686421a-d7e9-47ad-9217-81d2815c7efen@googlegroups.com>

 copy mid

https://www.novabbs.com/devel/article-flat.php?id=16840&group=comp.lang.forth#16840

 copy link   Newsgroups: comp.lang.forth
X-Received: by 2002:adf:f689:0:b0:1e6:88bf:8ac8 with SMTP id v9-20020adff689000000b001e688bf8ac8mr7105248wrp.189.1645212215383;
Fri, 18 Feb 2022 11:23:35 -0800 (PST)
X-Received: by 2002:ae9:ef09:0:b0:506:aadb:1f1b with SMTP id
d9-20020ae9ef09000000b00506aadb1f1bmr5705865qkg.609.1645212214896; Fri, 18
Feb 2022 11:23:34 -0800 (PST)
Path: i2pn2.org!i2pn.org!weretis.net!feeder8.news.weretis.net!proxad.net!feeder1-2.proxad.net!209.85.128.88.MISMATCH!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.forth
Date: Fri, 18 Feb 2022 11:23:34 -0800 (PST)
In-Reply-To: <sun68s$ccu$1@dont-email.me>
Injection-Info: google-groups.googlegroups.com; posting-host=2600:1700:3f7a:20d0:704d:23e7:b644:733;
posting-account=V5nGoQoAAAC_P2U0qnxm2kC0s1jNJXJa
NNTP-Posting-Host: 2600:1700:3f7a:20d0:704d:23e7:b644:733
References: <32473cf9-9773-4e7b-9603-0783a7405cc9n@googlegroups.com>
<2b3d8cea-6357-4f68-bdcf-6892b306a73en@googlegroups.com> <sulu4k$bal$1@dont-email.me>
<522c15b0-4bca-4ab1-87b9-beda1edf08d0n@googlegroups.com> <sun68s$ccu$1@dont-email.me>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <2686421a-d7e9-47ad-9217-81d2815c7efen@googlegroups.com>
Subject: Re: a few strings and ipc
From: sdwjac...@gmail.com (S Jack)
Injection-Date: Fri, 18 Feb 2022 19:23:35 +0000
Content-Type: text/plain; charset="UTF-8"
 by: S Jack - Fri, 18 Feb 2022 19:23 UTC

On Thursday, February 17, 2022 at 10:11:10 PM UTC-6, Krishna Myneni wrote:
> So the appended string has to be within the 256 byte limit of a
> byte-counted string. This can be a bit too restrictive for general
> purpose use. Strings represented by an address, count pair (like those

Just because byte-counted strings are my norm does not mean I'm
restricted to them. I handle strings of all sizes and variety of
types:
i. enclosed string "..." ( -- s) \ byte-counted string
i. counted string s" ..." ( -- a u ) \ byte-counted string
i. zstring z" ..." ( -- z ) \ null-terminated
i. bounded string ( a1 a2 ) \ string start and stop addresses
i. gstring g" ..." ( -- g ) \ generic string a.k.a. ANS string
The 'g' designation stands for an address and count 'a u';
The generic string does not imply any type of storage structure.
i. xstring x" ..." ( -- g ) \ string with cell count
Same as gstring but implies a leading cell count.
(Never used to date; don't expect to ever use. Just made up a name;
don't hold me to it.)
i. string variables ( -- sv)
String structure with a leading cell of max string size.
i. string headers ( -- gh )
3 cell structure: max, count and address
The 'gh' designation stands for the structure's address (at its count).
String headers are powerful, can turn the whole dictionary into
one big string. However, not general used because of the 3 cells
of overhead.

The byte-counted string is the norm because of its low overhead in storage
and on stack and it handles much of the run-of-the-mill string operations:
manual string manipulating, error messages and system commands.
My goto words are built to take counted strings but most are built upon words
that take a gstring. For example, to evaluate a string that I type in or have
compiled into a word, I use EVAL but I can also evaluate a large string with
GEVAL . EVAL gets used often, GEVAL seldom.

Zstrings are found in environment variables and used in system calls.

The gstring is used often for general slicing and dicing allowing
work with long string size.

The bounded string is mostly use in string composition allowing nested
compositions to share the same string space while being constructed.

String variables used mostly for working strings.

String headers are used with allocated buffers for dialog boxes.

Uni-code strings exist only for application output; not used
in internal code. ( don't expect to ever use. )

PS:
WA and GA are for working only; not used in code other than test code.

None of this pertains to standard Forth; just a FYI for what I'm doing.

> The entire circular buffer code and its words are portable to standard
> Forth and may be found at the link below.
>
> https://github.com/mynenik/kForth-64/blob/master/forth-src/strings.4th
>
Well done.
--
me

Re: a few strings and ipc

<640c3b5c-b1bd-45e4-8060-fff82c32937an@googlegroups.com>

 copy mid

https://www.novabbs.com/devel/article-flat.php?id=16844&group=comp.lang.forth#16844

 copy link   Newsgroups: comp.lang.forth
X-Received: by 2002:adf:fa82:0:b0:1e6:34fe:9bf with SMTP id h2-20020adffa82000000b001e634fe09bfmr6909886wrr.43.1645215007159;
Fri, 18 Feb 2022 12:10:07 -0800 (PST)
X-Received: by 2002:a05:622a:1209:b0:2dc:e120:1e1 with SMTP id
y9-20020a05622a120900b002dce12001e1mr8373058qtx.63.1645215006720; Fri, 18 Feb
2022 12:10:06 -0800 (PST)
Path: i2pn2.org!i2pn.org!weretis.net!feeder8.news.weretis.net!proxad.net!feeder1-2.proxad.net!209.85.128.87.MISMATCH!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.forth
Date: Fri, 18 Feb 2022 12:10:06 -0800 (PST)
In-Reply-To: <2686421a-d7e9-47ad-9217-81d2815c7efen@googlegroups.com>
Injection-Info: google-groups.googlegroups.com; posting-host=2600:1700:3f7a:20d0:704d:23e7:b644:733;
posting-account=V5nGoQoAAAC_P2U0qnxm2kC0s1jNJXJa
NNTP-Posting-Host: 2600:1700:3f7a:20d0:704d:23e7:b644:733
References: <32473cf9-9773-4e7b-9603-0783a7405cc9n@googlegroups.com>
<2b3d8cea-6357-4f68-bdcf-6892b306a73en@googlegroups.com> <sulu4k$bal$1@dont-email.me>
<522c15b0-4bca-4ab1-87b9-beda1edf08d0n@googlegroups.com> <sun68s$ccu$1@dont-email.me>
<2686421a-d7e9-47ad-9217-81d2815c7efen@googlegroups.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <640c3b5c-b1bd-45e4-8060-fff82c32937an@googlegroups.com>
Subject: Re: a few strings and ipc
From: sdwjac...@gmail.com (S Jack)
Injection-Date: Fri, 18 Feb 2022 20:10:07 +0000
Content-Type: text/plain; charset="UTF-8"
 by: S Jack - Fri, 18 Feb 2022 20:10 UTC

On Friday, February 18, 2022 at 1:23:37 PM UTC-6, S Jack wrote:

I played with string headers long time back but never used them afterwards
because could get by with the cheaper counted strings. I only recently
started using them again for the dialogs only just to make use of them.
Looking over what I just posted, it appears to me that the bounded
string could be as effective as the string header and save one cell.
No need for max-count because have end address already and count is
available with my favorite word OM (gives me a peaceful feeling
every time I use it.) So I'm off to a little re-work.
--
me

1
server_pubkey.txt

rocksolid light 0.9.7
clearnet tor