The Tcl programming language, and Expect
DESCRIPTION
This course covers the fundamentals of the Tcl
programming language. You'll learn about Tcl commands, quoting
conventions and control structures before we move on to cover
topics such as strings, lists, arrays and regular expressions.
Further topics covered on the course include writing your own
commands (procs), packages, libraries, namespaces and other -
you'll leave the course with a thorough grounding in Tcl.
Tcl is often used as an embedded language, and we'll show
you how it's embedded within applications such as Expect, and
briefly how it's used in association with Tk.
PREREQUISITES
Practical experience in programming in another
computer language. If you are new to computer programming,
please book on our
Learning to program in Tcl course instead.
Getting the most from your Well House Consultants course
[
Link]
SUBJECT BACKGROUND
Tcl is a programming language that's used in a wide variety of
niche applications - ranging from Numerical Control Machines to Integrated
Cirsuit design. It's also very strong as an Engineer's language in system
testing, where the with the additional Expect extension provides a tool
that would be hard to better.
COURSE CONTENT
Tcl Fundamentals |
What is Tcl? (module T201) Tcl, Tk and Expect.
Extended Tcl applications.
Commonly used Tcl scripts.
Who looks after Tcl?
Portability.
Tcl resources. |
Tcl Fundamentals (module T202) "Hello World".
The running environment.
Grouping.
The comment command and more syntax.
Variables.
Reading input.
The expr command. |
Conditionals and Loops (module T203) The if command.
The while command.
The for and foreach commands.
The switch command.
Conditional operators. |
String Handling in Tcl (module T205) Basic string handling commands.
The string command.
Regular expressions.
The elements of a regular expression.
Manipulating matched regular expressions.
Putting it together. |
Lists (module T206) How lists are handles in Tcl.
List-related commands.
Sample programs using lists. |
Procedures and Variable Scope (module T207) Holding commonly used command sequences.
Proc and return.
Variable scope.
Upvar, uplevel and global.
Structured programming and OO.
Packages and namespaces. |
Arrays and dicts (module T208) First use of an array.
Setting up an array.
Referencing elements of an array.
Enquiring on an array.
First use of a dict.
Pure and impure variables.
Arrays rather than lists or dicts.
A wider range of array commands.
Array get and set.
Selecting elements from an array.
Uses of arrays.
Using numeric indexes.
Passing arrays to procs.
Unique keys. |
File and Directory Handling (module T209) Opening, reading and writing files.
File testing and glob.
Directory and file maniplulation. |
Intermediate Tcl programming |
What is Expect? Why use it? (module T211) What is expect? Why use it?
Sample problems.
spawn, expect & send.
Patterns and action.
Special expect variables. |
Expect Processes (module T212) Multiple processes, multiple simultaneous processes.
Interact with multiple processes.
Background processing.
Issues of synchronising and polling multiple processes. |
More on Expect (module T242) Expecting from the user.
More facilities.
Signals.
Slow and human.
Command-line options.
Interact. |
Libraries, Packages and Namespaces (module T213) Startup files.
Libraries and packages.
Locating and loading packages.
Using variables across procs and packages.
Namespaces.
Exporting and importing. |
Other Facilities in Tcl (module T214) Information commands.
Error and Catch.
File handling.
Variable control.
Special variables. |
Applications and some advanced features |
Using Tcl from C (module T243) Embedding a TCL interpreter in a C program.
Adding commands written in C to your Tcl. |
Socket Programming (module T244) Clients and servers.
Overview.
Reaching the right service.
Naming services.
Protocols.
Client programming in Tcl.
A simple client.
Considerations for client programming.
A simple server. |
[incr-Tcl] (module T245) What is [incr-Tcl]?
Where do I get [incr-Tcl]?
"Hello Object World".
Constructors, methods, and objects.
Variable declarations.
Configure and cget methods on objects.
Inheritance, overloading and polymorphism.
Local, ensemble, find, delete and others. |
Advanced Regular Expressions (module T247) Where are regular expressions used?
Anchors, literals, counts and literal groups.
Advanced assertions \m \y \z and friends.
Posix standard literal groups.
Space and greedy counts, {} counts.
Grouping and grouping options.
Back references.
Substitute and execute using subst.
Example - analysing a URL string on a Web server. |
TUTOR and COURSE AUTHOR
Graham Ellis -
graham@wellho.net [
email] [
about Graham]
VENUE
Melksham, Wiltshire
Public courses run at
Well House Manor - our own
purpose fitted training centre and business hotel / conference centre in
Melksham.
• Download Melksham Map - [
pdf file (750k)] • Google Map - [
Link]
PRICE
1 student |
2 students |
3 students |
For 4 or more students
from the same company,
please consider a private course. |
With hotel room £1160.00 (£1392.00 inc VAT) Without room £950.00 (£1140.00 inc VAT) |
With hotel rooms £2270.00 (£2724.00 inc VAT) Without rooms £1850.00 (£2220.00 inc VAT) |
With hotel rooms £3380.00 (£4056.00 inc VAT) Without rooms £2750.00 (£3300.00 inc VAT) |
Notes:
• Multiple discount applies to bookings for second and subsequent delegates on the same running of a course, and on same order.
• Hotel rooms are available for arrival the night before the course starts, for departure after the end of the course on the last day.
|
FOLLOW UPS
If you'll be using Tcl in association with the Tk
graphic widget set, you'll want to stay on for the
Tcl/Tk
course, which runs the following two days.
Upon completion of your course, you'll have online access to the source code of
all the examples from the course, and you'll have access to the
"Ask the Tutor" forum
where you can raise questions. We also encourage you to email the tutor, and
to visit us again to use our library as appropriate.
Certification? - [
Link]
FOR FURTHER INFORMATION
Public (scheduled) courses --
http://www.wellho.net/course/ctc.html
For more information about our public courses in general, such as class size, course times, materials provided, special requests, accommodation list, finding our centre, etc.
Terms and Conditions --
http://www.wellho.net/net/terms.html
Covering topics such as delegate substitution, payment, cancellation policy and other matters.