Rocksolid Light

Welcome to novaBBS (click a section below)

mail  files  register  newsreader  groups  login

Message-ID:  

Radioactive cats have 18 half-lives.


devel / comp.lang.forth / coproc string edits

SubjectAuthor
* coproc string editsS Jack
`* Re: coproc string editsS Jack
 `* Re: coproc string editsS Jack
  `* Re: coproc string editsS Jack
   `- Re: coproc string editsS Jack

1
coproc string edits

<5f53de10-823b-4c4a-9d05-c8f53756eb05n@googlegroups.com>

  copy mid

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

  copy link   Newsgroups: comp.lang.forth
X-Received: by 2002:adf:fe0f:0:b0:1e2:f9dc:6ed with SMTP id n15-20020adffe0f000000b001e2f9dc06edmr17893730wrr.530.1645485873741;
Mon, 21 Feb 2022 15:24:33 -0800 (PST)
X-Received: by 2002:a05:620a:243:b0:60d:df5e:16d8 with SMTP id
q3-20020a05620a024300b0060ddf5e16d8mr12961988qkn.571.1645485873252; Mon, 21
Feb 2022 15:24:33 -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: Mon, 21 Feb 2022 15:24:33 -0800 (PST)
Injection-Info: google-groups.googlegroups.com; posting-host=2600:1700:3f7a:20d0:d17b:6d2f:7712:8e37;
posting-account=V5nGoQoAAAC_P2U0qnxm2kC0s1jNJXJa
NNTP-Posting-Host: 2600:1700:3f7a:20d0:d17b:6d2f:7712:8e37
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <5f53de10-823b-4c4a-9d05-c8f53756eb05n@googlegroups.com>
Subject: coproc string edits
From: sdwjac...@gmail.com (S Jack)
Injection-Date: Mon, 21 Feb 2022 23:24:33 +0000
Content-Type: text/plain; charset="UTF-8"
 by: S Jack - Mon, 21 Feb 2022 23:24 UTC

:) frogd extr -p
EOT isn't unique
CLEAR isn't unique
= isn't unique
DROP isn't unique
.. isn't unique
Memory allocated from heap 144297968: 0 144232448 1024

RO isn't unique
0x0ELF_32X8_6_64 Frog Version 1.0d

co:start
-- IPC:HR: 5
-- IPC:HW: 4
-- CO:PID: 1,419
-- COPROC ready ok
ss:clear ok
"job" /go

Coproc string edits

: /ss:erx ss:pop /co:echo ipc:rx ; \ pop, echo, and receive
ipc:show \ print receive data
asc ; \ make simi-colon string delimiter
ss:= foo="Bad magic found here" ; ss:pop /co:write \ coproc var assignment
ss:= -e "${foo}" ; /ss:erx \ see the coproc var
Bad magic found here
ss:= -e "${foo/magic/XYZZY}" ; /ss:erx \ string substitution
Bad XYZZY found here
ss:= -e "${foo:4:5}" ; /ss:erx \ sub-string extraction
magic
ss:= -e "${foo#*\ }" ; /ss:erx \ lop a little
magic found here
ss:= -e "${foo##*\ }" ; /ss:erx \ lop a lot
here
ss:= -e "${foo%\ *}" ; /ss:erx \ chop a little
Bad magic found
ss:= -e "${foo%%\ *}" ; /ss:erx \ chop a lot
Bad
co:hup \ hang-up coproc

-fin-
ok
:) --
me

Re: coproc string edits

<be785ec0-5a39-42d9-b475-8dbd16d71c2an@googlegroups.com>

  copy mid

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

  copy link   Newsgroups: comp.lang.forth
X-Received: by 2002:adf:bc14:0:b0:1e2:b035:9c46 with SMTP id s20-20020adfbc14000000b001e2b0359c46mr20062458wrg.386.1645548052579;
Tue, 22 Feb 2022 08:40:52 -0800 (PST)
X-Received: by 2002:a05:6214:500f:b0:42c:11af:f8a9 with SMTP id
jo15-20020a056214500f00b0042c11aff8a9mr19845677qvb.51.1645548052068; Tue, 22
Feb 2022 08:40:52 -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: Tue, 22 Feb 2022 08:40:51 -0800 (PST)
In-Reply-To: <5f53de10-823b-4c4a-9d05-c8f53756eb05n@googlegroups.com>
Injection-Info: google-groups.googlegroups.com; posting-host=2600:1700:3f7a:20d0:7c48:3d5:9a4c:3965;
posting-account=V5nGoQoAAAC_P2U0qnxm2kC0s1jNJXJa
NNTP-Posting-Host: 2600:1700:3f7a:20d0:7c48:3d5:9a4c:3965
References: <5f53de10-823b-4c4a-9d05-c8f53756eb05n@googlegroups.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <be785ec0-5a39-42d9-b475-8dbd16d71c2an@googlegroups.com>
Subject: Re: coproc string edits
From: sdwjac...@gmail.com (S Jack)
Injection-Date: Tue, 22 Feb 2022 16:40:52 +0000
Content-Type: text/plain; charset="UTF-8"
 by: S Jack - Tue, 22 Feb 2022 16:40 UTC

Host as resource, three shells and a Forth:
:) frogd
ELF32X86_64 Frog Version 1.0d

co:start
-- IPC:HR: 5
-- IPC:HW: 4
-- CO:PID: 603
-- COPROC ready ok
"ps" /sys PID TTY TIME CMD
314 pts/1 00:00:00 bash \ parent shell
601 pts/1 00:00:00 frogd \ the Forth
603 pts/1 00:00:00 bash \ coproc shell
606 pts/1 00:00:00 sh \ forked shell
607 pts/1 00:00:00 ps
ok
--
me

Re: coproc string edits

<8a6a6977-7b7c-472b-a497-0fec0f62dcc2n@googlegroups.com>

  copy mid

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

  copy link   Newsgroups: comp.lang.forth
X-Received: by 2002:a05:6000:22f:b0:1e3:3415:4078 with SMTP id l15-20020a056000022f00b001e334154078mr20960674wrz.69.1645569613452;
Tue, 22 Feb 2022 14:40:13 -0800 (PST)
X-Received: by 2002:ac8:5b51:0:b0:2dd:c4e0:788e with SMTP id
n17-20020ac85b51000000b002ddc4e0788emr19318445qtw.119.1645569612722; Tue, 22
Feb 2022 14:40:12 -0800 (PST)
Path: i2pn2.org!i2pn.org!usenet.goja.nl.eu.org!3.eu.feeder.erje.net!feeder.erje.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: Tue, 22 Feb 2022 14:40:12 -0800 (PST)
In-Reply-To: <be785ec0-5a39-42d9-b475-8dbd16d71c2an@googlegroups.com>
Injection-Info: google-groups.googlegroups.com; posting-host=2600:1700:3f7a:20d0:cd33:7faa:b180:9fd6;
posting-account=V5nGoQoAAAC_P2U0qnxm2kC0s1jNJXJa
NNTP-Posting-Host: 2600:1700:3f7a:20d0:cd33:7faa:b180:9fd6
References: <5f53de10-823b-4c4a-9d05-c8f53756eb05n@googlegroups.com> <be785ec0-5a39-42d9-b475-8dbd16d71c2an@googlegroups.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <8a6a6977-7b7c-472b-a497-0fec0f62dcc2n@googlegroups.com>
Subject: Re: coproc string edits
From: sdwjac...@gmail.com (S Jack)
Injection-Date: Tue, 22 Feb 2022 22:40:13 +0000
Content-Type: text/plain; charset="UTF-8"
 by: S Jack - Tue, 22 Feb 2022 22:40 UTC

Made new word CO:MECHO to echo with the '-e' option.
Using strings directly not parsing with string stack.
) frogd -p extr
Memory allocated from heap 147,722,224: 0 147,656,704 1,024

0x0ELF_32X8_6_64 Frog Version 1.0d

"comecho" demo

Coproc mecho demo

: /merx /co:mecho ipc:rx ; \ co mecho, and ipc receive
co:start \ start coproc
-- IPC:HR: 6
-- IPC:HW: 5
-- CO:PID: 428
-- COPROC ready
'foo="Bad magic found here."' /co:write \ coproc var assignment
ipc:show \ print receive data
'"${foo}"' /merx \ see the coproc var
Bad magic found here.
'"${foo/magic/XYZZY}"' /merx \ string substitution
Bad XYZZY found here.
'"${foo:4:5}"' /merx \ sub-string extraction
magic
'"${foo#*\ }"' /merx \ lop a little
magic found here.
'"${foo##*\ }"' /merx \ lop a lot
here.
'"${foo%\ *}"' /merx \ chop a little
Bad magic found
'"${foo%%\ *}"' /merx \ chop a lot
Bad
co:hup \ hang-up coproc

-fin-
ok--
me

Re: coproc string edits

<b4b92ed9-6ed8-4cfe-b3d1-ba6c3611a991n@googlegroups.com>

  copy mid

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

  copy link   Newsgroups: comp.lang.forth
X-Received: by 2002:adf:fec4:0:b0:1ed:b617:6531 with SMTP id q4-20020adffec4000000b001edb6176531mr223831wrs.238.1645631528938;
Wed, 23 Feb 2022 07:52:08 -0800 (PST)
X-Received: by 2002:ae9:e015:0:b0:60d:e5e2:1dcb with SMTP id
m21-20020ae9e015000000b0060de5e21dcbmr200504qkk.306.1645631526388; Wed, 23
Feb 2022 07:52: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: Wed, 23 Feb 2022 07:52:06 -0800 (PST)
In-Reply-To: <8a6a6977-7b7c-472b-a497-0fec0f62dcc2n@googlegroups.com>
Injection-Info: google-groups.googlegroups.com; posting-host=2600:1700:3f7a:20d0:cd33:7faa:b180:9fd6;
posting-account=V5nGoQoAAAC_P2U0qnxm2kC0s1jNJXJa
NNTP-Posting-Host: 2600:1700:3f7a:20d0:cd33:7faa:b180:9fd6
References: <5f53de10-823b-4c4a-9d05-c8f53756eb05n@googlegroups.com>
<be785ec0-5a39-42d9-b475-8dbd16d71c2an@googlegroups.com> <8a6a6977-7b7c-472b-a497-0fec0f62dcc2n@googlegroups.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <b4b92ed9-6ed8-4cfe-b3d1-ba6c3611a991n@googlegroups.com>
Subject: Re: coproc string edits
From: sdwjac...@gmail.com (S Jack)
Injection-Date: Wed, 23 Feb 2022 15:52:08 +0000
Content-Type: text/plain; charset="UTF-8"
 by: S Jack - Wed, 23 Feb 2022 15:52 UTC

On Tuesday, February 22, 2022 at 4:40:15 PM UTC-6, S Jack wrote:

ok
'eval "echo -n abc|sha512sum"' /co:trx
ddaf35a193617abacc417349ae20413112e6fa4e89a97ea20a9eeee64b55d39a2192992a274fc1a836ba3c23a3feebbd454d4423643ce80e2a9ac94fa54ca49f - ok

Wanted to use a Here String but it always ends in a newline which in this case is
not wanted :(

--
me

Re: coproc string edits

<e6d5fd3c-b3e4-44a2-98d3-d5b858513221n@googlegroups.com>

  copy mid

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

  copy link   Newsgroups: comp.lang.forth
X-Received: by 2002:ad4:5f45:0:b0:432:b7eb:d635 with SMTP id p5-20020ad45f45000000b00432b7ebd635mr3231580qvg.50.1645767447615;
Thu, 24 Feb 2022 21:37:27 -0800 (PST)
X-Received: by 2002:ae9:ef02:0:b0:476:2f28:d1b2 with SMTP id
d2-20020ae9ef02000000b004762f28d1b2mr3914509qkg.188.1645767447418; Thu, 24
Feb 2022 21:37:27 -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, 24 Feb 2022 21:37:27 -0800 (PST)
In-Reply-To: <b4b92ed9-6ed8-4cfe-b3d1-ba6c3611a991n@googlegroups.com>
Injection-Info: google-groups.googlegroups.com; posting-host=2600:1700:3f7a:20d0:2487:702:4773:fc27;
posting-account=V5nGoQoAAAC_P2U0qnxm2kC0s1jNJXJa
NNTP-Posting-Host: 2600:1700:3f7a:20d0:2487:702:4773:fc27
References: <5f53de10-823b-4c4a-9d05-c8f53756eb05n@googlegroups.com>
<be785ec0-5a39-42d9-b475-8dbd16d71c2an@googlegroups.com> <8a6a6977-7b7c-472b-a497-0fec0f62dcc2n@googlegroups.com>
<b4b92ed9-6ed8-4cfe-b3d1-ba6c3611a991n@googlegroups.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <e6d5fd3c-b3e4-44a2-98d3-d5b858513221n@googlegroups.com>
Subject: Re: coproc string edits
From: sdwjac...@gmail.com (S Jack)
Injection-Date: Fri, 25 Feb 2022 05:37:27 +0000
Content-Type: text/plain; charset="UTF-8"
Lines: 46
 by: S Jack - Fri, 25 Feb 2022 05:37 UTC

Some refinement:
i. For the various co: transfers no strings are composed in the Forth.
Instead the composition takes place in the output buffer via
multiple writes from the Forth. Data from the Forth input buffer
is written directly to the co: output buffer.
i. The gstring parser G is used to parse string input rather than
using a string operator. Thus the Forth does not contribute any
quotes to the data; the data has only the quoting required by the
shell.

:) frogd
ELF32X86_64 Frog Version 1.0d

-p ok
s comecho demo

Coproc mecho demo

: /co:merx /co:mecho ipc:rx ; \ co mecho, and ipc receive
co:start \ start coproc
-- IPC:HR: 6
-- IPC:HW: 5
-- CO:PID: 826
-- COPROC ready
ipc:show \ set receive to print
g foo="Good magic found here." ; /CO:SEND \ coproc var assignment
g ${foo} ; /co:merx \ see the coproc var
Good magic found here.
g ${foo/magic/XYZZY} ; /co:merx \ string substitution
Good XYZZY found here.
g ${foo:5:5} ; /co:merx \ sub-string extraction
magic
g ${foo#*\ } ; /co:merx \ lop a little
magic found here.
g ${foo##*\ } ; /co:merx \ lop a lot
here.
g ${foo%\ *} ; /co:merx \ chop a little
Good magic found
g ${foo%%\ *} ; /co:merx \ chop a lot
Good
co:hup \ hang-up coproc

-fin-
ok
--
me

1
server_pubkey.txt

rocksolid light 0.9.8
clearnet tor