Rocksolid Light

Welcome to Rocksolid Light

mail  files  register  newsreader  groups  login

Message-ID:  

"...Unix, MS-DOS, and Windows NT (also known as the Good, the Bad, and the Ugly)." (By Matt Welsh)


devel / comp.lang.tcl / Safe handling of lists

SubjectAuthor
o Safe handling of listsclt.to.davebr

1
Safe handling of lists

<2651701051932@dlp>

  copy mid

https://news.novabbs.org/devel/article-flat.php?id=12850&group=comp.lang.tcl#12850

  copy link   Newsgroups: comp.lang.tcl
Path: i2pn2.org!i2pn.org!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: clt.to.davebr@dfgh.net
Newsgroups: comp.lang.tcl
Subject: Safe handling of lists
Date: Mon, 27 Nov 23 02:25:32 GMT
Organization: A noiseless patient Spider
Lines: 15
Message-ID: <2651701051932@dlp>
Injection-Info: dont-email.me; posting-host="d4c0e6095ec929e9bbf97560e13526bc";
logging-data="3661590"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+f5cCKxZF6Y4+zJKW7cEmr"
Cancel-Lock: sha1:bjR51GjsPMBOz5Pdfpz9IhEUWGE=
 by: clt.to.davebr@dfgh.net - Mon, 27 Nov 2023 02:25 UTC

This is 2-3 times slower that p.wc, but ignores any number of spacing characters:

proc wc {str} {
llength [lmap x [split $str] {if {[string is space $x]} {continue} {set x}}]
}

it gives the same count as the wc utility on one 100k test file.

The other problem is ckecking count between key strokes.

Consider keeping track of words above and below the edit window, then tracking lines moving into and out of the edit window and word count in the edit window at each key stroke. Much more complicated, but it only processes a short segment of text on each key stroke.

Dave B

1
server_pubkey.txt

rocksolid light 0.9.8
clearnet tor