Rocksolid Light

Welcome to RetroBBS

mail  files  register  newsreader  groups  login

Message-ID:  

Over the shoulder supervision is more a need of the manager than the programming task.


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

SubjectAuthor
* Safe handling of listsLuc
+- Re: Safe handling of listsGerald Lester
+* Re: Safe handling of listset99
|`* Re: Safe handling of listsLuc
| +* Re: Safe handling of listset99
| |`* Re: Safe handling of listsLuc
| | `- Re: Safe handling of listsAlan Grunwald
| `* Re: Safe handling of listsRalf Fassel
|  `* Re: Safe handling of listset99
|   +- Re: Safe handling of listsRich
|   `* Re: Safe handling of listsLuc
|    `* Re: Safe handling of listsRich
|     +* Re: Safe handling of listset99
|     |`- Re: Safe handling of listsRich
|     `* Re: Safe handling of listsRalf Fassel
|      `* Re: Safe handling of listsRich
|       `* Re: Safe handling of listsLuc
|        +- Re: Safe handling of listset99
|        `- Re: Safe handling of listsRich
+* Re: Safe handling of listsPaul Obermeier
|`* Re: Safe handling of listsLuc
| `* Re: Safe handling of listsRich
|  `- Re: Safe handling of listsPaul Obermeier
`* Re: Safe handling of listsPeter Dean
 `* Re: Safe handling of listsChristian Gollwitzer
  `- Re: Safe handling of listsPeter Dean

Pages:12
Re: Safe handling of lists

<uk7t7t$u6ps$1@dont-email.me>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=23035&group=comp.lang.tcl#23035

  copy link   Newsgroups: comp.lang.tcl
Path: i2pn2.org!i2pn.org!news.chmurka.net!weretis.net!feeder8.news.weretis.net!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: rich@example.invalid (Rich)
Newsgroups: comp.lang.tcl
Subject: Re: Safe handling of lists
Date: Wed, 29 Nov 2023 17:43:26 -0000 (UTC)
Organization: A noiseless patient Spider
Lines: 27
Message-ID: <uk7t7t$u6ps$1@dont-email.me>
References: <20231126162914.126fd99f@lud1.home> <uk0dnk$3dr16$1@dont-email.me> <20231126190047.0403d10d@lud1.home> <ygacyvv45en.fsf@panther.akutech-local.de> <uk3f1u$3vuo5$1@dont-email.me> <20231127230734.14bb8204@lud1.home> <uk3l9u$4j95$1@dont-email.me> <ygazfyyypy1.fsf@panther.akutech-local.de> <uk57s3$bui8$2@dont-email.me> <20231129015454.4c84bdc9@lud1.home>
Injection-Date: Wed, 29 Nov 2023 17:43:26 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="20212c49318bf064762e9e5d917085c4";
logging-data="990012"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX185a8v23+IXK0xDDkIqeBWJ"
User-Agent: tin/2.6.1-20211226 ("Convalmore") (Linux/5.15.117 (x86_64))
Cancel-Lock: sha1:bsIpSMqkusWoRloW1qe8oI+0Fbk=
 by: Rich - Wed, 29 Nov 2023 17:43 UTC

Luc <luc@sep.invalid> wrote:
> OK, I found a good solution. It's similar to what some of you suggested,
> but different enough.
> ...
> Here they are:
>
>
> proc p.wc {content} {
> set wordcount 0
> regsub -all {[\s]+} [string trim $content] { } content
> set wordcount [llength [split $content { }]]
> return $wordcount
> }

You can reduce the above to this:

proc p.wc {content} {
return [llength [regsub -all -inline {\S+} $content]]
}

And save having to create a trimmed version of content, save creating a
second copy of content with runs of whitespace converted to a single
space, and save having to then scan and split content on those spaces.

> Thank you for all the help once again.

You are welcome.

Pages:12
server_pubkey.txt

rocksolid light 0.9.81
clearnet tor