Hi Gerald,
You are right, there are different ways to style the code.
I'm a bit concerned to call "dict set" several times, if I can create one dictionary and assign it to a key at once.
But additional I try to point out, that there is a sub data structure holding dedicated process related data, which is managed inside a dictionary associated to the process identifier.
And as last point "dict lappend" cannot work this way:
dict lappend processesDict $pid modules $moduleInfoDict
Thus I need to do:
dict set processesDict $pid modules \
[linsert [dict get $processesDict $pid modules] end $moduleInfoDict]
Or in long:
set pidInfoDict [dict get $processesDict $pid]
dict lappen pidInfoDict modules $moduleInfoDict
dict set processesDict $pid $pidInfoDict
Or:
set modules [dict get $processesDict $pid module]
lappen modules $moduleInfoDict
dict set processesDict $pid modules $modules
Thousand ways lead to Rome.
Happy weekend!