Semi-OT: Good Tcl Book

More and more I find myself needing to write Tcl. My simulator gets far easier to work with if I've got it scripted than going clicking around. Likewise, all of my configuration and control files under Quartus are Tcl based.

I've poked around through web reference after web reference, and managed to cobble together an approximation of an understanding of Tcl, but I still find myself spending more time playing the "Was that it?" game than I should.

Has anyone got a recommendation for a good Tcl book in dead tree form?

--
Rob Gaddi, Highland Technology -- www.highlandtechnology.com
Email address domain is currently out of order.  See above to fix.
Reply to
Rob Gaddi
Loading thread data ...

to work with if I've got it scripted than going clicking around. Likewise, all of my configuration and control files under Quartus are Tcl based.

cobble together an approximation of an understanding of Tcl, but I still find myself spending more time playing the "Was that it?" game than I should.

Hi Rob, Brent B. Welch: Practical Programming in Tcl and Tk Be sure to get the latest edition (from 2010 ?) to cover the changes up to Tcl 8.5. IIRC the main part of the book is about Tk, however - not astonishing, given the simplicity of Tcl.

Not a dead tree book, but anyway: Are you aware of Tcl Tutor (links at

formatting link
It's an interactive tutorial just about Tcl: You can modify the examples any way you like, and have them execute immediately. Highly recommended.

HTH M.J. Keith

Reply to
Michael Keith

I seem to remember that John Ousterhout's book was more focused on the Tcl language than the Welch book:

formatting link

However, that was 10+ years ago so things might have changed somewhat in the later editions.

I think the most important discovery for programmers learning Tcl is that it does not have syntax, it's only command [arg1 ... argn]. {}, [], "" are just methods for quoting. e.g. "if" is a command which have two or three arguments. The first is evaluated and if it is zero it will execute the second argument (if given), if non-zero it will execute the first one:

% if 0 "puts yes" "puts no" no % if 1 "puts yes" "puts no" yes

% expr 1==1

1 % expr 1==0 0

% set hhh world world % string equal "hello $hhh" {hello world}

1 % string equal "hello $hhh" {hello $hhh} 0 % puts "hello $hhh" hello world % puts {hello $hhh} hello $hhh

You have to learn the quoting rules and then look upp all the different commands on the net or in a book.

//Petter

--
.sig removed by request.
Reply to
Petter Gustad

I use TCL/TK in a nutshell by Paul Raines and Jeff Tranter as a desktop reference. I like it, and it's available pretty cheaply second hand.

Also the TCL website

formatting link
provides a good way of looking up commands etc.

Best regards, Simon

Reply to
Simon Watson

I too have the Brent Welch book (though not the latest edition), and I reckon that it was a good purchase...

--------------------------------------- Posted through

formatting link

Reply to
RCIngham

ElectronDepot website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.