Exercises
Using the
randomprocedure (page 518), write a Tk script that draws a plot of a large number of random values. Use time (modulo the plot width) as the second dimension in the plot. Look for patterns in the plot.Many Tcl extensions come with libraries that are used by the extension itself but are not documented for users. Look through all the Tcl libraries for useful but undocumented utilities.
Check the version of Expect that you are running. See if you can find a later one. Do your scripts still work?
Use the
timecommand and compare "string match" againstregexpdoing similar things. Is this reflected in the-gland-reflags in theexpectcommand?Time the UNIX
sleepcommand and compare it to the built-insleepcommand. At what point is the difference moot? How does this change if you are on a much slower or faster machine?What
timestampwould exactly duplicate the default output of the UNIXdatecommand? Timedateandtimestamp.Expect does not have a procedure that does the opposite of
timestamp—converts a string to a date represented as an integer. Why is that? Write one anyway.