Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/matlab/14.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Tcl 在'键中设置唯一字符;带keylset的s名称_Tcl - Fatal编程技术网

Tcl 在'键中设置唯一字符;带keylset的s名称

Tcl 在'键中设置唯一字符;带keylset的s名称,tcl,Tcl,我试图用keylset设置键控列表,但显然它不接受唯一字符,例如键名中的点()。 例如,以下代码(Tcl 8.5): 产出: conditions=abc.de hello bar.world Stack bar.dog Exchange keylset data "abc.de" "hello" keylset data "bar.world" "Stack" keylset data "bar.dog" "Exchange" keylkeys data = abc bar 请注意,运行ke

我试图用
keylset
设置键控列表,但显然它不接受唯一字符,例如键名中的点(
)。 例如,以下代码(Tcl 8.5):

产出:

conditions=abc.de hello bar.world Stack bar.dog Exchange
keylset data "abc.de" "hello"
keylset data "bar.world" "Stack"
keylset data "bar.dog" "Exchange"
keylkeys data = abc bar
请注意,运行
keylkeys数据时仅收到2个键


找不到此的任何文档。也许我没有正确使用它?

键控列表使用
作为结构化键分隔符;
后面的部分是一个子键。如果我们打印整个键控列表,我们可以看到事情是如何被解释的:

% puts $data
{abc {{de hello}}} {bar {{world Stack} {dog Exchange}}}
如果需要任意键,请使用字典(可从Tcl 8.5获得)

% puts $data
{abc {{de hello}}} {bar {{world Stack} {dog Exchange}}}
dict set example abc.de "hello"
dict set example bar.world "Stack"
dict set example bar.dog "Exchange"
puts $example
#--> abc.de hello bar.world Stack bar.dog Exchange
puts [dict keys $example]
#--> abc.de bar.world bar.dog