02.03.2014 Views

Tornado

Tornado

Tornado

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

<strong>Tornado</strong> 2.0<br />

User’s Guide<br />

including Tcl files that customize the launcher or other components. If<br />

necessary, WRS Technical Support can also send out field-installable patches<br />

in electronic mail.<br />

■<br />

Portability: Implementing the graphical user-interface building blocks as Tcl<br />

extensions makes it possible for WRS to support more kinds of host platforms<br />

more quickly, because the transition between windowing systems (otherwise<br />

often difficult) is encapsulated into a series of well defined internal calls.<br />

Tcl is a scripting language which is designed to be embedded in applications. It can<br />

be embedded in applications that present command-line interfaces (the <strong>Tornado</strong><br />

shell, for example) as well as in those that do not (such as the browser). Almost any<br />

program can benefit from the inclusion of such a language, because it provides a<br />

way for users to combine the program’s features in new and unforeseen ways to<br />

meet their own needs. Many programs implement a command-line interface that<br />

is unique to the particular application. However, application-specific command<br />

line interfaces often have weak languages. Tcl holds some promise of unifying<br />

application command languages. This has an additional benefit: the more<br />

programs use a common language, the easier it is for everyone to learn to use each<br />

additional program that incorporates the language.<br />

To encourage widespread adoption, John Ousterhout (the creator of Tcl) has placed<br />

the language and its implementation in the public domain.<br />

Tk is often mentioned in conjunction with Tcl. Tk is a graphics library that extends<br />

Tcl with graphical-interface facilities. <strong>Tornado</strong> does not currently use Tk, but you<br />

may find Tk useful for your own Tcl applications.<br />

B.2 A Taste of Tcl<br />

Tcl represents all data as ordinary text strings. As you might expect, the stringhandling<br />

features of Tcl are particularly strong. However, Tcl also provides a full<br />

complement of C-like arithmetic operators to manipulate strings that represent<br />

numbers.<br />

The examples in the following sections exhibit some of the fundamental<br />

mechanisms of the Tcl language, in order to provide some of the flavor of working<br />

in Tcl. However, this is only an introduction.<br />

For documentation on all Tcl interfaces in <strong>Tornado</strong> (as well as on C interfaces), see<br />

the <strong>Tornado</strong> API Guide from Wind River Systems.<br />

318

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!