error’ name command invalid the fix I can how

huangapple go评论61阅读模式
英文:

How can I fix the 'invalid command name' error when using the 'dict' command in TCL version 8.6 on Ubuntu 20.04?

问题

当我使用TCL命令dict执行一个TCL文件时,我得到了以下错误消息:

无效的命令名称 "dict"

供参考,我在Ubuntu 20.04上使用的是TCL版本8.6。

提前感谢您的帮助。

英文:

when i execute a tcl file by using dctionnary command dict, i obtain error's message , as follow:

invalid command name "dict".

for information i use TCL version 8.6 on ubuntu 20.04.

thanks for your help in advance.

答案1

得分: 1

dict 命令从 Tcl 8.5 版本开始直接内建。这是它的文档页面。我怀疑你可能在使用一个较早的 Tcl 版本(8.4 或之前!),或者你在使用一个非标准的 Tcl 发行版(比如那些用 Java 或 C# 编写的;它们有不同的命令配置文件,通常是因为可用的开发人员工作量不同)。另一个可能性是一个受限制的 Tcl 解释器(一个“安全”解释器),但是 dict 默认会被放入其中。

使用 info patchlevel 命令来确定你到底使用的是哪个版本。如果是经典的 8.4 版本,那么有一个 不受支持的 dict 包可用,它实现了内建命令的部分功能;它是基于 Tcl 内建命令早期草案的后移版本,多年来在主流 Tcl 中已不再需要。

英文:

The dict command is built directly into Tcl from version 8.5 onwards. Here is the documentation page for it. My suspicion is that either you are using an older Tcl version (8.4 or before!) or you are using a non-standard Tcl distribution (such as the ones written in Java or C#; those have different command profiles, often due to differing amounts of developer effort available). Another possibility is a restricted Tcl interpreter (a "safe" interpreter), but dict is put in those by default.

Use info patchlevel to find out exactly what version you are really using. If it is classic 8.4, there is an unsupported dict package out there that does part of what the built-in command does; it was a backport based on early drafts of the Tcl built-in, and hasn't been necessary for mainstream Tcl for many years.

huangapple
  • 本文由 发表于 2023年5月28日 15:46:02
  • 转载请务必保留本文链接:https://go.coder-hub.com/76350455.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定