Hi Gustaf,

It does indeed. All those emails from me can be ignored.

Thank You,
David F


-----Original Message-----
From: Gustaf <neum...@wu.ac.at>
To: naviserver-devel <naviserver-devel@lists.sourceforge.net>
Date: Thursday, 16 January 2025 8:48 AM GMT
Subject: Re: [naviserver-devel] Appending to an multi-element dictonary


Dear David, 

nsv_dict has mostly the same interface as the Tcl dict.
Wasn’t the question answered sufficiently by Harald in 

    https://core.tcl-lang.org/tcl/tktview/47fd91176d  ?

All the best
-g

> On 15.01.2025, at 20:27, Not Spam <uns...@crystalforest.tf> wrote:
> 
> Good evening,
>  
> This may be more a coding issue but I'm not sure if this is by design, 
> limited or programmed to, or that if you shouldn't be able to.
> However I've started heavily using dictionaries within as a in-house 
> data-store and taken it out of context of the standard dictionary key-value 
> design. 
> On count, I am currently creating an dictionary of seven elements.
>  
>     nsv_dict set "MyDictonary" "Store" "Set" "Block" "Key" "Field" "1" "Value 
> 1"
>     nsv_dict set "MyDictonary" "Store" "Set" "Block" "Key" "Field" "2" "Value 
> 2"
>     nsv_dict set "MyDictonary" "Store" "Set" "Block" "Key" "Field" "3" "Value 
> 3"
>  
> nsv_dict get "MyDictonary" "Store" "Set" "Block" "Key" "Field" "2"
>     Result: Value 2
>  
> and full store:
> nsv_dict get "MyDictonary" "Store"
>     Set {Block {Key {Field {1 {Value 1} 2 {Value 2} 3 {Value 3}}}}}
>  
> but if I was to append a forth value to this:
>    nsv_dict append "MyDictonary" "Store" "Set" "Block" "Key" "Field" "4" 
> "Value 4"
>  
> this sets up the next result as:
> Set {Block {Key {Field {1 {Value 1} 2 {Value 2} 3 {Value 
> 3}}}}BlockKeyField4Value 4}
>  
> And that then anything afterwards throws the following error:
> 
> [15/Jan/2025:19:12:11][17646.3ae1efc15100][-conn:default:default:1:1-] Error: 
> GET /dictTest.ix, PeerAddress: 10.2.1.77
> :    dict element in braces followed by "BlockKeyField4Value" instead of space
>  
> My workaround which is of obtaining the result and than appending the new 
> data to that and then setting the appended string as the new value to the 
> same dictionary but it feels klunky.
> I'm not sure how to combat this apart from above. 
>  
> Should appending suppose to work?
>  
> P.S: however as just testing after writing this email, It appears to occur in 
> TCL too.
>   % dict set MyDictonary store set block key field 1 "hello"
> store {set {block {key {field {1 hello}}}}}
>   % dict set MyDictonary store set block key field 2 "hello"
> store {set {block {key {field {1 hello 2 hello}}}}}
>   % dict append MyDictonary store set block key field 3 "hello"
> store {set {block {key {field {1 hello 2 hello}}}}setblockkeyfield3hello}
>  
> Many Thanks,
> David F
>  
> _______________________________________________
> naviserver-devel mailing list
> naviserver-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/naviserver-devel

_______________________________________________
naviserver-devel mailing list
naviserver-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/naviserver-devel


_______________________________________________
naviserver-devel mailing list
naviserver-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/naviserver-devel

Reply via email to