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

Install TCL/TK without root

I'm trying to install TCL/TK as a regular user on RedHat 5: TCL_VERSION=8.6.1 BASE_PATH=/myownpath tar -xzf tcl${TCL_VERSION}-src.tar.gz cd tcl${TCL_VERSION}/unix ./configure \ --prefix=${BASE_PATH} \ --without-tzdata \ …
crusaderky
  • 2,552
  • 3
  • 20
  • 28
2
votes
2 answers

Tcl List output modification

I have a list named "a" and need to perform some basic list operations and commands to get the desired result in another list "b" This list "a" can contain more elements in any order I have shown one example below (%) set a {{123.4:xyz {p_q[5]}}…
user2643899
  • 165
  • 8
2
votes
3 answers

how to copy some part of the list to a new list in TCL?

I have a list as the following: set list1 {1,2,3,4,5,6,7,8,9} how to copy three elements of it to another list every time? for example after copy: listc1 is {1,2,3} listc2 is {4,5,6} listc3 is {7,8,9}
user2131316
  • 3,111
  • 12
  • 39
  • 53
2
votes
1 answer

Tcl Starkit with MySql

Does anyone know what files are required for MySql to work with a Tcl Starkit? Currently, I have libmySQL.dll, libmysqltcl.dll, and pkgIndex.tcl. The pkgIndex.tcl has the following code: proc loadmysqltcl {dir} { set oldcwd [pwd] cd $dir …
DFM
  • 473
  • 4
  • 15
2
votes
1 answer

Combinations of all charcaters and all lengths with using less number of loops?

Brain Teaser: I self originated this question, but stuck completely. I want to create all possible combination of all characters, but of all possible lengths. Suppose, [a-z] combination of 1 length, then [a-z] combination of 2 length, and so on till…
Vishwadeep Singh
  • 1,043
  • 1
  • 13
  • 38
2
votes
1 answer

TCL : Regarding init.tcl file in TCL

Can anyone explain me what is the use of init.tcl? When actually it is loaded by the TCL interpreter? The description for this file is shown as startup file for TCL . But According to my knowledge .tclshrc is the start up file. Can anyone explain…
velpandian
  • 431
  • 4
  • 11
  • 23
2
votes
2 answers

what is the difference between interpreter and safe interpreter?

Can anyone please explain me what exactly an interpreter . Then what is meant by safe interpreter ? I am new to TCL I am always confused about these words.
user2720323
  • 277
  • 3
  • 6
  • 11
2
votes
1 answer

Regarding expect_out(buffer) in Expect

Can anyone explain the difference between expect_out(buffer) expect_out(0,string) Generally I prefer to use expect_out(buffer) . What is the second one and when can we use that? Can any one explain please?
user2720323
  • 277
  • 3
  • 6
  • 11
2
votes
1 answer

Regarding named pipes behaviour in tcl

I have a question regarding named pipes in tcl. First I created the pipe with mkfifo: mkfifo foo Then execute the following tcl script: set fifo [open "foo" r] fconfigure $fifo -blocking 1 proc read_fifo {} { global fifo puts…
2
votes
7 answers

Can we give array name with hyphen in TCL

I am declaring a array in TCL say set JDSU-12-1(key) element parray JDSU-12-1 I am getting error saying JDSU is not a array Even simple puts statement is not working % puts $JDSU-12-1(key) can't read "JDSU": no such variable Is there any way i can…
Sumit
  • 1,953
  • 6
  • 32
  • 58
2
votes
1 answer

Regarding TCL format command

% format %2s 100 100 % format %.2s 100 10 % % % format %0.2s 100 10 % I am not able to understand the difference between %2s and %.2s . Can anyone explain me ?
user2720323
  • 277
  • 3
  • 6
  • 11
2
votes
2 answers

Manipulating color in Tcl

I want to take a color and get a darker color. The color can come in either form that is allowed for colors in Tcl, i.e. blue or #0000FF or any other form that tcl recognizes as a color. Is there a way to do this? example of what I need, when I get…
SIMEL
  • 8,745
  • 28
  • 84
  • 130
2
votes
5 answers

What is the need for shell when executing tclsh

#!/bin/sh # A Tcl comment, whose contents don't matter \ exec tclsh "$0" "$@" why should we invoke shell here (#!/bin/sh) . We can directly invoke the tclsh (#!/usr/sbin/tclsh) . Let us Assume tclsh is in sbin directoey. Why we are First calling…
velpandian
  • 431
  • 4
  • 11
  • 23
2
votes
3 answers

TCL : difference between "tclsh "$0" ${1+"$@"}"and argc , argv , argv0

#!/bin/sh # -*- tcl -*- # The next line is executed by /bin/sh, but not tcl \ exec tclsh "$0" ${1+"$@"} I am confusing with above 2 things. I came to know that $0 is file name , as well we are getting the filename using argv0. And argv are the…
user2720323
  • 277
  • 3
  • 6
  • 11
2
votes
1 answer

Tcl switch statement and -regexp quoting?

There must be an extra level of evaluation when using the Tcl switch command. Here's an example session at the repl to show what I mean: $ tclsh % regexp {^\s*foo} " foo" 1 % regexp {^\\s*foo} " foo" 0 % switch -regexp " foo" {^\\s*foo {puts…
Greg Buchholz
  • 900
  • 4
  • 17