Questions tagged [tcl]

Tool Command Language was invented by John Ousterhout as a way to make it easy to write little languages for configuring EDA tools, but it has grown far beyond those humble beginnings to become a general scripting language with built-in asynchronous I/O and Unicode strings while supporting paradigms such as object-oriented programming and coroutines.

Tool Command Language was invented by John Ousterhout as a way to make it easy to write little languages for configuring EDA tools, but it has grown far beyond those humble beginnings to become a general scripting language with built-in asynchronous I/O and Unicode strings while supporting paradigms such as object-oriented programming and coroutines. See the Wikipedia page for Tcl for more information.

The current recommended production release of Tcl is Tcl/Tk 8.6.13 (Nov 22, 2022).

Previous versions of the language are currently relatively common. Tcl 8.5 is widely deployed (current patch version 8.5.18). As is Tcl 8.4 in more conservative deployments (8.4.20 is current, but end-of-lifed there). Use of Tcl 8.4 or earlier is usually not recommended, as it does not receive security-fix support from the Tcl developers.

Naming

You may write the language name as either TCL or Tcl; practitioners tend to prefer the latter on the grounds that it means they don't have to hold the shift key down so long. For pronunciation purposes, either “tee cee ell” or “tickle” are acceptable, depending on audience.

Resources

Questions:

Books:

Websites:

7879 questions
2
votes
1 answer

Difference in behavior between [file normalize $path] and realpath($path) when symbolic link is followed by `..`

I have found a difference in behavior between Tcl's [file normalize $path] and the path resolution used by the calls in C, such as open() and realpath(). It revolves around the use of symbolic links immediately followed by ... The setup: given this…
Trey Jackson
  • 73,529
  • 11
  • 197
  • 229
2
votes
2 answers

Find the max absolute value of values in a dict using TCL

I have a list eg MyList set MyList [ list 508 1.648E-01 509 1.670E-01 510 1.701E-01 511 1.740E-01 512 1.784E-01 ] How can I extract the Key / Value pair where: The absolute value of the values is max within the list ?? (What a sentence...) In…
Lumpi
  • 2,697
  • 5
  • 38
  • 47
2
votes
3 answers

TCL, expect: Multiple files w/ SCP

I was able to transfer files with scp and expect, now I tried to upload several files at once: #!/usr/bin/expect -f # Escapes spaces in a text proc esc text { return [regsub -all {\ } $text {\\&}] } # Uploads several files to a specified…
3244611user
  • 224
  • 2
  • 10
2
votes
1 answer

can't use non-numeric string as operand of "&" in TCL

if { ($name1 == "john") & ($name2 == "smith") } { puts "hello world" } i got error:can't use non-numeric string as operand of "&" I have try : if { $name1 == "john" & $name2 == "smith" } { puts "hello world" } if { {$name1 ==…
eniac05
  • 477
  • 4
  • 10
  • 23
2
votes
1 answer

TCL/TK bad window or path name when adding a button

I keep getting "bad window or path name" when trying to add the first button. And i do not have a clou why... I'm pretty shure to have used the same syntax elsewhere without problems... tk::toplevel ".topbox" wm title .topbox "SnapShooter" wm…
Lumpi
  • 2,697
  • 5
  • 38
  • 47
2
votes
3 answers

Understanding Tcl Polymorphism

In Tcl a variable and a procs can have the same name ... for instance I can have set container(alist) {} proc container a {puts " do something"} Um ... what other forms of polymorphism exist in tcl? ... I am looking at some code and I see stuff…
Xofo
  • 21
  • 1
2
votes
1 answer

Linker errors against custom built tcl85.lib, works against ActiveState distribution's tcl85.lib

We are building Tcl ourselves in order to distribute our own compiled binaries with an application. The application itself links against the Tcl library and uses the API internally. To build Tcl we got the sources from…
Jaco Naude
  • 95
  • 1
  • 7
2
votes
1 answer

How does one get the address of a Tcl proc?

I need the address of a Tcl callback routine so I can pass it (using ffidl::callout) to a C DLL's SetCallback routine, i.e. the C prototype is: int SetCallback(long lAddress);
2
votes
2 answers

recognize newline with regex in tcl

I have an expression like: ENTITY first VHDL language standard: 3 (VHDL-2008) ARCHITECTURE BODY arch VHDL language standard: 3 (VHDL-2008) Now I want a regexp for only the first paranthesis after ENTITY so the result should be VHDL-2008…
Sadık
  • 4,249
  • 7
  • 53
  • 89
2
votes
1 answer

How to get TCL script name from a C handler

I have a C application that can execute TCL scripts, and many custom TCL commands that are implemented in C and registered with Tcl_CreateObjCommand. In the implementation of a command I want to find out a filename of the TCL script that has called…
Radagast
  • 85
  • 9
2
votes
1 answer

Expect spawned snx process dies

I am trying to automate the establishment of a VPN connection that uses snx. Was hoping someone could help figure out why in the below expect script, the spawned snx process just dies expect reaches 'expect eof'. If I run the below script and watch…
SS781
  • 2,507
  • 2
  • 14
  • 17
2
votes
1 answer

Alternate GUI toolkits for Tcl

Other than Tk are there any other toolkits that can be used with Tcl to provide a GUI?
Pac
  • 23
  • 7
2
votes
2 answers

How to interrupt Tcl_eval

I have a small shell application that embeds Tcl 8.4 to execute some set of Tcl code. The Tcl interpreter is initialized using Tcl_CreateInterp. Everything is very simple: user types Tcl command the command gets passed to Tcl_Eval for…
ilya1725
  • 4,496
  • 7
  • 43
  • 68
2
votes
1 answer

currently selected tab of ttk::notebook

I've created a window with menu and two notebook tabs. In the menu I have a button "Open" and it's opening me a file aaa.txt in a text widget in notebook tab 1. The problem is that I would like to open it not in tab 1 but in current…
lucas
  • 53
  • 5
2
votes
3 answers

TCL split text string to multiple variables (eggdrop)

I am working on a mysql select and insert script but i am having issues with extracting a single line into two variables. The line is handed as variable $arg and is composed by: "text field 1=text field 2" i try to split $arg by regexp using "=" as…
hophans
  • 53
  • 1
  • 5