Rocksolid Light

Welcome to novaBBS (click a section below)

mail  files  register  newsreader  groups  login

Message-ID:  

The first version always gets thrown away.


devel / comp.lang.forth / Re: Find the indices

SubjectAuthor
* Find the indicesRobert L.
`- Re: Find the indicesDoug Hoffman

1
Find the indices

<t0616n$16v9$1@gioia.aioe.org>

 copy mid

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

 copy link   Newsgroups: comp.lang.forth
Path: i2pn2.org!i2pn.org!aioe.org!Hm8Gy1NCoX5UJtXqlgcssw.user.46.165.242.75.POSTED!not-for-mail
From: No_spamm...@noWhere_7073.org (Robert L.)
Newsgroups: comp.lang.forth
Subject: Find the indices
Date: Mon, 7 Mar 2022 22:33:00 -0000 (UTC)
Organization: Aioe.org NNTP Server
Message-ID: <t0616n$16v9$1@gioia.aioe.org>
Mime-Version: 1.0
Content-Type: text/plain; charset=iso-8859-1
Injection-Info: gioia.aioe.org; logging-data="39913"; posting-host="Hm8Gy1NCoX5UJtXqlgcssw.user.gioia.aioe.org"; mail-complaints-to="abuse@aioe.org";
User-Agent: XanaNews/1.18.1.6
X-Notice: Filtered by postfilter v. 0.9.2
 by: Robert L. - Mon, 7 Mar 2022 22:33 UTC

We have a list of strings. We want to generate a list
of the indices of the "long" strings.

Racket Scheme:

(define (long? s) (> (string-length s) 3))

(indexes-where
'("tool" "too" "to" "run" "some" "cad" "discriminate"
"adumbrate" "chthonic" "newly" "Thule" "apt" "cap")
long?)

===>
'(0 4 6 7 8 9 10)

In Forth?

Re: Find the indices

<62268fb0$0$704$14726298@news.sunsite.dk>

 copy mid

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

 copy link   Newsgroups: comp.lang.forth
Path: i2pn2.org!i2pn.org!weretis.net!feeder8.news.weretis.net!usenet.goja.nl.eu.org!dotsrc.org!filter.dotsrc.org!news.dotsrc.org!not-for-mail
Date: Mon, 7 Mar 2022 18:05:16 -0500
MIME-Version: 1.0
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:91.0)
Gecko/20100101 Thunderbird/91.6.0
Subject: Re: Find the indices
Content-Language: en-US
Newsgroups: comp.lang.forth
References: <t0616n$16v9$1@gioia.aioe.org>
From: dhoffman...@gmail.com (Doug Hoffman)
In-Reply-To: <t0616n$16v9$1@gioia.aioe.org>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Lines: 16
Message-ID: <62268fb0$0$704$14726298@news.sunsite.dk>
Organization: SunSITE.dk - Supporting Open source
NNTP-Posting-Host: 2c7cb553.news.sunsite.dk
X-Trace: 1646694320 news.sunsite.dk 704 glidedog@gmail.com/68.55.82.126:58773
X-Complaints-To: staff@sunsite.dk
 by: Doug Hoffman - Mon, 7 Mar 2022 23:05 UTC

include FMSVT2.f

: indexes-where >array { input a -- a }
input :size 0 do i input :at :size 3 > if i a :add then loop a ;

${ tool too to run some cad discriminate
adumbrate chthonic newly Thule apt cap } indexes-where :.

=>
0 0
1 4
2 6
3 7
4 8
5 9
6 10 ok

1
server_pubkey.txt

rocksolid light 0.9.7
clearnet tor