O'Reilly logo

Practical Programming in Tcl & Tk, Third Edition by Brent B. Welch

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Constructing Code with the list Command

It can be tricky to assemble a command so that it is evaluated properly by eval. The same difficulties apply to commands like after, uplevel, and the Tk send command, all of which have similar properties to eval, except that the command evaluation occurs later or in a different context. Constructing commands dynamically is a source of many problems. The worst part is that you can write code that works sometimes but not others, which can be very confusing.

Use list when constructing commands.

The root of the quoting problems is the internal use of concat by eval and similar commands to concatenate their ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required