home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / tkisrc04.zip / README.Tcl < prev    next >
Text File  |  1998-08-13  |  17KB  |  332 lines

  1. Tcl
  2.  
  3. by John Ousterhout (and many others at Sun Microsystems and elsewhere)
  4. john.ousterhout@eng.sun.com
  5.  
  6. SCCS: @(#) README 1.29 96/04/19 11:42:58
  7.  
  8. 1. Introduction
  9. ---------------
  10.  
  11. This directory and its descendants contain the sources and documentation
  12. for Tcl, an embeddable scripting language.  The information here corresponds
  13. to release 7.5.  The most important new feature in this release is support
  14. for the PC and Mac platforms.  In addition, there are major new facilities
  15. for dynamic loading, package and version management, multiple interpreters,
  16. safe execution of untrusted scripts, and a new I/O system that supports
  17. nonblocking I/O and sockets.  This release also contains many bug fixes.
  18. Tcl 7.5 should be backwards compatible with Tcl 7.4 scripts (there are two
  19. small incompatibilities described below, but they are relatively insignificant
  20. and shouldn't affect most existing Tcl code and extensions).
  21.  
  22. 2. Documentation
  23. ----------------
  24.  
  25. The best way to get started with Tcl is to read one of the introductory
  26. books on Tcl:
  27.  
  28.     Tcl and the Tk Toolkit, by John Ousterhout,
  29.     Addison-Wesley, 1994, ISBN 0-201-63337-X
  30.  
  31.     Practical Programming in Tcl and Tk, by Brent Welch,
  32.     Prentice-Hall, 1995, ISBN 0-13-182007-9
  33.  
  34.     Exploring Expect, by Don Libes,
  35.     O'Reilly and Associates, 1995, ISBN 1-56592-090-2
  36.  
  37. The "doc" subdirectory in this release contains a complete set of reference
  38. manual entries for Tcl.  Files with extension ".1" are for programs (for
  39. example, tclsh.1); files with extension ".3" are for C library procedures;
  40. and files with extension ".n" describe Tcl commands.  The file "doc/Tcl.n"
  41. gives a quick summary of the Tcl language syntax.  To print any of the man
  42. pages, cd to the "doc" directory and invoke your favorite variant of
  43. troff using the normal -man macros, for example
  44.  
  45.         ditroff -man Tcl.n
  46.  
  47. to print Tcl.n.  If Tcl has been installed correctly and your "man"
  48. program supports it, you should be able to access the Tcl manual entries
  49. using the normal "man" mechanisms, such as
  50.  
  51.         man Tcl
  52.  
  53. There is also an official home for Tcl and Tk on the Web:
  54.     http://www.sunlabs.com/research/tcl
  55. These Web pages include release updates, reports on bug fixes and porting
  56. issues, HTML versions of the manual pages, and pointers to many other
  57. Tcl/Tk Web pages at other sites.  Check them out!
  58.  
  59. 3. Compiling and installing Tcl
  60. -------------------------------
  61.  
  62. This release contains everything you should need to compile and run
  63. Tcl under UNIX, Macintoshes, and PCs (either Windows NT, Windows 95,
  64. or Win 3.1 with Win32s).
  65.  
  66. Before trying to compile Tcl you should do the following things:
  67.  
  68.     (a) Check for a binary release.  Pre-compiled binary releases are
  69.         available now for PCs and Macintoshes, and they may be available
  70.     in the future for some flavors of UNIX.  Binary releases are much
  71.     easier to install than source releases.  To find out whether a
  72.     binary release is available for your platform, check the home page
  73.     for the Sun Tcl/Tk project (http://www.sunlabs.com/research/tcl)
  74.     and also check in the FTP directory from which you retrieved the
  75.     base distribution.
  76.  
  77.     (b) Check for patches.  Look in the FTP directory from which you
  78.         retrieved the base distribution and see if there are files with
  79.     names like tcl7.5p1.patch, tcl7.5p2.patch, etc.  These files may
  80.     also have .gz or .Z extensions to indicate compression.  If you find
  81.     any patch files, apply them to the source directory in order
  82.     from "p1" up.  To apply an uncompressed patch file such as
  83.     tcl7.5p1.patch, invoke a shell command like the following from
  84.     the directory containing this file:
  85.         patch -p < tcl7.5p1.patch
  86.     If the patch file has a .gz extension, invoke a command like the
  87.     following:
  88.         gunzip -c tcl7.5p1.patch.gz | patch -p
  89.     If the patch file has a .Z extension, it was compressed with
  90.     compress.  To apply it, invoke a command like the following:
  91.         zcat tcl7.5p1.patch.Z | patch -p
  92.     If you're applying a patch to a release that has already been
  93.     compiled, then before applying the patch you should cd to the
  94.     "unix" subdirectory and type "make distclean" to restore the
  95.     directory to a pristine state.
  96.  
  97. Once you've done this, change to the "unix" subdirectory if you're
  98. compiling under UNIX, "win" if you're compiling under Windows, or
  99. "mac" if you're compiling on a Macintosh.  Then follow the instructions
  100. in the README file in that directory for compiling Tcl, installing it,
  101. and running the test suite.
  102.  
  103. 4. Summary of changes in Tcl 7.5
  104. --------------------------------
  105.  
  106. The most important change for Tcl 7.5 is that Tcl now runs on Macintosh
  107. and PC platforms as well as UNIX.  The PC port runs under Windows 3.1
  108. (with Win32s), Windows 95, and Windows NT.  This required a lot of
  109. reorganization of the sources but it didn't require any changes to
  110. Tcl's externally visible interfaces.
  111.  
  112. In addition to the ports, Tcl 7.5 also has many other new features.
  113. The following feature changes have occurred since Tcl 7.4:
  114.  
  115.     1. Dynamic loading.  There is a new "load" command for loading binary
  116.     extensions into Tcl on the fly.  This works now on most of the major
  117.     UNIX platforms as well as PCs and Macintoshes.  Three new "info"
  118.     commands, "info loaded", "info sharedlibextension", and
  119.     "info nameofexecutable", were also added as part of the dynamic loading
  120.     implementation.  You can also create Tcl and Tk themselves as shared
  121.     libraries with the --enable-shared switch to the configure script.
  122.  
  123.     2. Packages and versions.  There is a new "package" command for
  124.     package and version management.  See the manual entries for "package"
  125.     and "pkg_mkIndex" for details on how to use it.  There are also
  126.     C APIs to the package mechanism.  See PkgRequire.3.
  127.     
  128.     3. Multiple interpreters and Safe-Tcl.  There is a new "interp" command
  129.     that allows you to create multiple interpreters within a single application
  130.     and set up communication between them with "aliases".  The mechanism also
  131.     supports "safe" interpreters, which provide a generalized version of the
  132.     security mechanisms in Borenstein and Rose's Safe-Tcl.  There are still
  133.     a few missing security features, such as resource control.  You can use
  134.     "load" to add extensions (including Tk) into slave interpreters.
  135.  
  136.     4. The event loop from Tk has been moved to Tcl.  Tcl now has commands
  137.     "after", "fileevent", "update", and "vwait" (which replaces tkwait).
  138.     The "tkerror" command has been renamed to "bgerror".  "Tkerror" is
  139.     still supported for backwards compatibility, but you should switch ASAP
  140.     to using "bgerror" instead.  Many C procedures that used to be in Tk
  141.     have been moved to Tcl and renamed, such as Tcl_DoOneEvent, Tcl_DoWhenIdle,
  142.     Tcl_CreateFileHandler, and Tcl_CreateTimerHandler.
  143.  
  144.     5. Tcl has a whole new I/O system.  All of the Tcl commands like
  145.     "open" and "puts" should continue to operate as before, but there
  146.     is a totally new implementation that doesn't use the C stdio library:
  147.     - The new I/O system is more portable, and it can be extended
  148.       with new kinds of I/O channels;  see CrtChannel.3 for details.
  149.     - Nonblocking I/O is supported on all platforms and there is a
  150.       new command "fconfigure" to enable it and other channel options;
  151.       see fconfigure.n for details.  There is also a new "fblocked"
  152.       command.
  153.     - The I/O system automatically translates between different
  154.       end-of-line representations (such as CR on Macs and CRLF on
  155.       PC's) to the newline form used in UNIX and in all Tcl scripts;
  156.       the "fconfigure" command can be used to control this feature.
  157.     - There is a set of C APIs for manipulating Tcl_Channel's, which
  158.       are analogous to UNIX FILE's.  The C procedures have roughly the
  159.       same functionality as the stdio procedures.  See OpenFileChnl.3,
  160.       CrtCloseHdlr.3, and CrtChnlHdlr.3 for details.
  161.     - There is a new structure Tcl_File that provides platform-
  162.       independent access to file handles such as UNIX fd's.  See
  163.       GetFile.3 for details.
  164.     - There are new procedures Tcl_GetErrno and Tcl_SetErrno for
  165.       accessing the "errno" variable in a safe and portable fashion.
  166.       See SetErrno.3.
  167.  
  168.     6. There are new commands "file split", "file join", and "file pathtype",
  169.     which make it possible to handle file names in a way that will work on
  170.     all platforms.  See the manual entries file.n and filename.n for
  171.     details.
  172.  
  173.     7. There is a new "socket" command for network communication via
  174.     TCP sockets.  It works for both the client and server sides.  There
  175.     is also C-level support for sockets;  see OpenTcp.3.
  176.  
  177.     8. There is a new "clock" command, which contains the functionality
  178.     of the TclX clock-handling commands.
  179.  
  180.     9. The "foreach" command has been generalized significantly to support
  181.     multiple lists and multiple variables iterating over each list.
  182.  
  183.     10. There is a new "notifier" mechanism, which was added as part of
  184.     the ports.  This allows the basic mechanisms for reporting events
  185.     to be implemented in different ways on different platforms.  It
  186.     may also be useful for other purposes, such as merging the Tk and
  187.     Xt event loops so that Tk and Xt widgets can coexist in a single
  188.     application.  See the manual entry Notifier.3 for more information.
  189.  
  190.     11. There is an "AssocData" mechanism that allows extensions to store
  191.     their own data in an interpreter and get called back when the interpreter
  192.     is deleted.  This is visible at C level via the procedures Tcl_SetAssocData
  193.     and Tcl_GetAssocData.
  194.  
  195.     12. When manual pages are installed, additional links are created for
  196.     each of the procedures described in the manual page, so that it's
  197.     easier to invoke the "man" command.
  198.  
  199.     13. There is a new variable "tcl_platform" with platform information.
  200.     This is an associative array with elements like "os" and "machine"
  201.     that contain various pieces of information about the platform.
  202.  
  203.     14. There is a new procedure Tcl_CreateExitHandler that you can use to
  204.     make sure a C procedure is called before the Tcl application exits.
  205.  
  206.     15. There is a new procedure Tcl_UpdateLinkedVar to force the Tcl-level
  207.     variable to be updated after you've changed the corresponding C-level
  208.     variable.
  209.  
  210.     16. The procedures Tk_Preserve, Tk_Release, and Tk_EventuallyFree
  211.     have been moved from Tk to Tcl and given names like Tcl_Preserve.
  212.  
  213. Three incompatibilities were introduced by the changes.  All of these
  214. are at C-level, and only the first one should have much impact.  Existing
  215. scripts for Tcl 7.4 should run unchanged  under Tcl 7.5.
  216.  
  217.     1. The procedure Tcl_EnterFile no longer exists.  However, a new
  218.     procedure Tcl_MakeFileChannel provides similar functionality.
  219.     Tcl_GetOpenFile still exists but only works under UNIX.
  220.     Tcl_CreatePipeline also remains, but it too works only under UNIX
  221.     now;  use Tcl_OpenCommandChannel for better portability.
  222.  
  223.     2. Tcl doesn't export any global C variables anymore, because this doesn't
  224.     work with Windows DLLs.  The C variables tcl_AsyncReady and
  225.     tcl_FileCloseProc have been replaced with procedures Tcl_AsyncReady()
  226.     and Tcl_SetFileCloseProc().  The C variable tcl_RcFileName has been
  227.     replaced with a Tcl variable tcl_rcFileName (use Tcl_SetVar to set the
  228.     Tcl variable, instead of assigning to the old C variable).
  229.     
  230.     3. Files are no longer shared between interpreters by default:  if a
  231.     file is opened in one interpreter, it cannot normally be used in other
  232.     interpreters.  However, the new procedure Tcl_ShareHandle allows files
  233.     to be shared between interpreters if requested explicitly.
  234.  
  235. For a complete list of all changes in this release, see the file "changes"
  236. in this directory.
  237.  
  238. 5. Tcl newsgroup
  239. -----------------
  240.  
  241. There is a network news group "comp.lang.tcl" intended for the exchange
  242. of information about Tcl, Tk, and related applications.  Feel free to use
  243. the newsgroup both for general information questions and for bug reports.
  244. We read the newsgroup and will attempt to fix bugs and problems reported
  245. to it.
  246.  
  247. When using comp.lang.tcl, please be sure that your e-mail return address
  248. is correctly set in your postings.  This allows people to respond directly
  249. to you, rather than the entire newsgroup, for answers that are not of
  250. general interest.  A bad e-mail return address may prevent you from
  251. getting answers to your questions.  You may have to reconfigure your news
  252. reading software to ensure that it is supplying valid e-mail addresses.
  253.  
  254. 6. Tcl contributed archive
  255. --------------------------
  256.  
  257. Many people have created exciting packages and applications based on Tcl
  258. and/or Tk and made them freely available to the Tcl community.  An archive
  259. of these contributions is kept on the machine ftp.neosoft.com.  You
  260. can access the archive using anonymous FTP;  the Tcl contributed archive is
  261. in the directory "/pub/tcl".  The archive also contains several FAQ
  262. ("frequently asked questions") documents that provide solutions to problems
  263. that are commonly encountered by TCL newcomers.
  264.  
  265. 7. Support and bug fixes
  266. ------------------------
  267.  
  268. We're very interested in receiving bug reports and suggestions for
  269. improvements.  We prefer that you send this information to the
  270. comp.lang.tcl newsgroup rather than to any of us at Sun.  We'll see
  271. anything on comp.lang.tcl, and in addition someone else who reads 
  272. omp.lang.tcl may be able to offer a solution.  The normal turn-around
  273. time for bugs is 2-4 weeks.  Enhancements may take longer and may not
  274. happen at all unless there is widespread support for them (we're
  275. trying to slow the rate at which Tcl turns into a kitchen sink).  It's
  276. very difficult to make incompatible changes to Tcl at this point, due
  277. to the size of the installed base.
  278.  
  279. When reporting bugs, please provide a short tclsh script that we can
  280. use to reproduce the bug.  Make sure that the script runs with a
  281. bare-bones tclsh and doesn't depend on any extensions or other
  282. programs, particularly those that exist only at your site.  Also,
  283. please include three additional pieces of information with the
  284. script:
  285.     (a) how do we use the script to make the problem happen (e.g.
  286.     what things do we click on, in what order)?
  287.     (b) what happens when you do these things (presumably this is
  288.         undesirable)?
  289.     (c) what did you expect to happen instead?
  290.  
  291. The Tcl community is too large for us to provide much individual
  292. support for users.  If you need help we suggest that you post questions
  293. to comp.lang.tcl.  We read the newsgroup and will attempt to answer
  294. esoteric questions for which no-one else is likely to know the answer.
  295. In addition, Tcl support and training are available commercially from
  296. NeoSoft (info@neosoft.com), Computerized Processes Unlimited
  297. (gwl@cpu.com), and Data Kinetics (education@dkl.com).
  298.  
  299. 8. Tcl version numbers
  300. ----------------------
  301.  
  302. Each Tcl release is identified by two numbers separated by a dot, e.g.
  303. 6.7 or 7.0.  If a new release contains changes that are likely to break
  304. existing C code or Tcl scripts then the major release number increments
  305. and the minor number resets to zero: 6.0, 7.0, etc.  If a new release
  306. contains only bug fixes and compatible changes, then the minor number
  307. increments without changing the major number, e.g. 7.1, 7.2, etc.  If
  308. you have C code or Tcl scripts that work with release X.Y, then they
  309. should also work with any release X.Z as long as Z > Y.
  310.  
  311. Alpha and beta releases have an additional suffix of the form a2 or b1.
  312. For example, Tcl 7.0b1 is the first beta release of Tcl version 7.0,
  313. Tcl 7.0b2 is the second beta release, and so on.  A beta release is an
  314. initial version of a new release, used to fix bugs and bad features before
  315. declaring the release stable.  An alpha release is like a beta release,
  316. except it's likely to need even more work before it's "ready for prime
  317. time".  New releases are normally preceded by one or more alpha and beta
  318. releases.  We hope that lots of people will try out the alpha and beta
  319. releases and report problems.  We'll make new alpha/beta releases to fix
  320. the problems, until eventually there is a beta release that appears to
  321. be stable.  Once this occurs we'll make the final release.
  322.  
  323. We can't promise to maintain compatibility among alpha and beta releases.
  324. For example, release 7.1b2 may not be backward compatible with 7.1b1, even
  325. though the final 7.1 release will be backward compatible with 7.0.  This
  326. allows us to change new features as we find problems during beta testing.
  327. We'll try to minimize incompatibilities between beta releases, but if
  328. a major problem turns up then we'll fix it even if it introduces an
  329. incompatibility.  Once the official release is made then there won't
  330. be any more incompatibilities until the next release with a new major
  331. version number.
  332.