Changes in Tcl7.5
(Taken from the Release Notice)
Below is a list of the most important changes in Tcl 7.5, relative
to Tcl 7.4. Besides these changes, there have been numerous bug
fixes. For a complete list of absolutely every visible change,
see the "changes" file in the distribution.
- Dynamic loading.
There is a new "load" command for loading binary
extensions into Tcl on the fly. This works now on most of the major
UNIX platforms as well as PCs and Macintoshes. Three new "info"
commands, "info loaded", "info sharedlibextension", and
"info nameofexecutable", were also added as part of the dynamic loading
implementation. You can also create Tcl and Tk themselves as shared
libraries with the --enable-shared switch to the configure script.
- Packages and versions.
There is a new "package" command for
package and version management. See the manual entries for "package"
and "pkg_mkIndex" for details on how to use it. There are also
C APIs to the package mechanism. See PkgRequire.3.
- Multiple interpreters and Safe-Tcl.
There is a new "interp" command
that allows you to create multiple interpreters within a single application
and set up communication between them with "aliases". The mechanism also
supports "safe" interpreters, which provide a generalized version of the
security mechanisms in Borenstein and Rose's Safe-Tcl. There are still
a few missing security features, such as resource control. You can use
"load" to add extensions (including Tk) into slave interpreters.
- The event loop from Tk has been moved to Tcl.
Tcl now has commands
"after", "fileevent", "update", and "vwait" (which replaces tkwait).
The "tkerror" command has been renamed to "bgerror". "Tkerror" is
still supported for backwards compatibility, but you should switch ASAP
to using "bgerror" instead. Many C procedures that used to be in Tk
have been moved to Tcl and renamed, such as Tcl_DoOneEvent, Tcl_DoWhenIdle,
Tcl_CreateFileHandler, and Tcl_CreateTimerHandler.
- Tcl has a whole new I/O system.
All of the Tcl commands like
"open" and "puts" should continue to operate as before, but there
is a totally new implementation that doesn't use the C stdio library:
- The new I/O system is more portable, and it can be extended
with new kinds of I/O channels; see CrtChannel.3 for details.
- Nonblocking I/O is supported on all platforms and there is a
new command "fconfigure" to enable it and other channel options;
see fconfigure.n for details. There is also a new "fblocked"
command.
- The I/O system automatically translates between different
end-of-line representations (such as CR on Macs and CRLF on
PC's) to the newline form used in UNIX and in all Tcl scripts;
the "fconfigure" command can be used to control this feature.
- There is a set of C APIs for manipulating Tcl_Channel's, which
are analogous to UNIX FILE's. The C procedures have roughly the
same functionality as the stdio procedures. See OpenFileChnl.3,
CrtCloseHdlr.3, and CrtChnlHdlr.3 for details.
- There is a new structure Tcl_File that provides platform-
independent access to file handles such as UNIX fd's. See
GetFile.3 for details.
- There are new procedures Tcl_GetErrno and Tcl_SetErrno for
accessing the "errno" variable in a safe and portable fashion.
See SetErrno.3.
- There are new commands
"file split", "file join", and "file pathtype",
which make it possible to handle file names in a way that will work on
all platforms. See the manual entries file.n and filename.n for
details.
- There is a new "socket" command for
network communication via TCP sockets.
It works for both the client and server sides. There
is also C-level support for sockets; see OpenTcp.3.
- There is a new "clock" command,
which contains the functionality of the TclX clock-handling commands.
- . The "foreach" command has been generalized
significantly to support
multiple lists and multiple variables iterating over each list.
- . There is a new "notifier" mechanism,
which was added as part of
the ports. This allows the basic mechanisms for reporting events
to be implemented in different ways on different platforms. It
may also be useful for other purposes, such as merging the Tk and
Xt event loops so that Tk and Xt widgets can coexist in a single
application. See the manual entry Notifier.3 for more information.
- There is an "AssocData" mechanism
that allows extensions to store
their own data in an interpreter and get called back when the interpreter
is deleted. This is visible at C level via the procedures Tcl_SetAssocData
and Tcl_GetAssocData.
- . When manual pages are installed, additional links
are created for
each of the procedures described in the manual page, so that it's
easier to invoke the "man" command.
- There is a new variable "tcl_platform"
with platform information.
This is an associative array with elements like "os" and "machine"
that contain various pieces of information about the platform.
- There is a new procedure
Tcl_CreateExitHandler
that you can use to
make sure a C procedure is called before the Tcl application exits.
- There is a new procedure
Tcl_UpdateLinkedVar
to force the Tcl-level
variable to be updated after you've changed the corresponding C-level
variable.
- The rocedures Tk_Preserve, Tk_Release, and Tk_EventuallyFree
have been moved from Tk to Tcl and given names like Tcl_Preserve.
Incompatibilities
Three incompatibilities were introduced by the changes. All of these
are at C-level, and only the first one should have much impact. Existing
scripts for Tcl 7.4 should run unchanged under Tcl 7.5.
- The procedure Tcl_EnterFile no longer exists.
However, a new
procedure Tcl_MakeFileChannel provides similar functionality.
Tcl_GetOpenFile still exists but only works under UNIX.
Tcl_CreatePipeline also remains, but it too works only under UNIX
now; use Tcl_OpenCommandChannel for better portability.
- Tcl doesn't export any global C variables anymore ,
because this doesn't work with Windows DLLs.
The C variables tcl_AsyncReady and
tcl_FileCloseProc have been replaced with procedures Tcl_AsyncReady()
and Tcl_SetFileCloseProc(). The C variable tcl_RcFileName has been
replaced with a Tcl variable tcl_rcFileName (use Tcl_SetVar to set the
Tcl variable, instead of assigning to the old C variable).
- Files are no longer shared between interpreters by default:
if a file is opened in one interpreter, it cannot normally be used in other
interpreters. However, the new procedure Tcl_ShareHandle allows files
to be shared between interpreters if requested explicitly.
Hops
(hops@sco.com)
$ Last Modified: $Date: 1995/11/14 17:34:15 $: