Training, Open Source computer languages

PerlPHPPythonMySQLhttpd / TomcatTclRubyJavaC and C++LinuxCSS

Search our site for:
Home Accessibility Courses Diary The Mouth Forum Resources Site Map About Us Contact
Please visit
http://www.wellho.net/solutions/tcl-brackets-and-braces-in-tcl.html
for the latest update to this page
Brackets and Braces in Tcl

BRACKETS AND BRACES IN TCL

One of the big issues that newcomers feel is most difficult to get their head around in Tcl is when to use square brackets, when to use round brackets, and when to use curly braces.

THE RULE

SQUARE BRACKETS are used to define a block that's run BEFORE the rest of the command on the current line, and the result is substituted into the line.

CURLY BRACES are used to define a block that's deferred - in other words it may be run AFTER the rest of the command on the current line.

NOTES

ROUND BRACKETS are different - they're used either to indicate an array subscript, or to alter operator precedence in an expr command. They are not used in command precedence.

How do I help people remember this? I often equate the Square brackets with the very irritating Donkey in the Shrek Movies that always saying "Pick me ... pick me" ... an irritating but, as it turns out, very necessary and faithful friend.

Donkey Week Horseshoe Sidmouth 2005

This image is reproduced with permission of hobby-box.co.uk where painted horseshoes are offered for sale in support of The Donkey Sanctuary, near Sidmouth, Devon


See also Tcl training course

Please note that articles in this section of our web site were current and correct to the best of our ability when published, but by the nature of our business may go out of date quite quickly. The quoting of a price, contract term or any other information in this area of our website is NOT an offer to supply now on those terms - please check back via our main web site
Related Material

Tcl/Tk - Tcl Fundamentals
Tcl/Tk - A Review of Tcl and Tk Basics
resource index - TclTk
Solutions centre home page

You'll find shorter technical items at The Horse's Mouth and delegate's questions answered at the Opentalk forum.

At Well House Consultants, we provide training courses on subjects such as Ruby, Perl, Python, Linux, C, C++, Tcl/Tk, Tomcat, PHP and MySQL. We're asked (and answer) many questions, and answers to those which are of general interest are published in this area of our site.


WELL HOUSE CONSULTANTS LTD.: Well House Manor • 48 Spa Road • Melksham, Wiltshire • United Kingdom • SN12 7NY
PH: 0800 043 8225 or 01225 708225 • FAX: 0845 8382 405 or 01225 707126 • EMAIL: info@wellho.net • WEB: http://www.wellho.net • SKYPE: wellho