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.

  1. 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.
  2. 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.
  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.
  4. 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.
  5. 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:
  6. 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.
  7. 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.
  8. There is a new "clock" command, which contains the functionality of the TclX clock-handling commands.
  9. . The "foreach" command has been generalized significantly to support multiple lists and multiple variables iterating over each list.
  10. . 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.
  11. 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.
  12. . 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.
  13. 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.
  14. There is a new procedure Tcl_CreateExitHandler that you can use to make sure a C procedure is called before the Tcl application exits.
  15. 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.
  16. 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.

  1. 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.
  2. 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).
  3. 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 $: