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

Adding/subtracting a second to a UTC timestamp

I have some timestamp data in the form of "2013-07-31T13:31:29" that I need to add a second to. I was having some issue with "clock add" so my plan was to convert the time into epoch time and then increment it. When trying to do this I noticed that…
Joshua
  • 4,270
  • 10
  • 42
  • 62
2
votes
2 answers

Can't pack a widget inside a sibling toplevel

I'm trying to pack (or place) a widget which is child of the root toplevel . inside another toplevel, that is a child of . itself. That is, % toplevel .tl .tl % frame .f .f % pack .f -in .tl can't pack .f inside .tl However, I've found this code…
Marco Pallante
  • 3,923
  • 1
  • 21
  • 26
2
votes
3 answers

How can the -default option for Tk buttons be used?

The docs for Ttk::button's -default option state that it's supposed to be used in dialog boxes, however the only dialog box function I know of is tk_dialog, which can't take buttons as arguments but only the button titles. Does anyone have a working…
Andrej Mitrović
  • 3,322
  • 3
  • 20
  • 33
2
votes
2 answers

How To Distribute a Project Built In a Interpreted Language?

I've started a project(developer text editor) in a interpreted language(Tcl/Tk) and another with Perl(both are open-source), but with some time, when it gets in a Beta version, I will need to distribute it for the users(developers of course), but I…
Nathan Campos
  • 28,769
  • 59
  • 194
  • 300
2
votes
2 answers

how to escape unusual/uniq characters from expect scripts?

in expect script I can set any command or character to run it on remote machine but the sad thing is that expect cant send the same character as they defined in the expect script for example I want to run this line from expect script in order to…
maihabunash
  • 1,632
  • 9
  • 34
  • 60
2
votes
1 answer

generating and saving the bytecode from tcl interpreter

The tcl interpreter converts the code to byte code at runtime, however it is not stored anywhere. Softwares like tclpro does it. Can anyone guide me on how to achieve this i.e. saving the tcl code in bytecode format for running it later, without…
2
votes
2 answers

Parse list of integers (optimization needed for speed test)

I am performing a tiny speed test in order to compare the speed of the Agda programming language with the Tcl scripting language. Its for scientific work and this is just a pre-test, not a real test. I am not in anyway trying to perform a realistic…
mrsteve
  • 4,082
  • 1
  • 26
  • 63
2
votes
4 answers

How Can I access bash variables in tcl(expect) script

How Can I access bash variables in tcl(expect) script. I have bash file say f1.sh which set some variables like export var1=a1 export var2=a2 These variable I need to use in my expect script . I tried using this in my script which does not…
user2622965
  • 23
  • 1
  • 3
2
votes
1 answer

Display a progress bar in an existing tcltk window with R

My program contains a main window in which I would like to display a progress bar. I use tcltk and R. The following code shows how to display a progress bar in a new popped-up window, that is not what I want to do : I want it to be inside a window…
David
  • 4,785
  • 7
  • 39
  • 63
2
votes
2 answers

Why is puts with '[' failing?

Can someone explain why this keeps failing? set hostname "" if {$hostname eq ""} { puts "Usage: host [-u username] [-p password] [-f]" exit 5 } if {[string length $hostname] == 0} { puts "Usage: host [-u username] [-p password] [-f]" …
Zhro
  • 2,546
  • 2
  • 29
  • 39
2
votes
1 answer

Tcl/Tk LstBox width in CombBox

How can I configure the listbox component width in a combobox, so that it will fit to longest entry? The widget width itself (the entry component) can be short, but I'm looking for a way to configure the listbox component to be wider than the…
HardwareEng.
  • 99
  • 1
  • 14
2
votes
1 answer

How do I get stdout from tcl into a python string variable when using tkinter?

I have the following python code... import Tkinter root = Tkinter.Tk() root.tk.eval('puts {printed by tcl}') It prints "printed by tcl" to the screen. How can I capture what the tcl interpreter prints to the screen into a python string. This is a…
Nick
2
votes
2 answers

How to search for a variable and display the next variable in the list in tcl

Hi I want to search a variable in a list and display the next item in the list. Like If I have a list with " aaa bbb ccc eee fff" I want to search for bbb and display the next one in the list which is in this case ccc. I know we have to use lsearch…
user2533429
  • 175
  • 1
  • 6
  • 13
2
votes
1 answer

Error creating PLTCL language on binary windows (7) 64 bit Enterprise DB install

I just installed the latest Postgres binary from Enterprise DB and tried to install some user languages, and but it failed with the following errors: postgres=# create language pltcl; ERROR: could not load library…
forkandwait
  • 5,041
  • 7
  • 23
  • 22
2
votes
1 answer

Tcl upvar to a variable in another proc

I have two procs: From MAIN I call another proc Glob. $Allforces is a list of lists. proc ::MAIN {} { # something ::Glob $AllForces } proc ::Glob {Input} { upvar $Input AllForces # do something } I get "No such variable" as an…
Lumpi
  • 2,697
  • 5
  • 38
  • 47