1
大きなファイルから2つの辞書を作成するTclプロシージャがあります。これらの2つの辞書は、私のプログラムの他の部分で慣れるよう手順上記のタイプから cktElementAttrとelementMap:私はこれらのネストされた2つの辞書を返すようにしたいTclから複数のネストされた辞書を返す
...
...
proc makeCircuitData {spiceNetlist} {
#read the spiceNetlist file line by line
# create a dict with multilevel nesting called elementMap that will have the following structure:
# elementMap key1 key2 value12
# elementMap keyA keyB valueAB
# and so on
# ... some other code here ...
# create another dict with multilevel nesting called cktElementAttr that will have the following structure:
# cktElementAttr resistor leftVoltageNode1 rightVoltageNode1 resValue11
# cktElementAttr resistor leftVoltageNode2 rightVoltageNode2 resValue12
# cktElementAttr inductor leftVoltageNode2 rightVoltageNode2 indValue11
# cktElementAttr inductor leftVoltageNode2 rightVoltageNode2 indValue12
# cktElementAttr capacitor leftVoltageNode2 rightVoltageNode2 capValue11
# ... so on...
}
:それはこのようなものです。
Tcl procsから2つの辞書を返すための推奨される方法は何ですか?
ありがとうございました。