home *** CD-ROM | disk | FTP | other *** search
/ InfoMagic Source Code 1993 July / THE_SOURCE_CODE_CD_ROM.iso / languages / tcl / tcl7.0b1 / README < prev    next >
Encoding:
Text File  |  1993-07-09  |  14.1 KB  |  313 lines

  1. Tcl
  2.  
  3. by John Ousterhout
  4. University of California at Berkeley
  5. ouster@cs.berkeley.edu
  6.  
  7. 1. Introduction
  8. ---------------
  9.  
  10. This directory contains the sources and documentation for Tcl, an
  11. embeddable tool command language.  The information here corresponds
  12. to release 7.0b1, the first beta release of Tcl 7.0.
  13.  
  14. 2. Documentation
  15. ----------------
  16.  
  17. The best way to get started with Tcl is to read the draft of my
  18. upcoming book on Tcl and Tk, which can be retrieved using anonymous
  19. FTP from the directory "tcl" on sprite.berkeley.edu.  Part I of the
  20. book provides an introduction to writing Tcl scripts and Part III
  21. describes how to write C code that uses the Tcl C library procedures.
  22.  
  23. The "doc" subdirectory in this release contains a complete set of manual
  24. entries for Tcl.  Files with extension ".1" are for programs (for
  25. example, tclsh.1); files with extension ".3" are for C library procedures;
  26. and files with extension ".n" describe Tcl commands. The file "doc/Tcl.n"
  27. gives a quick summary of the Tcl language syntax.  To print any of the man
  28. pages, cd to the "doc" directory and invoke your favorite variant of
  29. troff using the normal -man macros, for example
  30.  
  31.         ditroff -man Tcl.n
  32.  
  33. to print Tcl.n.  If Tcl has been installed correctly and your "man"
  34. program supports it, you should be able to access the Tcl manual entries
  35. using the normal "man" mechanisms, such as
  36.  
  37.         man Tcl
  38.  
  39. 3. Compiling and installing Tcl
  40. -------------------------------
  41.  
  42. This release should compile and run "out of the box" on any UNIX-like
  43. system that approximates POSIX, BSD, or System V.  I know that it runs
  44. on workstations from Sun, DEC, H-P, IBM, and Silicon Graphics, and on
  45. PC's running SCO UNIX and Xenix.  To compile Tcl, do the following:
  46.  
  47.     (a) Type "./configure" in this directory.  This runs a configuration
  48.     script created by GNU autoconf, which configures Tcl for your
  49.     system and creates a Makefile.
  50.     
  51.     (b) Type "make".  This will create a library archive called "libtcl.a"
  52.     and an interpreter application called "tclsh" that allows you to type
  53.     Tcl commands interactively or execute script files.
  54.  
  55.     (c) If the make fails then you'll have to personalize the Makefile
  56.         for your site.  You may also wish to personalize the Makefile to
  57.     modify the install directories, etc.  There are comments at the
  58.     beginning of the Makefile that describe the things you might want
  59.     to change and how to change them.
  60.  
  61.     (d) Type "make install" to install Tcl binaries and script files in
  62.         standard places.  You'll need write permission on /usr/local to
  63.     do this.  See the Makefile for details on where things get
  64.     installed.
  65.  
  66.     (e) At this point you can play with Tcl by invoking the "tclsh"
  67.     program and typing Tcl commands.  However, if you haven't installed
  68.     Tcl then you'll first need to set your TCL_LIBRARY variable to
  69.     hold the full path name of the "library" subdirectory.
  70.  
  71. If you have trouble compiling Tcl, I'd suggest looking at the file
  72. "porting.notes".  It contains information that people have sent me about
  73. changes they had to make to compile Tcl in various environments.  I make
  74. no guarantees that this information is accurate, complete, or up-to-date,
  75. but you may find it useful.  If you get Tcl running on a new configuration,
  76. I'd be happy to receive new information to add to "porting.notes".  I'm
  77. also interested in hearing how to change the configuration setup so that
  78. Tcl compiles on additional platforms "out of the box".
  79.  
  80. 4. Test suite
  81. -------------
  82.  
  83. There is a relatively complete test suite for all of the Tcl core in
  84. the subdirectory "tests".  To use it just type "make test" in this
  85. directory.  You should then see a printout of the test files processed.
  86. If any errors occur, you'll see a much more substantial printout for
  87. each error.  See the README file in the "tests" directory for more
  88. information on the test suite.
  89.  
  90. 5. Summary of changes in this release
  91. ------------------------------------------
  92.  
  93. Tcl 7.0 is a major new release that includes several new features
  94. and a few incompatible changes.  For a complete list of all changes
  95. to Tcl in chronological order, see the file "changes".  Those changes
  96. likely to cause compatibility problems with existing C code or Tcl
  97. scripts are specially marked.  The most important changes are
  98. summarized below.
  99.  
  100. Tcl configuration and installation has improved in several ways:
  101.  
  102.     1. GNU autoconf is now used for configuring Tcl prior to compilation.
  103.  
  104.     2. The "tclTest" program no longer exists.  It has been replaced by
  105.     "tclsh", which is a true shell-like program based around Tcl (tclTest
  106.     didn't really work very well as a shell).  There's a new program
  107.     "tcltest" which is the same as "tclsh" except that it includes a
  108.     few extra Tcl commands for testing purposes.
  109.  
  110.     3. A new procedure Tcl_AppInit has been added to separate all of the
  111.     application-specific initialization from the Tcl main program.  This
  112.     should make it easier to build new Tcl applications that include
  113.     extra packages.
  114.  
  115.     4. There are now separate manual entries for each of the built-in
  116.     commands.  The manual entry "Tcl.n", which used to describe all of
  117.     the built-ins plus many other things, now contains a terse but
  118.     complete description of the Tcl language syntax.
  119.  
  120. Here is a list of all of incompatibilities that affect Tcl scripts:
  121.  
  122.     1. There have been several changes to backslash processing:
  123.     - Unknown backslash sequences such as "\a" are now replaced with
  124.       the following character (such as "a");  Tcl used to treat the
  125.       backslash as an ordinary character in these cases, so both the
  126.       backslash and the following character would be passed through.
  127.     - Backslash-newline now eats up any white space after the newline,
  128.       replacing the whole sequence with a single space character.  Tcl
  129.       used to just remove the backslash and newline.
  130.     - The obsolete sequences \Cx, \Mx, \CMx, and \e no longer get
  131.       special treatment.
  132.     - The "format" command no longer does backslash processing on
  133.       its input string.
  134.     You can invoke the csh command below to locate backslash uses that
  135.     may potentially behave differently under Tcl 7.0.  This command
  136.     will print all of the lines from the script files "*.tcl" that may
  137.     not work correctly under Tcl 7.0:
  138.     egrep '(\\$)|(\\[^][bfnrtv\0-9{}$ ;"])' *.tcl
  139.     In some cases the command may print lines that are actually OK.
  140.  
  141.     2. The "glob" command now returns only the names of files that
  142.     actually exist, and it only returns names ending in "/" for files
  143.     that are directories.
  144.  
  145.     3. When Tcl prints floating-point numbers (e.g. in the "expr" command)
  146.     it ensures that the numbers contain a "." or "e" so that they don't
  147.     look like integers.
  148.  
  149.     4. The "regsub" command now overwrites its result variable in all cases.
  150.     If there is no match, then the source string is copied to the result.
  151.  
  152.     5. The "exec", "glob", "regexp", and "regsub" commands now include a
  153.     "--" switch;  if the first non-switch argument starts with a "-" then
  154.     there must be a "--" switch or the non-switch argument will be treated
  155.     as a switch.
  156.  
  157.     6. The keyword "UNIX" in the variable "errorCode" has been changed to
  158.     "POSIX".
  159.  
  160. Here is a list of all of the incompatibilities that affect C code that
  161. uses the Tcl library procedures.  If you use an ANSI C compiler then
  162. any potential problems will be detected when you compile your code:  if
  163. your code compiles cleanly then you don't need to worry about anything.
  164.  
  165.     1. Tcl_TildeString now takes a dynamic string as an argument, which is
  166.     used to hold the result.
  167.     
  168.     2. tclHash.h has been eliminated;  its contents are now in tcl.h.
  169.  
  170.     3. The Tcl_History command has been eliminated:  the "history" command
  171.     is now automatically part of the interpreter.
  172.  
  173.     4. The Tcl_Fork and Tcl_WaitPids procedures have been deleted (just
  174.     use fork and waitpid instead).
  175.  
  176.     5. The "flags" and "termPtr" arguments to Tcl_Eval have been eliminated,
  177.     as has the "noSep" argument to Tcl_AppendElement and the TCL_NO_SPACE
  178.     flag for Tcl_SetVar and Tcl_SetVar2.
  179.  
  180.     6. The Tcl_CmdBuf structure has been eliminated, along with the procedures
  181.     Tcl_CreateCmdBuf, Tcl_DeleteCmdBuf, and Tcl_AssembleCmd.  Use dynamic
  182.     strings instead.
  183.     
  184.     7. Tcl_SetVar and Tcl_UnsetVar2 now return TCL_OK or TCL_ERROR instead
  185.     of 0 or -1.
  186.  
  187.     8. Tcl_UnixError has been renamed to Tcl_PosixError.
  188.  
  189. Below is a sampler of the most important new features in Tcl 7.0.  Refer
  190. to the "changes" file for a complete list.
  191.  
  192.     1. The "expr" command supports transcendental and other math functions,
  193.     plus it allows you to type expressions in multiple arguments.  Its
  194.     numerics have also been improved in several ways (e.g. support for
  195.     NaN).
  196.  
  197.     2. The "format" command now supports XPG3 %n$ conversion specifiers.
  198.  
  199.     3. The "exec" command supports many new kinds of redirection such as
  200.     >> and >&, plus it allows you to leave out the space between operators
  201.     like < and the file name.  For processes put into the background,
  202.     "exec" returns a list of process ids.
  203.  
  204.     4. The "lsearch" command now supports regular expressions and exact
  205.     matching.
  206.  
  207.     5. The "lsort" command has several new switches to control the
  208.     sorting process (e.g. numerical sort, user-provided sort function,
  209.     reverse sort, etc.).
  210.  
  211.     6. There's a new command "pid" that can be used to return the current
  212.     process ids or the process ids from an open file that refers to a
  213.     pipeline.
  214.  
  215.     7. There's a new command "switch" that should now be used instead
  216.     of "case".  It supports regular expressions and exact matches, and
  217.     also uses single patterns instead of pattern lists.  "Case" is
  218.     now deprecated, although it's been retained for compatibility.
  219.  
  220.     8. A new dynamic string library has been added to make it easier to
  221.     build up strings and lists of arbitrary length.  See the manual entry
  222.     "DString.3".
  223.  
  224.     9. Variable handling has been improved in several ways:  you can
  225.     now use whole-array traces to create variables on demand, you can
  226.     delete variables during traces, you can upvar to array elements,
  227.     and you can retarget an upvar variable to stop through a sequence
  228.     of variables.  Also, there's a new library procedure Tcl_LinkVar
  229.     that can be used to associated a C variable with a Tcl variable and
  230.     keep them in sync.
  231.  
  232.     10. A new library procedure Tcl_CommandInfo allows you to retrieve
  233.     the clientData of a command.
  234.  
  235. 6. Tcl newsgroup
  236. -----------------
  237.  
  238. There is a network news group "comp.lang.tcl" intended for the exchange
  239. of information about Tcl, Tk, and related applications.  Feel free to use
  240. the newsgroup both for general information questions and for bug reports.
  241. I read the newsgroup and will attempt to fix bugs and problems reported
  242. to it.
  243.  
  244. 7. Tcl contributed archive
  245. --------------------------
  246.  
  247. Many people have created exciting packages and applications based on Tcl
  248. and made them freely available to the Tcl community.  An archive of these
  249. contributions is kept on the machine harbor.ecn.purdue.edu.  You can
  250. access the archive using anonymous FTP;  the Tcl contributed archive is
  251. in the directory "pub/tcl".
  252.  
  253. 8. Support and bug fixes
  254. ------------------------
  255.  
  256. I'm very interested in receiving bug reports and suggestions for
  257. improvements.  Bugs usually get fixed quickly (particularly if they
  258. are serious), but enhancements may take a while and may not happen at
  259. all unless there is widespread support for them (I'm trying to slow
  260. the rate at which Tcl turns into a kitchen sink).  It's almost impossible
  261. to make incompatible changes to Tcl at this point.
  262.  
  263. The Tcl community is too large for me to provide much individual
  264. support for users.  If you need help I suggest that you post questions
  265. to comp.lang.tcl.  I read the newsgroup and will attempt to answer
  266. esoteric questions for which no-one else is likely to know the answer.
  267. In addition, Tcl support and training are available commercially from
  268. NeoSoft.  For more information, send e-mail to "info@neosoft.com".
  269.  
  270. 9. Tcl release organization
  271. ---------------------------
  272.  
  273. Each Tcl release is identified by two numbers separated by a dot, e.g.
  274. 6.7 or 7.0.  If a new release contains changes that are likely to break
  275. existing C code or Tcl scripts then the major release number increments
  276. and the minor number resets to zero: 6.0, 7.0, etc.  If a new release
  277. contains only bug fixes and compatible changes, then the minor number
  278. increments without changing the major number, e.g. 7.1, 7.2, etc.  If
  279. you have C code or Tcl scripts that work with release X.Y, then they
  280. should also work with any release X.Z as long as Z > Y.
  281.  
  282. Beta releases have an additional suffix of the form bx.  For example,
  283. Tcl 7.0b1 is the first beta release of Tcl version 7.0, Tcl 7.0b2 is
  284. the second beta release, and so on.  A beta release is an initial
  285. version of a new release, used to fix bugs and bad features before
  286. declaring the release stable.  Each new release will be preceded by
  287. one or more beta releases.  I hope that lots of people will try out
  288. the beta releases and report problems back to me.  I'll make new beta
  289. releases to fix the problems, until eventually there is a beta release
  290. that appears to be stable.  Once this occurs I'll remove the beta
  291. suffix so that the last beta release becomes the official release.
  292.  
  293. If a new release contains incompatibilities (e.g. 7.0) then I can't
  294. promise to maintain compatibility among its beta releases.  For example,
  295. release 7.0b2 may not be backward compatible with 7.0b1.  I'll try
  296. to minimize incompatibilities between beta releases, but if a major
  297. problem turns up then I'll fix it even if it introduces an
  298. incompatibility.  Once the official release is made then there won't
  299. be any more incompatibilities until the next release with a new major
  300. version number.
  301.  
  302. 10. Compiling on non-UNIX systems
  303. --------------------------------
  304.  
  305. The Tcl features that depend on system calls peculiar to UNIX (stat,
  306. fork, exec, times, etc.) are now separate from the main body of Tcl,
  307. which only requires a few generic library procedures such as malloc
  308. and strcpy.  Thus it should be relatively easy to compile Tcl for
  309. non-UNIX machines such as MACs and DOS PC's, although a number of
  310. UNIX-specific commands will be absent (e.g.  exec, time, and glob).
  311. See the comments at the top of Makefile for information on how to
  312. compile without the UNIX features.
  313.