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

Keep mysql connection open

I'm making a eggdrop tcl script to write activity of several public IRC channels to a database (over time this will be 10 to 15 channels I think). I have two options how to handle the database connection in mind. An user says something -> Open a…
David
  • 45
  • 7
2
votes
2 answers

WordNet 3.0 won't install on OS X Mountain Lion (10.8)

When trying to make WordNet 3.0, it exits with error 2. Scrolling up, the following error surfaces: In file included from tkAppInit.c:16: /usr/include/tk.h:78:23: error: X11/Xlib.h: No such file or directory How do we install WordNet on OS X 10.8?
DK_
  • 2,648
  • 2
  • 21
  • 20
2
votes
0 answers

tclmagick load error

I try to call in a Tcl script: load tclmagick.dll and get couldn't load library "TclMagick.dll": invalid argument I've tried the Dependency Walker, which tells me that the msvcrt.exe doesn't export a function named "__adjust_fdiv". However, I have…
Michael
  • 1,464
  • 1
  • 20
  • 40
2
votes
1 answer

Escape string for putting it into regex in TCL

I use Expect as testing framework and write some helper functions to simplify typing of matching patterns for expect command. So I look for function that transform any string into string in which all special regex syntax escaped (like *, |, +, [ and…
gavenkoa
  • 45,285
  • 19
  • 251
  • 303
2
votes
2 answers

TCL throws invalid command name when writing csv data to a matrix within a namespace

This is a bizarre issue that I can't seem to figure out. I am using TCL 8.5 and I am trying read data from a CSV file into matrix using the csv::read2matrix command. However, every time I do it, it says the matrix I am trying to write to is an…
Blitztm
  • 23
  • 2
2
votes
1 answer

regsub match as lindex index, against irc control characters

Well, I've been searching the internet for the last 10+ hours with no luck or success regarding this.. I am attempting to convert irc control codes(colors, etc) into html, the input text plucked from an eggdrop tcl bound event. The bold/underline…
Daedalus
  • 7,586
  • 5
  • 36
  • 61
2
votes
1 answer

Issue with CRYPTO library in F5 BIG-IP: missing required parameter

i'm writing and iRule for the F5 Big-Ip v. 11.x. I have an issue with the CRYPTO library. When I try to decrypt a string in this way set foo [CRYPTO::decrypt -alg rc4 -keyhex $key $to_decrypt] where $key is a string in hex format and $to_decrypt…
rvandoni
  • 3,297
  • 4
  • 32
  • 46
2
votes
2 answers

Problems understanding TCL CATCH exec issue

Got a problem thats being doing my head in for the last 2 days. Im running a tcl script (for an eggdrop) which when triggered, executes a local shell command (child process) and if the command is succesfull it spits out the results. However, if the…
Instronics
  • 79
  • 3
  • 6
2
votes
2 answers

How to Convert a Tcl Listbox Numerical Indice to its Element

I feel that this question has a simple answer; but, for the life of me, I could not figure it out. I am trying to convert a listbox selection to its string element so I can enter it into a database. I understand that I can use .listbox…
DFM
  • 473
  • 4
  • 15
2
votes
2 answers

Tcl: cd back to previous directory

On Unix, cd - can switch back to previous directory. I was wondering if there's a similar command in tcl interpreter can do the same?
Stan
  • 37,207
  • 50
  • 124
  • 185
2
votes
1 answer

"expect" match "send" string, why?

I found that expect command just after send command match data from send command. Let see, my.sh: #!/bin/sh read line echo ok my.exp (some code is redundant, I emulate DejaGNU testing framework...): set passn 0 proc pass {msg} { global passn; incr…
gavenkoa
  • 45,285
  • 19
  • 251
  • 303
2
votes
2 answers

What is the best way in Tcl v8.4 to have a proc return an array?

If I have a proc that needs to return an array to its caller, what is the best way to do this? I following code does not work in Tcl due to inability to $ an array variable: proc mine {} { array set foo { red 1 blue 2 green 3 } $foo } tcl> set…
WilliamKF
  • 41,123
  • 68
  • 193
  • 295
2
votes
3 answers

Comparison of two alphanumeric values in tcl

Can anyone help me in comparing two alphanumeric values in tcl. If say I have two values of versions set val1 "2.1.a" set val2 "1.2.a" And if I want to get the max of two values i.e. $val1 ( as per above example), how can I do that? Is there any…
user1851206
  • 61
  • 1
  • 4
2
votes
1 answer

How to treat tcl string as a hex number and convert it into binary?

I have a tcl string set in a variable. I want to treat it as a hex to convert into binary of it. Can anybody help me to achieve this. Here is what i am doing : $ /usr/bin/tclsh8.5 % set a a1a2a3a4a5a6 a1a2a3a4a5a6 % set b [ string range $a 0 3…
user1497818
  • 375
  • 1
  • 7
  • 16
2
votes
1 answer

How to make Tcl interpreter source a file and open a pipe from shell command simultaneously?

Is there a way to make Tcl interpreter source a file and open a pipe from shell command parallel? In more details, I have a GUI built from tcl/tk. I want my tcl script to source a setting file for GUI variables, and at the same time, open a pipe…