Rocksolid Light

Welcome to novaBBS (click a section below)

mail  files  register  newsreader  groups  login

Message-ID:  

Call me bored, but don't call me boring. -- Larry Wall in <199705101952.MAA00756@wall.org>


devel / comp.lang.tcl / Re: complex Json Data with json from tcllib

SubjectAuthor
* complex Json Data with json from tcllibgreg
`* complex Json Data with json from tcllibsaitology9
 `- complex Json Data with json from tcllibgreg

1
complex Json Data with json from tcllib

<49a38eaa-a398-4cf7-add6-8a55837a9203n@googlegroups.com>

  copy mid

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

  copy link   Newsgroups: comp.lang.tcl
X-Received: by 2002:ac8:7c4b:0:b0:428:a61:cd62 with SMTP id o11-20020ac87c4b000000b004280a61cd62mr425962qtv.8.1703978371777;
Sat, 30 Dec 2023 15:19:31 -0800 (PST)
X-Received: by 2002:ac8:5bcb:0:b0:428:1bcd:49a with SMTP id
b11-20020ac85bcb000000b004281bcd049amr8948qtb.8.1703978371570; Sat, 30 Dec
2023 15:19:31 -0800 (PST)
Path: i2pn2.org!i2pn.org!usenet.blueworldhosting.com!diablo1.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: Sat, 30 Dec 2023 15:19:31 -0800 (PST)
Injection-Info: google-groups.googlegroups.com; posting-host=185.250.212.80; posting-account=99ziWAoAAADLScDbI_CyfIcpa_gFZ0zh
NNTP-Posting-Host: 185.250.212.80
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <49a38eaa-a398-4cf7-add6-8a55837a9203n@googlegroups.com>
Subject: complex Json Data with json from tcllib
From: gregor.e...@googlemail.com (greg)
Injection-Date: Sat, 30 Dec 2023 23:19:31 +0000
Content-Type: text/plain; charset="UTF-8"
X-Received-Bytes: 2269
 by: greg - Sat, 30 Dec 2023 23:19 UTC

How can I create something more complex Json Data
with json from tcllib and process it in tcl. How does this work with json from tcllib?

Or do I have to use rl_json or tjson?

Gregor
Example:

package require json
#https://core.tcl-lang.org/tcllib/doc/trunk/embedded/md/tcllib/files/modules/json/json.md
set jsonData {
"simple": {
"greeting": "Hello, World!",
"number": 123,
"boolean": false,
"nullValue": null
},
"array": [
"apple",
"banana",
"cherry"
],
"nested": {
"level1": {
"level2": {
"level3": "deep value"
}
}
}
}

set tclData1 [catch {::json::json2dict $jsonData} err1 ]
set tclData2 [catch {::json::json2dict {*}$jsonData} err2 ]
set tclData3 [catch {::json::many-json2dict $jsonData} err3 ]
set tclData4 [catch {::json::many-json2dict {*}$jsonData} err4 ]

puts "1: $tclData1 e: $err1"
puts "2: $tclData1 e: $err2"
puts "3: $tclData1 e: $err3"
puts "4: $tclData1 e: $err4"

if {0} {
Output:
1: 0 e: simple
2: 0 e: list element in quotes followed by ":" instead of space
3: 0 e: unexpected token ":" at position 2; expecting VALUE
4: 0 e: list element in quotes followed by ":" instead of space
}

Re: complex Json Data with json from tcllib

<umq9ek$1eelh$1@dont-email.me>

  copy mid

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

  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: saitolo...@gmail.com (saitology9)
Newsgroups: comp.lang.tcl
Subject: Re: complex Json Data with json from tcllib
Date: Sat, 30 Dec 2023 18:34:43 -0500
Organization: A noiseless patient Spider
Lines: 6
Message-ID: <umq9ek$1eelh$1@dont-email.me>
References: <49a38eaa-a398-4cf7-add6-8a55837a9203n@googlegroups.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Sat, 30 Dec 2023 23:34:44 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="cba3b3bd8f0bd231e02d28193b48a061";
logging-data="1522353"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/bX0FqMdCBS0dWB5dX5nlI"
User-Agent: Mozilla Thunderbird
Cancel-Lock: sha1:MtQDmE0WxMJGE5THW9qUOeD8sw8=
In-Reply-To: <49a38eaa-a398-4cf7-add6-8a55837a9203n@googlegroups.com>
Content-Language: en-US
 by: saitology9 - Sat, 30 Dec 2023 23:34 UTC

On 12/30/2023 6:19 PM, greg wrote:
> set jsonData {

I think it is not a valid JSON document. Try enclosing it in an extra
pair of { and } where you say "set jsonData ..."

Re: complex Json Data with json from tcllib

<d89bd72c-ece6-4b3f-8c9f-9f6219bfd90fn@googlegroups.com>

  copy mid

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

  copy link   Newsgroups: comp.lang.tcl
X-Received: by 2002:a05:622a:191f:b0:427:d982:c91c with SMTP id w31-20020a05622a191f00b00427d982c91cmr1097315qtc.3.1703979757066;
Sat, 30 Dec 2023 15:42:37 -0800 (PST)
X-Received: by 2002:a05:620a:1a28:b0:77f:329c:d066 with SMTP id
bk40-20020a05620a1a2800b0077f329cd066mr1112429qkb.12.1703979756868; Sat, 30
Dec 2023 15:42:36 -0800 (PST)
Path: i2pn2.org!i2pn.org!weretis.net!feeder6.news.weretis.net!border-2.nntp.ord.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.tcl
Date: Sat, 30 Dec 2023 15:42:36 -0800 (PST)
In-Reply-To: <umq9ek$1eelh$1@dont-email.me>
Injection-Info: google-groups.googlegroups.com; posting-host=185.250.212.80; posting-account=99ziWAoAAADLScDbI_CyfIcpa_gFZ0zh
NNTP-Posting-Host: 185.250.212.80
References: <49a38eaa-a398-4cf7-add6-8a55837a9203n@googlegroups.com> <umq9ek$1eelh$1@dont-email.me>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <d89bd72c-ece6-4b3f-8c9f-9f6219bfd90fn@googlegroups.com>
Subject: Re: complex Json Data with json from tcllib
From: gregor.e...@googlemail.com (greg)
Injection-Date: Sat, 30 Dec 2023 23:42:37 +0000
Content-Type: text/plain; charset="UTF-8"
Lines: 7
 by: greg - Sat, 30 Dec 2023 23:42 UTC

saitology9 schrieb am Sonntag, 31. Dezember 2023 um 00:34:48 UTC+1:
> On 12/30/2023 6:19 PM, greg wrote:
> > set jsonData {
>
> I think it is not a valid JSON document. Try enclosing it in an extra
> pair of { and } where you say "set jsonData ..."

Thank you, that's it.

1
server_pubkey.txt

rocksolid light 0.9.8
clearnet tor