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
2 answers

Tcl getting parts out of the string

I'm having troubles getting some parts out of a string. Here is my code : set top [layout peek $::openedFiles($key) -topcell] set dim [layout peek $::openedFiles($key) -bbox $top] # yields output "{name{x1 y1 x2 y2}}" set coord [split $dim…
Jerre_111
  • 79
  • 1
  • 9
2
votes
2 answers

Tcl placing a value of a variable as the name a the variable

I'm having some issues with Tcl. I have a variable that has a string in it. Butt now I want this string to be the name of a next variable. I have found some similar questions on the web, but these are all about placing the value from a variable into…
Jerre_111
  • 79
  • 1
  • 9
2
votes
3 answers

Looking for a search string in a file and printing next word in that line

for example, consider a file "abc.txt" has following content {apple_Text "1"} {banana_Text "2"} {orange_Text "3"} Now, I want to search "apple_Text" keyword in that file and if found it should print second column value in that, i.e. "1". Can I…
Yashwanth Nataraj
  • 183
  • 3
  • 5
  • 16
2
votes
7 answers

search a string in a files if it match replace another string in the same line with some string

h -t 9.641909323 -s 0 -d 29 -p cbr -e 1078 -c 2 -a 0 -i 169 -k MAC r -t 9.650534114 -s 29 -d 29 -p cbr -e 1020 -c 2 -a 0 -i 169 -k MAC + -t 9.650544114 -s 29 -d -1 -p ACK -e 38 -c 2 -a 0 -i 0 -k MAC - -t 9.650544114 -s 29 -d -1 -p ACK -e 38 -c 2…
Naveen.S
  • 730
  • 5
  • 21
2
votes
3 answers

Do I need to use Threads in TCL for my application?

The application I am trying to build is as follows. Java Client <---> TCL server (say Server.tcl) <---> Some other TCL script (say ABC.tcl) I am using Socket programming for the communication between Java Client and TCL server. Now my requirement is…
Peeyushpd
  • 69
  • 13
2
votes
1 answer

Tcl: write lambda and map using tcl 8.6

How do I write and apply a simple lambda function using the tcl 8.6 features "apply" and "lmap"? map (lambda x -> x*x) [list 1 2 3] how can I write the above in Tcl 8.6? The man pages are not that self explanatory for me. Perhaps also a more…
mrsteve
  • 4,082
  • 1
  • 26
  • 63
2
votes
1 answer

ITCL - How to access associative array member inside a class?

How to access associative array member of a class inside the class itself? Itcl is modeled after C++, and in C++ we would write: SomeObject.SomePublicMember = ... How to do the same in Itcl? Without providing accessor procedure for such an array.…
Aryaps
  • 21
  • 1
2
votes
1 answer

How to join without losing special characters?

I have the following string: "name\r {} {} {} {} {} other_name other_name {} {} -600.0 {} {} 860.0 {} {} -" (i.e. string with the special character: \r ). When I join this line then I lose the special charecters. Suppose: set name "name\r {} {} {}…
Vardan Hovhannisyan
  • 1,101
  • 3
  • 17
  • 40
2
votes
1 answer

Find out all files which are 'source' the given tcl file

Is it possible to find out all files which are sources the given .tcl files?
Vardan Hovhannisyan
  • 1,101
  • 3
  • 17
  • 40
2
votes
1 answer

tcl: info frame gives mismatching line number with info body

See the following example: $tclsh % proc test {} { puts "line 2: [info frame 0]" # line 3 \ line 4 puts "line 5: [info frame 0]" } % test line 2: type proc line 2 cmd {info frame 0} proc ::test level 0 line 5: type proc line 5 cmd…
2
votes
1 answer

The real namespace of a class

Inside a constructor, destructor or method, can I find out what namespace the class was created in, so I can just call card in my other classes instead of hard coding it as blackjack::card? namespace eval blackjack { oo::class create card { …
potrzebie
  • 1,768
  • 1
  • 12
  • 25
2
votes
2 answers

Regular expression, tcl

I'm trying to extract the specific lines from a trace file like below: - 0.118224 0 7 ack 40 ------- 1 2.0 7.0 0 2 r 0.118436 1 2 tcp 40 ------- 2 7.1 2.1 0 1 + 0.118436 1 2 ack 40 ------- 2 3.1 2.1 0 3 - 0.118436 1 2 ack 40 ------- 2 4.1 2.1 0 3 r…
SimpleNEasy
  • 879
  • 3
  • 11
  • 32
2
votes
2 answers

Opening a TCL gui within Java code

I have a TCL file which uses Tcl's BWidget package that I've been using as a GUI for my program. I now want to be able to load up this GUI from a separate Java program. I've looked into Jacl and Swank, but they don't seem to do exactly what I…
Say.My.Name.
  • 511
  • 5
  • 19
2
votes
4 answers

how to install tcl in linux system

I am using a Tcl script to change the poller password through spawning the telnet command. I have done this with the script below, and tested it on a Windows machine after installing ActiveTcl8.5.13.0.296436-win32-ix86-threaded spawn telnet…
Piyush
  • 5,145
  • 16
  • 49
  • 71
2
votes
2 answers

TCL regsub plus sign error

What is wrong with this? I can't seem to figure it out regsub {+} $input { } I get this error: couldn't compile regular expression pattern: quantifier operand invalid