Rocksolid Light

Welcome to novaBBS (click a section below)

mail  files  register  newsreader  groups  login

Message-ID:  

To kick or not to kick... -- Somewhere on IRC, inspired by Shakespeare


devel / comp.lang.tcl / ANNOUNCE: conf 1.0

SubjectAuthor
* ANNOUNCE: conf 1.0Oleg Nemanov
+* ANNOUNCE: conf 1.0Harald Oehlmann
|`- ANNOUNCE: conf 1.0Oleg Nemanov
`* ANNOUNCE: conf 1.0Oleg Nemanov
 `* ANNOUNCE: conf 1.0Oleg Nemanov
  +* ANNOUNCE: conf 1.0Harald Oehlmann
  |`- ANNOUNCE: conf 1.0Oleg Nemanov
  `* ANNOUNCE: conf 1.0Luc
   `- ANNOUNCE: conf 1.0Rich

1
ANNOUNCE: conf 1.0

<7897b77f-f5e6-42e7-90f7-0ce5fb453cffn@googlegroups.com>

  copy mid

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

  copy link   Newsgroups: comp.lang.tcl
X-Received: by 2002:ac8:7ef3:0:b0:3a5:108b:4cc0 with SMTP id r19-20020ac87ef3000000b003a5108b4cc0mr50390173qtc.436.1668085184662;
Thu, 10 Nov 2022 04:59:44 -0800 (PST)
X-Received: by 2002:a05:622a:1984:b0:3a5:8ba0:f7fa with SMTP id
u4-20020a05622a198400b003a58ba0f7famr16498904qtc.284.1668085184473; Thu, 10
Nov 2022 04:59:44 -0800 (PST)
Path: i2pn2.org!i2pn.org!usenet.blueworldhosting.com!feed1.usenet.blueworldhosting.com!peer02.iad!feed-me.highwinds-media.com!news.highwinds-media.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.tcl
Date: Thu, 10 Nov 2022 04:59:44 -0800 (PST)
Injection-Info: google-groups.googlegroups.com; posting-host=194.190.114.28; posting-account=RPJNegoAAAAUgD_yLdrci9D1ZtZ1oI0L
NNTP-Posting-Host: 194.190.114.28
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <7897b77f-f5e6-42e7-90f7-0ce5fb453cffn@googlegroups.com>
Subject: ANNOUNCE: conf 1.0
From: oleg.o.n...@gmail.com (Oleg Nemanov)
Injection-Date: Thu, 10 Nov 2022 12:59:44 +0000
Content-Type: text/plain; charset="UTF-8"
X-Received-Bytes: 1920
 by: Oleg Nemanov - Thu, 10 Nov 2022 12:59 UTC

Hi, all.

conf package is pure-tcl package for loading a textual configuration data from file, channels and strings. It supports conf syntax with hierarchical and ini-style sections and key-value pairs where value can be string or list.

Source code: https://github.com/lego12239/conf.tcl

## Features

* conf syntax supports of hierarchical sections
* conf syntax support of ini-style sections
* conf syntax support of comments
* conf syntax support of file inclusion
* callback can be used on every key-value assignment to change a default behaviour drastically(you can even use a package only as parser and process a parsed key-value as you want)
* conf is parsed into 2 dicts: one is a parsed conf and another is a conf specification with info about value types. This is very important for working with parsed conf correctly. See Rationale section in the README.
* there are utility routines to help with conf spec checking.

Re: ANNOUNCE: conf 1.0

<tkit80$gk82$1@dont-email.me>

  copy mid

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

  copy link   Newsgroups: comp.lang.tcl
Path: i2pn2.org!i2pn.org!eternal-september.org!reader01.eternal-september.org!.POSTED!not-for-mail
From: wortka...@yahoo.com (Harald Oehlmann)
Newsgroups: comp.lang.tcl
Subject: Re: ANNOUNCE: conf 1.0
Date: Thu, 10 Nov 2022 14:10:24 +0100
Organization: A noiseless patient Spider
Lines: 22
Message-ID: <tkit80$gk82$1@dont-email.me>
References: <7897b77f-f5e6-42e7-90f7-0ce5fb453cffn@googlegroups.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Thu, 10 Nov 2022 13:10:24 -0000 (UTC)
Injection-Info: reader01.eternal-september.org; posting-host="88e854af85c1c4a511a99eb7a46af50f";
logging-data="545026"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18vGngi4ywYFpDGrsDMI3Or"
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101
Thunderbird/102.4.2
Cancel-Lock: sha1:NAyyM921jo3O3O3cVrEr2c/28fE=
In-Reply-To: <7897b77f-f5e6-42e7-90f7-0ce5fb453cffn@googlegroups.com>
Content-Language: en-GB
 by: Harald Oehlmann - Thu, 10 Nov 2022 13:10 UTC

Am 10.11.2022 um 13:59 schrieb Oleg Nemanov:
> Hi, all.
>
> conf package is pure-tcl package for loading a textual configuration data from file, channels and strings. It supports conf syntax with hierarchical and ini-style sections and key-value pairs where value can be string or list.
>
> Source code: https://github.com/lego12239/conf.tcl
>
> ## Features
>
> * conf syntax supports of hierarchical sections
> * conf syntax support of ini-style sections
> * conf syntax support of comments
> * conf syntax support of file inclusion
> * callback can be used on every key-value assignment to change a default behaviour drastically(you can even use a package only as parser and process a parsed key-value as you want)
> * conf is parsed into 2 dicts: one is a parsed conf and another is a conf specification with info about value types. This is very important for working with parsed conf correctly. See Rationale section in the README.
> * there are utility routines to help with conf spec checking.

Thanks, Oleg, sounds great !
I also like your name in Cyrillic font!

Thanks,
Harald

Re: ANNOUNCE: conf 1.0

<3a52c682-69ed-4f4b-b5c5-aedf41900dc9n@googlegroups.com>

  copy mid

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

  copy link   Newsgroups: comp.lang.tcl
X-Received: by 2002:a05:620a:2844:b0:6ef:757:2be7 with SMTP id h4-20020a05620a284400b006ef07572be7mr46085524qkp.253.1668088044419;
Thu, 10 Nov 2022 05:47:24 -0800 (PST)
X-Received: by 2002:a05:622a:13d2:b0:3a5:43b0:c43 with SMTP id
p18-20020a05622a13d200b003a543b00c43mr34342565qtk.610.1668088044276; Thu, 10
Nov 2022 05:47:24 -0800 (PST)
Path: i2pn2.org!i2pn.org!usenet.blueworldhosting.com!feed1.usenet.blueworldhosting.com!peer02.iad!feed-me.highwinds-media.com!news.highwinds-media.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.tcl
Date: Thu, 10 Nov 2022 05:47:24 -0800 (PST)
In-Reply-To: <tkit80$gk82$1@dont-email.me>
Injection-Info: google-groups.googlegroups.com; posting-host=194.190.114.28; posting-account=RPJNegoAAAAUgD_yLdrci9D1ZtZ1oI0L
NNTP-Posting-Host: 194.190.114.28
References: <7897b77f-f5e6-42e7-90f7-0ce5fb453cffn@googlegroups.com> <tkit80$gk82$1@dont-email.me>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <3a52c682-69ed-4f4b-b5c5-aedf41900dc9n@googlegroups.com>
Subject: Re: ANNOUNCE: conf 1.0
From: oleg.o.n...@gmail.com (Oleg Nemanov)
Injection-Date: Thu, 10 Nov 2022 13:47:24 +0000
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: base64
X-Received-Bytes: 1342
 by: Oleg Nemanov - Thu, 10 Nov 2022 13:47 UTC

четверг, 10 ноября 2022 г. в 16:10:37 UTC+3, Harald Oehlmann:
> I also like your name in Cyrillic font!
:-D

Re: ANNOUNCE: conf 1.0

<41f664ef-00b2-45c4-8496-dd7517e94a40n@googlegroups.com>

  copy mid

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

  copy link   Newsgroups: comp.lang.tcl
X-Received: by 2002:a05:620a:2282:b0:6ef:1b80:ac9b with SMTP id o2-20020a05620a228200b006ef1b80ac9bmr204768qkh.773.1668154338057;
Fri, 11 Nov 2022 00:12:18 -0800 (PST)
X-Received: by 2002:a0c:8170:0:b0:4bb:5935:55ca with SMTP id
103-20020a0c8170000000b004bb593555camr1003561qvc.79.1668154337924; Fri, 11
Nov 2022 00:12:17 -0800 (PST)
Path: i2pn2.org!i2pn.org!usenet.blueworldhosting.com!feed1.usenet.blueworldhosting.com!peer01.iad!feed-me.highwinds-media.com!news.highwinds-media.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.tcl
Date: Fri, 11 Nov 2022 00:12:17 -0800 (PST)
In-Reply-To: <7897b77f-f5e6-42e7-90f7-0ce5fb453cffn@googlegroups.com>
Injection-Info: google-groups.googlegroups.com; posting-host=194.190.114.28; posting-account=RPJNegoAAAAUgD_yLdrci9D1ZtZ1oI0L
NNTP-Posting-Host: 194.190.114.28
References: <7897b77f-f5e6-42e7-90f7-0ce5fb453cffn@googlegroups.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <41f664ef-00b2-45c4-8496-dd7517e94a40n@googlegroups.com>
Subject: Re: ANNOUNCE: conf 1.0
From: oleg.o.n...@gmail.com (Oleg Nemanov)
Injection-Date: Fri, 11 Nov 2022 08:12:18 +0000
Content-Type: text/plain; charset="UTF-8"
X-Received-Bytes: 1563
 by: Oleg Nemanov - Fri, 11 Nov 2022 08:12 UTC

One problem i didn't solve is reporting of conf spec(or conf spec pattern) syntax errors in more meaningful form than "missing value to go with key".
This is done in _spec_cmp. In the chain of "elseif" should be an "else" where we test that $vpat is not dict(or string with 1 word). The simple way is
call "dict size" inside a catch. But i don't like this, because of the catch even for successful case is 3 times slower, then without it.

Re: ANNOUNCE: conf 1.0

<3d9a7e78-e49d-4165-806f-b18143a056c5n@googlegroups.com>

  copy mid

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

  copy link   Newsgroups: comp.lang.tcl
X-Received: by 2002:a0c:ec45:0:b0:4c6:1e50:f01c with SMTP id n5-20020a0cec45000000b004c61e50f01cmr996170qvq.87.1668154976462;
Fri, 11 Nov 2022 00:22:56 -0800 (PST)
X-Received: by 2002:ac8:7c92:0:b0:3a4:ae7c:c70d with SMTP id
y18-20020ac87c92000000b003a4ae7cc70dmr431333qtv.40.1668154976321; Fri, 11 Nov
2022 00:22:56 -0800 (PST)
Path: i2pn2.org!i2pn.org!usenet.blueworldhosting.com!feed1.usenet.blueworldhosting.com!peer03.iad!feed-me.highwinds-media.com!news.highwinds-media.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.tcl
Date: Fri, 11 Nov 2022 00:22:56 -0800 (PST)
In-Reply-To: <41f664ef-00b2-45c4-8496-dd7517e94a40n@googlegroups.com>
Injection-Info: google-groups.googlegroups.com; posting-host=194.190.114.28; posting-account=RPJNegoAAAAUgD_yLdrci9D1ZtZ1oI0L
NNTP-Posting-Host: 194.190.114.28
References: <7897b77f-f5e6-42e7-90f7-0ce5fb453cffn@googlegroups.com> <41f664ef-00b2-45c4-8496-dd7517e94a40n@googlegroups.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <3d9a7e78-e49d-4165-806f-b18143a056c5n@googlegroups.com>
Subject: Re: ANNOUNCE: conf 1.0
From: oleg.o.n...@gmail.com (Oleg Nemanov)
Injection-Date: Fri, 11 Nov 2022 08:22:56 +0000
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
X-Received-Bytes: 1885
 by: Oleg Nemanov - Fri, 11 Nov 2022 08:22 UTC

пятница, 11 ноября 2022 г. в 11:12:20 UTC+3, Oleg Nemanov:
> One problem i didn't solve is reporting of conf spec(or conf spec pattern) syntax errors in more meaningful form than "missing value to go with key"..
> This is done in _spec_cmp. In the chain of "elseif" should be an "else" where we test that $vpat is not dict(or string with 1 word). The simple way is
> call "dict size" inside a catch. But i don't like this, because of the catch even for successful case is 3 times slower, then without it.

We have "string is list", but there is no "string is dict".

Re: ANNOUNCE: conf 1.0

<tkl185$pokq$2@dont-email.me>

  copy mid

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

  copy link   Newsgroups: comp.lang.tcl
Path: i2pn2.org!i2pn.org!eternal-september.org!reader01.eternal-september.org!.POSTED!not-for-mail
From: wortka...@yahoo.com (Harald Oehlmann)
Newsgroups: comp.lang.tcl
Subject: Re: ANNOUNCE: conf 1.0
Date: Fri, 11 Nov 2022 09:31:02 +0100
Organization: A noiseless patient Spider
Lines: 20
Message-ID: <tkl185$pokq$2@dont-email.me>
References: <7897b77f-f5e6-42e7-90f7-0ce5fb453cffn@googlegroups.com>
<41f664ef-00b2-45c4-8496-dd7517e94a40n@googlegroups.com>
<3d9a7e78-e49d-4165-806f-b18143a056c5n@googlegroups.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
Injection-Date: Fri, 11 Nov 2022 08:31:02 -0000 (UTC)
Injection-Info: reader01.eternal-september.org; posting-host="d9f2dfbb466e4e50b5ff6e463bd0dcda";
logging-data="844442"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18IM18Us0Ix7hM9ByTKqeSN"
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101
Thunderbird/102.4.2
Cancel-Lock: sha1:9mC456O5AOqy7VO1DZgC+qUgm5U=
In-Reply-To: <3d9a7e78-e49d-4165-806f-b18143a056c5n@googlegroups.com>
Content-Language: en-GB
 by: Harald Oehlmann - Fri, 11 Nov 2022 08:31 UTC

Am 11.11.2022 um 09:22 schrieb Oleg Nemanov:
> пятница, 11 ноября 2022 г. в 11:12:20 UTC+3, Oleg Nemanov:
>> One problem i didn't solve is reporting of conf spec(or conf spec pattern) syntax errors in more meaningful form than "missing value to go with key".
>> This is done in _spec_cmp. In the chain of "elseif" should be an "else" where we test that $vpat is not dict(or string with 1 word). The simple way is
>> call "dict size" inside a catch. But i don't like this, because of the catch even for successful case is 3 times slower, then without it.
>
> We have "string is list", but there is no "string is dict".

Yes, "string is dict" was only included in 8.7.
It would be great to port this back to 8.6.

There are two solutions:

[string is list $s] && ([llength $s] % 2) == 0

or
![catch {dict size $s}]

The first shimmers a present dict to a list, the second pollutes the
error stack

Re: ANNOUNCE: conf 1.0

<40b39ecb-b4c1-45e1-a4a9-7aa1b3e2b9bfn@googlegroups.com>

  copy mid

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

  copy link   Newsgroups: comp.lang.tcl
X-Received: by 2002:ac8:4d9a:0:b0:39c:d479:b1d9 with SMTP id a26-20020ac84d9a000000b0039cd479b1d9mr414229qtw.612.1668156402327;
Fri, 11 Nov 2022 00:46:42 -0800 (PST)
X-Received: by 2002:a05:620a:10b0:b0:6fa:5778:8e with SMTP id
h16-20020a05620a10b000b006fa5778008emr308955qkk.71.1668156402170; Fri, 11 Nov
2022 00:46:42 -0800 (PST)
Path: i2pn2.org!i2pn.org!usenet.blueworldhosting.com!feed1.usenet.blueworldhosting.com!peer03.iad!feed-me.highwinds-media.com!news.highwinds-media.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.tcl
Date: Fri, 11 Nov 2022 00:46:41 -0800 (PST)
In-Reply-To: <tkl185$pokq$2@dont-email.me>
Injection-Info: google-groups.googlegroups.com; posting-host=194.190.114.28; posting-account=RPJNegoAAAAUgD_yLdrci9D1ZtZ1oI0L
NNTP-Posting-Host: 194.190.114.28
References: <7897b77f-f5e6-42e7-90f7-0ce5fb453cffn@googlegroups.com>
<41f664ef-00b2-45c4-8496-dd7517e94a40n@googlegroups.com> <3d9a7e78-e49d-4165-806f-b18143a056c5n@googlegroups.com>
<tkl185$pokq$2@dont-email.me>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <40b39ecb-b4c1-45e1-a4a9-7aa1b3e2b9bfn@googlegroups.com>
Subject: Re: ANNOUNCE: conf 1.0
From: oleg.o.n...@gmail.com (Oleg Nemanov)
Injection-Date: Fri, 11 Nov 2022 08:46:42 +0000
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
X-Received-Bytes: 2044
 by: Oleg Nemanov - Fri, 11 Nov 2022 08:46 UTC

пятница, 11 ноября 2022 г. в 11:31:07 UTC+3, Harald Oehlmann:
> > We have "string is list", but there is no "string is dict".
> Yes, "string is dict" was only included in 8.7.
> It would be great to port this back to 8.6.

I agree. It would be great.
> There are two solutions:
>
> [string is list $s] && ([llength $s] % 2) == 0
>
> or
> ![catch {dict size $s}]
>
> The first shimmers a present dict to a list, the second pollutes the
> error stack

Shimmering to a list is not good, i think. By the way, i think i made some error in my benchmarks with catch. Now i've repeated it and difference in performance is not big.

Re: ANNOUNCE: conf 1.0

<20221111085224.10405ab1@lud1.home>

  copy mid

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

  copy link   Newsgroups: comp.lang.tcl
Path: i2pn2.org!i2pn.org!aioe.org!ac6OoMHkWYPV8qf+a92lSg.user.46.165.242.75.POSTED!not-for-mail
From: no...@no.no (Luc)
Newsgroups: comp.lang.tcl
Subject: Re: ANNOUNCE: conf 1.0
Date: Fri, 11 Nov 2022 08:52:24 -0300
Organization: Aioe.org NNTP Server
Message-ID: <20221111085224.10405ab1@lud1.home>
References: <7897b77f-f5e6-42e7-90f7-0ce5fb453cffn@googlegroups.com>
<41f664ef-00b2-45c4-8496-dd7517e94a40n@googlegroups.com>
<3d9a7e78-e49d-4165-806f-b18143a056c5n@googlegroups.com>
Mime-Version: 1.0
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: 7bit
Injection-Info: gioia.aioe.org; logging-data="7936"; posting-host="ac6OoMHkWYPV8qf+a92lSg.user.gioia.aioe.org"; mail-complaints-to="abuse@aioe.org";
X-Newsreader: Claws Mail 3.14.1 (GTK+ 2.24.31; x86_64-pc-linux-gnu)
X-Notice: Filtered by postfilter v. 0.9.2
 by: Luc - Fri, 11 Nov 2022 11:52 UTC

> We have "string is list", but there is no "string is dict".

Neither do we have [string is array] or [info isarray], but we have
[array exists].

I see there is a [dict exists] command. Can't one make do with it?

proc isdict arg {
if {[dict exists $arg]} {return 1}
return 0
}

No?

--
Luc
>>

Re: ANNOUNCE: conf 1.0

<tklio6$rs8v$1@dont-email.me>

  copy mid

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

  copy link   Newsgroups: comp.lang.tcl
Path: i2pn2.org!i2pn.org!aioe.org!eternal-september.org!reader01.eternal-september.org!.POSTED!not-for-mail
From: ric...@example.invalid (Rich)
Newsgroups: comp.lang.tcl
Subject: Re: ANNOUNCE: conf 1.0
Date: Fri, 11 Nov 2022 13:29:43 -0000 (UTC)
Organization: A noiseless patient Spider
Lines: 33
Message-ID: <tklio6$rs8v$1@dont-email.me>
References: <7897b77f-f5e6-42e7-90f7-0ce5fb453cffn@googlegroups.com> <41f664ef-00b2-45c4-8496-dd7517e94a40n@googlegroups.com> <3d9a7e78-e49d-4165-806f-b18143a056c5n@googlegroups.com> <20221111085224.10405ab1@lud1.home>
Injection-Date: Fri, 11 Nov 2022 13:29:43 -0000 (UTC)
Injection-Info: reader01.eternal-september.org; posting-host="a6482baf5e5e83eb460ab84e29e6ca04";
logging-data="913695"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/HAytrB6zGSSdvAFkromY3"
User-Agent: tin/2.0.1-20111224 ("Achenvoir") (UNIX) (Linux/3.10.17 (x86_64))
Cancel-Lock: sha1:66Tw9dOlhJ/eMB+mIHIif3fxQNU=
 by: Rich - Fri, 11 Nov 2022 13:29 UTC

Luc <no@no.no> wrote:
>> We have "string is list", but there is no "string is dict".
>
> Neither do we have [string is array] or [info isarray], but we have
> [array exists].
>
> I see there is a [dict exists] command. Can't one make do with it?

No, because dict exists tells you if a given key exists inside the
dict, i.e., it looks 'inside' the dict.

> proc isdict arg {
> if {[dict exists $arg]} {return 1}
> return 0
> }
>
> No?

Did you give that a try before posting?

$ rlwrap tclsh
% proc isdict arg {
if {[dict exists $arg]} {return 1}
return 0
}
% set v [dict create a b c d]
a b c d
% isdict $v
wrong # args: should be "dict exists dictionary key ?key ...?"
%

'dict exists' provides the same functionality as 'array exists' (except
for dicts).

1
server_pubkey.txt

rocksolid light 0.9.8
clearnet tor