From 6b9dd216db20bac6c76552a6193d67a01e1d34ee Mon Sep 17 00:00:00 2001 From: dgp Date: Fri, 26 Oct 2007 20:11:50 +0000 Subject: * changes: Updated for 8.5b2 release. * doc/*.1: Revert doc changes that broke * doc/*.3: `make html` so we can get the release * doc/*.n: out the door. --- ChangeLog | 4 + changes | 4 +- doc/AppInit.3 | 6 +- doc/BackgdErr.3 | 5 +- doc/CrtChannel.3 | 10 +- doc/CrtSlave.3 | 23 +-- doc/DString.3 | 8 +- doc/Encoding.3 | 18 +- doc/Eval.3 | 13 +- doc/ExprLong.3 | 9 +- doc/ExprLongObj.3 | 9 +- doc/FileSystem.3 | 18 +- doc/GetInt.3 | 19 +- doc/Hash.3 | 34 ++-- doc/LinkVar.3 | 11 +- doc/Notifier.3 | 6 +- doc/PrintDbl.3 | 13 +- doc/RegExp.3 | 95 +++------ doc/SetResult.3 | 9 +- doc/SetVar.3 | 7 +- doc/SplitList.3 | 6 +- doc/StdChannels.3 | 9 +- doc/StrMatch.3 | 5 +- doc/SubstObj.3 | 12 +- doc/TCL_MEM_DEBUG.3 | 15 +- doc/Tcl.n | 56 ++---- doc/Tcl_Main.3 | 12 +- doc/TraceVar.3 | 7 +- doc/Translate.3 | 5 +- doc/WrongNumArgs.3 | 5 +- doc/after.n | 4 +- doc/append.n | 11 +- doc/apply.n | 13 +- doc/array.n | 12 +- doc/bgerror.n | 4 +- doc/binary.n | 26 +-- doc/break.n | 4 +- doc/catch.n | 4 +- doc/cd.n | 4 +- doc/chan.n | 27 +-- doc/clock.n | 196 ++++++++---------- doc/close.n | 4 +- doc/concat.n | 22 +-- doc/continue.n | 4 +- doc/dde.n | 18 +- doc/dict.n | 6 +- doc/encoding.n | 13 +- doc/eof.n | 4 +- doc/exec.n | 61 ++---- doc/expr.n | 43 ++-- doc/fcopy.n | 28 +-- doc/file.n | 105 ++++------ doc/fileevent.n | 9 +- doc/filename.n | 51 +++-- doc/for.n | 4 +- doc/format.n | 16 +- doc/glob.n | 83 +++----- doc/history.n | 10 +- doc/http.n | 15 +- doc/if.n | 5 +- doc/info.n | 22 +-- doc/interp.n | 11 +- doc/join.n | 11 +- doc/lappend.n | 10 +- doc/lassign.n | 32 ++- doc/library.n | 18 +- doc/lindex.n | 26 ++- doc/llength.n | 6 +- doc/load.n | 17 +- doc/lrange.n | 12 +- doc/lrepeat.n | 27 ++- doc/lreplace.n | 12 +- doc/lreverse.n | 24 +-- doc/lsearch.n | 62 +++--- doc/lset.n | 34 ++-- doc/lsort.n | 11 +- doc/mathfunc.n | 59 ++---- doc/mathop.n | 7 +- doc/memory.n | 30 ++- doc/msgcat.n | 83 +++----- doc/namespace.n | 21 +- doc/open.n | 71 +++---- doc/package.n | 114 ++++------- doc/packagens.n | 5 +- doc/pkgMkIndex.n | 18 +- doc/re_syntax.n | 546 +++++++++++++++----------------------------------- doc/read.n | 8 +- doc/refchan.n | 18 +- doc/regexp.n | 52 ++--- doc/registry.n | 7 +- doc/regsub.n | 56 ++---- doc/return.n | 97 +++++---- doc/scan.n | 5 +- doc/source.n | 24 +-- doc/split.n | 17 +- doc/string.n | 87 ++------ doc/subst.n | 52 ++--- doc/switch.n | 9 +- doc/tclsh.1 | 12 +- doc/tcltest.n | 557 +++++++++++++++++++++++++--------------------------- doc/tclvars.n | 30 +-- doc/time.n | 7 +- doc/tm.n | 63 +++--- doc/trace.n | 22 +-- doc/update.n | 5 +- doc/uplevel.n | 9 +- doc/upvar.n | 10 +- 107 files changed, 1408 insertions(+), 2287 deletions(-) diff --git a/ChangeLog b/ChangeLog index 0124ea2..3ad345a 100644 --- a/ChangeLog +++ b/ChangeLog @@ -4,6 +4,10 @@ * changes: Updated for 8.5b2 release. + * doc/*.1: Revert doc changes that broke + * doc/*.3: `make html` so we can get the release + * doc/*.n: out the door. + * README: Bump version number to 8.5b2. * generic/tcl.h: * library/init.tcl: diff --git a/changes b/changes index d1e586c..6bb5c54 100644 --- a/changes +++ b/changes @@ -1,6 +1,6 @@ Recent user-visible changes to Tcl: -RCS: @(#) $Id: changes,v 1.120 2007/10/26 15:53:43 dgp Exp $ +RCS: @(#) $Id: changes,v 1.121 2007/10/26 20:11:50 dgp Exp $ 1. No more [command1] [command2] construct for grouping multiple commands on a single command line. @@ -7035,6 +7035,4 @@ on Windows to be larger than the default [interp recursionlimit] value. 2007-10-25 (bug fix)[1726873] intermittent crash in threads (vasiljevic) -New doc macros for improved formatting. Docs updated to use. (fellows) - --- Released 8.5b2, October 26, 2007 --- See ChangeLog for details --- diff --git a/doc/AppInit.3 b/doc/AppInit.3 index 0ac4f94..52f5d62 100644 --- a/doc/AppInit.3 +++ b/doc/AppInit.3 @@ -5,7 +5,7 @@ '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. '\" -'\" RCS: @(#) $Id: AppInit.3,v 1.6 2007/10/24 14:29:37 dkf Exp $ +'\" RCS: @(#) $Id: AppInit.3,v 1.7 2007/10/26 20:11:51 dgp Exp $ '\" .so man.macros .TH Tcl_AppInit 3 7.0 Tcl "Tcl Library Procedures" @@ -26,9 +26,7 @@ Interpreter for the application. .SH DESCRIPTION .PP -\fBTcl_AppInit\fR is a -.QW hook -procedure that is invoked by +\fBTcl_AppInit\fR is a ``hook'' procedure that is invoked by the main programs for Tcl applications such as \fBtclsh\fR and \fBwish\fR. Its purpose is to allow new Tcl applications to be created without modifying the main programs provided as part of Tcl and Tk. diff --git a/doc/BackgdErr.3 b/doc/BackgdErr.3 index f8a516f..3817319 100644 --- a/doc/BackgdErr.3 +++ b/doc/BackgdErr.3 @@ -5,7 +5,7 @@ '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. '\" -'\" RCS: @(#) $Id: BackgdErr.3,v 1.5 2007/10/24 14:29:37 dkf Exp $ +'\" RCS: @(#) $Id: BackgdErr.3,v 1.6 2007/10/26 20:11:51 dgp Exp $ '\" .so man.macros .TH Tcl_BackgroundError 3 7.5 Tcl "Tcl Library Procedures" @@ -26,8 +26,7 @@ Interpreter in which the error occurred. .SH DESCRIPTION .PP This procedure is typically invoked when a Tcl error occurs during -.QW "background processing" -such as executing an event handler. +``background processing'' such as executing an event handler. When such an error occurs, the error condition is reported to Tcl or to a widget or some other C code, and there is not usually any obvious way for that code to report the error to the user. diff --git a/doc/CrtChannel.3 b/doc/CrtChannel.3 index c4c61f4..e7fb800 100644 --- a/doc/CrtChannel.3 +++ b/doc/CrtChannel.3 @@ -5,7 +5,7 @@ '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. '\" -'\" RCS: @(#) $Id: CrtChannel.3,v 1.36 2007/10/24 14:29:37 dkf Exp $ +'\" RCS: @(#) $Id: CrtChannel.3,v 1.37 2007/10/26 20:11:51 dgp Exp $ .so man.macros .TH Tcl_CreateChannel 3 8.4 Tcl "Tcl Library Procedures" .BS @@ -873,14 +873,10 @@ so you get for instance: .CE when called with \fIoptionList\fR="peername sockname" .PP -.QW blah -is the \fIoptionName\fR argument and -.QW "" +``blah'' is the \fIoptionName\fR argument and ``'' is a space separated list of specific option words. The function takes good care of inserting minus signs before -each option, commas after, and an -.QW or -before the last option. +each option, commas after, and an ``or'' before the last option. .SH "OLD CHANNEL TYPES" The original (8.3.1 and below) \fBTcl_ChannelType\fR structure contains the following fields: diff --git a/doc/CrtSlave.3 b/doc/CrtSlave.3 index 4322825..3485841 100644 --- a/doc/CrtSlave.3 +++ b/doc/CrtSlave.3 @@ -4,7 +4,7 @@ '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. '\" -'\" RCS: @(#) $Id: CrtSlave.3,v 1.17 2007/10/24 14:29:37 dkf Exp $ +'\" RCS: @(#) $Id: CrtSlave.3,v 1.18 2007/10/26 20:11:51 dgp Exp $ '\" .so man.macros .TH Tcl_CreateSlave 3 7.6 Tcl "Tcl Library Procedures" @@ -61,9 +61,7 @@ Interpreter in which to execute the specified command. .AP "const char" *slaveName in Name of slave interpreter to create or manipulate. .AP int isSafe in -If non-zero, a -.QW safe -slave that is suitable for running untrusted code +If non-zero, a ``safe'' slave that is suitable for running untrusted code is created, otherwise a trusted slave is created. .AP Tcl_Interp *slaveInterp in Interpreter to use for creating the source command for an alias (see @@ -128,21 +126,16 @@ It also creates a slave command named \fIslaveName\fR in \fIinterp\fR which allows \fIinterp\fR to manipulate the new slave. If \fIisSafe\fR is zero, the command creates a trusted slave in which Tcl code has access to all the Tcl commands. -If it is \fB1\fR, the command creates a -.QW safe -slave in which Tcl code has access only to set of Tcl commands defined as -.QW "Safe Tcl" ; -see the manual entry for the Tcl \fBinterp\fR command for details. +If it is \fB1\fR, the command creates a ``safe'' slave in which Tcl code +has access only to set of Tcl commands defined as ``Safe Tcl''; see the +manual entry for the Tcl \fBinterp\fR command for details. If the creation of the new slave interpreter failed, \fBNULL\fR is returned. .PP -\fBTcl_IsSafe\fR returns \fB1\fR if \fIinterp\fR is -.QW safe -(was created with the \fBTCL_SAFE_INTERPRETER\fR flag specified), +\fBTcl_IsSafe\fR returns \fB1\fR if \fIinterp\fR is ``safe'' (was created +with the \fBTCL_SAFE_INTERPRETER\fR flag specified), \fB0\fR otherwise. .PP -\fBTcl_MakeSafe\fR marks \fIinterp\fR as -.QW safe , -so that future +\fBTcl_MakeSafe\fR marks \fIinterp\fR as ``safe'', so that future calls to \fBTcl_IsSafe\fR will return 1. It also removes all known potentially-unsafe core functionality (both commands and variables) from \fIinterp\fR. However, it cannot know what parts of an extension diff --git a/doc/DString.3 b/doc/DString.3 index 6b3c4c4..ec15bcc 100644 --- a/doc/DString.3 +++ b/doc/DString.3 @@ -5,7 +5,7 @@ '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. '\" -'\" RCS: @(#) $Id: DString.3,v 1.14 2007/10/24 14:29:37 dkf Exp $ +'\" RCS: @(#) $Id: DString.3,v 1.15 2007/10/26 20:11:51 dgp Exp $ '\" .so man.macros .TH Tcl_DString 3 7.4 Tcl "Tcl Library Procedures" @@ -93,10 +93,8 @@ before appending. \fBTcl_DStringAppendElement\fR adds a separator space before the new list element unless the new list element is the first in a list or sub-list (i.e. either the current string is empty, or it -contains the single character -.QW { , -or the last two characters of the current string are -.QW " {" ). +contains the single character ``{'', or the last two characters of +the current string are `` {''). \fBTcl_DStringAppendElement\fR returns a pointer to the characters of the new string. .PP diff --git a/doc/Encoding.3 b/doc/Encoding.3 index 85f7600..40fe886 100644 --- a/doc/Encoding.3 +++ b/doc/Encoding.3 @@ -4,7 +4,7 @@ '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. '\" -'\" RCS: @(#) $Id: Encoding.3,v 1.26 2007/10/24 14:29:37 dkf Exp $ +'\" RCS: @(#) $Id: Encoding.3,v 1.27 2007/10/26 20:11:51 dgp Exp $ '\" .so man.macros .TH Tcl_GetEncoding 3 "8.1" Tcl "Tcl Library Procedures" @@ -457,9 +457,8 @@ are obsolete interfaces best replaced with calls to \fBTcl_GetEncodingSearchPath\fR and \fBTcl_SetEncodingSearchPath\fR. They are called to access and set the first element of the \fIsearchPath\fR list. Since Tcl searches \fIsearchPath\fR for encoding data files in -list order, these routines establish the -.QW default -directory in which to find encoding data files. +list order, these routines establish the ``default'' directory in which +to find encoding data files. .VE 8.5 .SH "ENCODING FILES" Space would prohibit precompiling into Tcl every possible encoding @@ -472,9 +471,7 @@ external encoding may consist of single-byte, multi-byte, or double-byte characters. .PP Each dynamically-loadable encoding is represented as a text file. The -initial line of the file, beginning with a -.QW # -symbol, is a comment +initial line of the file, beginning with a ``#'' symbol, is a comment that provides a human-readable description of the file. The next line identifies the type of encoding file. It can be one of the following letters: @@ -587,11 +584,8 @@ the first character is converted, while \fBfinal\fR is a string to emit or expect after the last character. All other options are names of table-based encodings; the associated value is the escape-sequence that marks that encoding. Tcl syntax is used for the values; in the above -example, for instance, -.QW \fB{}\fR -represents the empty string and -.QW \fB\ex1b\fR -represents character 27. +example, for instance, ``\fB{}\fR'' represents the empty string and +``\fB\\x1b\fR'' represents character 27. .PP When \fBTcl_GetEncoding\fR encounters an encoding \fIname\fR that has not been loaded, it attempts to load an encoding file called \fIname\fB.enc\fR diff --git a/doc/Eval.3 b/doc/Eval.3 index 7b73c3b..f13fd2f 100644 --- a/doc/Eval.3 +++ b/doc/Eval.3 @@ -6,7 +6,7 @@ '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. '\" -'\" RCS: @(#) $Id: Eval.3,v 1.24 2007/10/24 14:29:37 dkf Exp $ +'\" RCS: @(#) $Id: Eval.3,v 1.25 2007/10/26 20:11:51 dgp Exp $ '\" .so man.macros .TH Tcl_Eval 3 8.1 Tcl "Tcl Library Procedures" @@ -101,14 +101,9 @@ its contents as a Tcl script. It returns the same information as If the file couldn't be read then a Tcl error is returned to describe why the file couldn't be read. The eofchar for files is '\\32' (^Z) for all platforms. -If you require a -.QW ^Z -in code for string comparison, you can use -.QW \e032 -or -.QW \eu001a , -which will be safely substituted by the Tcl interpreter into -.QW ^Z . +If you require a ``^Z'' in code for string comparison, you can use +``\\032'' or ``\\u001a'', which will be safely substituted by the Tcl +interpreter into ``^Z''. .PP \fBTcl_EvalObjv\fR executes a single pre-parsed command instead of a script. The \fIobjc\fR and \fIobjv\fR arguments contain the values diff --git a/doc/ExprLong.3 b/doc/ExprLong.3 index 6de4cc4..46a5783 100644 --- a/doc/ExprLong.3 +++ b/doc/ExprLong.3 @@ -5,7 +5,7 @@ '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. '\" -'\" RCS: @(#) $Id: ExprLong.3,v 1.12 2007/10/24 14:29:37 dkf Exp $ +'\" RCS: @(#) $Id: ExprLong.3,v 1.13 2007/10/26 20:11:51 dgp Exp $ '\" .so man.macros .TH Tcl_ExprLong 3 7.0 Tcl "Tcl Library Procedures" @@ -91,11 +91,8 @@ If the expression's actual value is an integer or floating-point number, then they store 0 at \fI*booleanPtr\fR if the value was zero and 1 otherwise. If the expression's actual value is a non-numeric string then -it must be one of the values accepted by \fBTcl_GetBoolean\fR such as -.QW yes -or -.QW no , -or else an error occurs. +it must be one of the values accepted by \fBTcl_GetBoolean\fR +such as ``yes'' or ``no'', or else an error occurs. .PP \fBTcl_ExprString\fR returns the value of the expression as a string stored in the interpreter's result. diff --git a/doc/ExprLongObj.3 b/doc/ExprLongObj.3 index bb72d38..d39ab65 100644 --- a/doc/ExprLongObj.3 +++ b/doc/ExprLongObj.3 @@ -4,7 +4,7 @@ '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. '\" -'\" RCS: @(#) $Id: ExprLongObj.3,v 1.6 2007/10/24 14:29:37 dkf Exp $ +'\" RCS: @(#) $Id: ExprLongObj.3,v 1.7 2007/10/26 20:11:51 dgp Exp $ '\" .so man.macros .TH Tcl_ExprLongObj 3 8.0 Tcl "Tcl Library Procedures" @@ -87,11 +87,8 @@ If the expression's actual value is an integer or floating-point number, then they store 0 at \fI*booleanPtr\fR if the value was zero and 1 otherwise. If the expression's actual value is a non-numeric string then -it must be one of the values accepted by \fBTcl_GetBoolean\fR such as -.QW yes -or -.QW no , -or else an error occurs. +it must be one of the values accepted by \fBTcl_GetBoolean\fR +such as ``yes'' or ``no'', or else an error occurs. .PP If \fBTcl_ExprObj\fR successfully evaluates the expression, it stores a pointer to the Tcl object diff --git a/doc/FileSystem.3 b/doc/FileSystem.3 index 25fb868..77345bd 100644 --- a/doc/FileSystem.3 +++ b/doc/FileSystem.3 @@ -4,7 +4,7 @@ '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. '\" -'\" RCS: @(#) $Id: FileSystem.3,v 1.58 2007/10/24 14:29:37 dkf Exp $ +'\" RCS: @(#) $Id: FileSystem.3,v 1.59 2007/10/26 20:11:51 dgp Exp $ '\" .so man.macros .TH Filesystem 3 8.4 Tcl "Tcl Library Procedures" @@ -352,14 +352,9 @@ reading the file contents. If the file couldn't be read then a Tcl error is returned to describe why the file couldn't be read. The eofchar for files is '\\32' (^Z) for all platforms. -If you require a -.QW ^Z -in code for string comparison, you can use -.QW \e032 -or -.QW \eu001a , -which will be safely substituted by the Tcl interpreter into -.QW ^Z . +If you require a ``^Z'' in code for string comparison, you can use +``\\032'' or ``\\u001a'', which will be safely substituted by the Tcl +interpreter into ``^Z''. \fBTcl_FSEvalFile\fR is a simpler version of \fBTcl_FSEvalFileEx\fR that always uses the system encoding when reading the file. @@ -850,10 +845,7 @@ representations. .PP The \fItypeName\fR field contains a null-terminated string that identifies the type of the filesystem implemented, e.g. -.QW native , -.QW zip -or -.QW vfs . +``native'' or ``zip'' or ```vfs''. .SS "STRUCTURE LENGTH" .PP The \fIstructureLength\fR field is generally implemented as diff --git a/doc/GetInt.3 b/doc/GetInt.3 index 6329b14..b1c658e 100644 --- a/doc/GetInt.3 +++ b/doc/GetInt.3 @@ -5,7 +5,7 @@ '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. '\" -'\" RCS: @(#) $Id: GetInt.3,v 1.11 2007/10/24 14:29:38 dkf Exp $ +'\" RCS: @(#) $Id: GetInt.3,v 1.12 2007/10/26 20:11:51 dgp Exp $ '\" .so man.macros .TH Tcl_GetInt 3 "" Tcl "Tcl Library Procedures" @@ -55,25 +55,20 @@ or *\fIdoublePtr\fR or *\fIboolPtr\fR. \fBTcl_GetInt\fR expects \fIsrc\fR to consist of a collection of integer digits, optionally signed and optionally preceded by white space. If the first two characters of \fIsrc\fR -after the optional white space and sign are -.QW 0x +after the optional white space and sign are ``0x'' then \fIsrc\fR is expected to be in hexadecimal form; otherwise, -if the first such character is -.QW 0 -then \fIsrc\fR +if the first such character is ``0'' then \fIsrc\fR is expected to be in octal form; otherwise, \fIsrc\fR is expected to be in decimal form. .PP \fBTcl_GetDouble\fR expects \fIsrc\fR to consist of a floating-point number, which is: white space; a sign; a sequence of digits; a -decimal point; a sequence of digits; the letter -.QW e ; -a signed decimal exponent ; and more white space. +decimal point; a sequence of digits; the letter ``e''; a +signed decimal exponent ; and more white space. Any of the fields may be omitted, except that the digits either before or after the decimal point must be present -and if the -.QW e -is present then it must be followed by the exponent number. +and if the ``e'' is present then it must be followed by the +exponent number. .PP \fBTcl_GetBoolean\fR expects \fIsrc\fR to specify a boolean value. If \fIsrc\fR is any of \fB0\fR, \fBfalse\fR, diff --git a/doc/Hash.3 b/doc/Hash.3 index 87c1464..ba1be49 100644 --- a/doc/Hash.3 +++ b/doc/Hash.3 @@ -5,7 +5,7 @@ '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. '\" -'\" RCS: @(#) $Id: Hash.3,v 1.22 2007/10/24 14:29:38 dkf Exp $ +'\" RCS: @(#) $Id: Hash.3,v 1.23 2007/10/26 20:11:51 dgp Exp $ '\" .so man.macros .TH Tcl_Hash 3 "" Tcl "Tcl Library Procedures" @@ -88,9 +88,7 @@ STRUCTURE\fR below). All of the keys in a given table have the same form, which is specified when the table is initialized. .PP The value of a hash table entry can be anything that fits in the same -space as a -.QW "char *" -pointer. Values for hash table entries are +space as a ``char *'' pointer. Values for hash table entries are managed entirely by clients, not by the hash module itself. Typically each entry's value is a pointer to a data structure managed by client code. @@ -126,9 +124,7 @@ They are passed to hashing routines using the address of the first character of the string. .IP \fBTCL_ONE_WORD_KEYS\fR 25 Keys are single-word values; they are passed to hashing routines -and stored in hash table entries as -.QW "char *" -values. +and stored in hash table entries as ``char *'' values. The pointer value is the key; it need not (and usually doesn't) actually point to a string. .IP \fBTCL_CUSTOM_TYPE_KEYS\fR 25 @@ -144,9 +140,8 @@ structure is described in the section .IP \fIother\fR 25 If \fIkeyType\fR is not one of the above, then it must be an integer value greater than 1. -In this case the keys will be arrays of -.QW int -values, where \fIkeyType\fR gives the number of ints in each key. +In this case the keys will be arrays of ``int'' values, where +\fIkeyType\fR gives the number of ints in each key. This allows structures to be used as keys. All keys must have the same size. Array keys are passed into hashing functions using the address @@ -187,28 +182,25 @@ instead, it returns NULL as result. .PP \fBTcl_GetHashValue\fR and \fBTcl_SetHashValue\fR are used to read and write an entry's value, respectively. -Values are stored and retrieved as type -.QW ClientData , -which is +Values are stored and retrieved as type ``ClientData'', which is large enough to hold a pointer value. On almost all machines this is large enough to hold an integer value too. .PP \fBTcl_GetHashKey\fR returns the key for a given hash table entry, -either as a pointer to a string, a one-word (e.g. -.QW "char *" ) -key, or as a pointer to the first word of an array of integers, depending +either as a pointer to a string, a one-word (``char *'') key, or +as a pointer to the first word of an array of integers, depending on the \fIkeyType\fR used to create a hash table. In all cases \fBTcl_GetHashKey\fR returns a result with type -.QW "char *" . +``char *''. When the key is a string or array, the result of \fBTcl_GetHashKey\fR points to information in the table entry; this information will remain valid until the entry is deleted or its table is deleted. .PP \fBTcl_FirstHashEntry\fR and \fBTcl_NextHashEntry\fR may be used -to scan all of the entries in a hash table. A structure of type -.QW Tcl_HashSearch , -provided by the client, is used to keep track of progress through the -table. \fBTcl_FirstHashEntry\fR initializes the search record and +to scan all of the entries in a hash table. +A structure of type ``Tcl_HashSearch'', provided by the client, +is used to keep track of progress through the table. +\fBTcl_FirstHashEntry\fR initializes the search record and returns the first entry in the table (or NULL if the table is empty). Each subsequent call to \fBTcl_NextHashEntry\fR returns the diff --git a/doc/LinkVar.3 b/doc/LinkVar.3 index a107fe6..a3a3b62 100644 --- a/doc/LinkVar.3 +++ b/doc/LinkVar.3 @@ -5,7 +5,7 @@ '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. '\" -'\" RCS: @(#) $Id: LinkVar.3,v 1.13 2007/10/24 14:29:38 dkf Exp $ +'\" RCS: @(#) $Id: LinkVar.3,v 1.14 2007/10/26 20:11:51 dgp Exp $ '\" .so man.macros .TH Tcl_LinkVar 3 7.5 Tcl "Tcl Library Procedures" @@ -166,10 +166,8 @@ rejected with Tcl errors. .TP \fBTCL_LINK_BOOLEAN\fR The C variable is of type \fBint\fR. -If its value is zero then it will read from Tcl as -.QW 0 ; -otherwise it will read from Tcl as -.QW 1 . +If its value is zero then it will read from Tcl as ``0''; +otherwise it will read from Tcl as ``1''. Whenever \fIvarName\fR is modified, the C variable will be set to a 0 or 1 value. Any value written into the Tcl variable must have a proper boolean @@ -185,8 +183,7 @@ Whenever the Tcl variable is modified the current C string will be freed and new memory will be allocated to hold a copy of the variable's new value. If the C variable contains a NULL pointer then the Tcl variable -will read as -.QW NULL . +will read as ``NULL''. .PP If the \fBTCL_LINK_READ_ONLY\fR flag is present in \fItype\fR then the variable will be read-only from Tcl, so that its value can only be diff --git a/doc/Notifier.3 b/doc/Notifier.3 index 60e8bb9..b1aec3f 100644 --- a/doc/Notifier.3 +++ b/doc/Notifier.3 @@ -5,7 +5,7 @@ '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. '\" -'\" RCS: @(#) $Id: Notifier.3,v 1.18 2007/10/24 14:29:38 dkf Exp $ +'\" RCS: @(#) $Id: Notifier.3,v 1.19 2007/10/26 20:11:51 dgp Exp $ '\" .so man.macros .TH Notifier 3 8.1 Tcl "Tcl Library Procedures" @@ -454,9 +454,7 @@ procedure when initializing a Tcl interpreter. Similarly, called by \fBTcl_Finalize\fR when shutting down a Tcl interpreter. .PP \fBTcl_WaitForEvent\fR is the lowest-level procedure in the notifier; -it is responsible for waiting for an -.QW interesting -event to occur or +it is responsible for waiting for an ``interesting'' event to occur or for a given time to elapse. Before \fBTcl_WaitForEvent\fR is invoked, each of the event sources' setup procedure will have been invoked. The \fItimePtr\fR argument to diff --git a/doc/PrintDbl.3 b/doc/PrintDbl.3 index a4c7dc1..d0614d9 100644 --- a/doc/PrintDbl.3 +++ b/doc/PrintDbl.3 @@ -5,7 +5,7 @@ '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. '\" -'\" RCS: @(#) $Id: PrintDbl.3,v 1.8 2007/10/24 14:29:38 dkf Exp $ +'\" RCS: @(#) $Id: PrintDbl.3,v 1.9 2007/10/26 20:11:52 dgp Exp $ '\" .so man.macros .TH Tcl_PrintDouble 3 8.0 Tcl "Tcl Library Procedures" @@ -36,13 +36,10 @@ least \fBTCL_DOUBLE_SPACE\fR characters of storage. \fBTcl_PrintDouble\fR generates a string that represents the value of \fIvalue\fR and stores it in memory at the location given by \fIdst\fR. It uses \fB%g\fR format to generate the string, with one -special twist: the string is guaranteed to contain either a -.QW . -or an -.QW e -so that it doesn't look like an integer. Where \fB%g\fR would generate -an integer with no decimal point, \fBTcl_PrintDouble\fR adds -.QW .0 . +special twist: the string is guaranteed to contain either +a ``.'' or an ``e'' so that it doesn't look like an integer. Where +\fB%g\fR would generate an integer with no decimal point, \fBTcl_PrintDouble\fR +adds ``.0''. .VS 8.5 .PP If the \fBtcl_precision\fR value is non-zero, the result will have diff --git a/doc/RegExp.3 b/doc/RegExp.3 index 54a5357..3270bcd 100644 --- a/doc/RegExp.3 +++ b/doc/RegExp.3 @@ -6,7 +6,7 @@ '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. '\" -'\" RCS: @(#) $Id: RegExp.3,v 1.24 2007/10/24 14:29:38 dkf Exp $ +'\" RCS: @(#) $Id: RegExp.3,v 1.25 2007/10/26 20:11:52 dgp Exp $ '\" .so man.macros .TH Tcl_RegExpMatch 3 8.1 Tcl "Tcl Library Procedures" @@ -186,23 +186,20 @@ zero or more of the following flags that control the compilation of .RS 2 .TP \fBTCL_REG_ADVANCED\fR -Compile advanced regular expressions -.PQ ARE s . -This mode corresponds to the normal regular expression syntax accepted by the -Tcl \fBregexp\fR and \fBregsub\fR commands. +Compile advanced regular expressions (`AREs'). This mode corresponds to +the normal regular expression syntax accepted by the Tcl \fBregexp\fR and +\fBregsub\fR commands. .TP \fBTCL_REG_EXTENDED\fR -Compile extended regular expressions -.PQ ERE s . -This mode corresponds to the regular expression syntax recognized by Tcl 8.0 -and earlier versions. +Compile extended regular expressions (`EREs'). This mode corresponds +to the regular expression syntax recognized by Tcl 8.0 and earlier +versions. .TP \fBTCL_REG_BASIC\fR -Compile basic regular expressions -.PQ BRE s . -This mode corresponds to the regular expression syntax recognized by common -Unix utilities like \fBsed\fR and \fBgrep\fR. This is the default if no flags -are specified. +Compile basic regular expressions (`BREs'). This mode corresponds +to the regular expression syntax recognized by common Unix utilities +like \fBsed\fR and \fBgrep\fR. This is the default if no flags are +specified. .TP \fBTCL_REG_EXPANDED\fR Compile the regular expression (basic, extended, or advanced) using an @@ -219,51 +216,27 @@ Compile for matching that ignores upper/lower case distinctions. \fBTCL_REG_NEWLINE\fR Compile for newline-sensitive matching. By default, newline is a completely ordinary character with no special meaning in either -regular expressions or strings. With this flag, -.QW [^ -bracket expressions and -.QW . -never match newline, -.QW ^ -matches an empty string -after any newline in addition to its normal function, and -.QW $ -matches an empty string before any newline in addition to its normal -function. \fBREG_NEWLINE\fR is the bit-wise OR of \fBREG_NLSTOP\fR and +regular expressions or strings. With this flag, `[^' bracket +expressions and `.' never match newline, `^' matches an empty string +after any newline in addition to its normal function, and `$' matches +an empty string before any newline in addition to its normal function. +\fBREG_NEWLINE\fR is the bit-wise OR of \fBREG_NLSTOP\fR and \fBREG_NLANCH\fR. .TP \fBTCL_REG_NLSTOP\fR -Compile for partial newline-sensitive matching, with the behavior of -.QW [^ -bracket expressions and -.QW . -affected, but not the behavior of -.QW ^ -and -.QW $ . -In this mode, -.QW [^ -bracket expressions and -.QW . -never match newline. +Compile for partial newline-sensitive matching, +with the behavior of +`[^' bracket expressions and `.' affected, +but not the behavior of `^' and `$'. In this mode, `[^' bracket +expressions and `.' never match newline. .TP \fBTCL_REG_NLANCH\fR -Compile for inverse partial newline-sensitive matching, with the behavior of -.QW ^ -and -.QW $ -(the -.QW anchors ) -affected, but not the behavior of -.QW [^ -bracket expressions and -.QW . . -In this mode -.QW ^ -matches an empty string after any newline in addition to its normal function, -and -.QW $ -matches an empty string before any newline in addition to its normal function. +Compile for inverse partial newline-sensitive matching, +with the behavior +of `^' and `$' (the ``anchors'') affected, but not the behavior of +`[^' bracket expressions and `.'. In this mode `^' matches an empty string +after any newline in addition to its normal function, and `$' matches +an empty string before any newline in addition to its normal function. .TP \fBTCL_REG_NOSUB\fR Compile for matching that reports only success or failure, @@ -302,19 +275,13 @@ zero or more of the following flags: .TP \fBTCL_REG_NOTBOL\fR The starting character will not be treated as the beginning of a -line or the beginning of the string, so -.QW ^ -will not match there. Note that this flag has no effect on how -.QW \fB\eA\fR -matches. +line or the beginning of the string, so `^' will not match there. +Note that this flag has no effect on how `\fB\eA\fR' matches. .TP \fBTCL_REG_NOTEOL\fR The last character in the string will not be treated as the end of a -line or the end of the string, so -.QW $ -will not match there. Note that this flag has no effect on how -.QW \fB\eZ\fR -matches. +line or the end of the string, so '$' will not match there. +Note that this flag has no effect on how `\fB\eZ\fR' matches. .RE .PP \fBTcl_RegExpGetInfo\fR retrieves information about the last match diff --git a/doc/SetResult.3 b/doc/SetResult.3 index fc306da..9dceecc 100644 --- a/doc/SetResult.3 +++ b/doc/SetResult.3 @@ -5,7 +5,7 @@ '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. '\" -'\" RCS: @(#) $Id: SetResult.3,v 1.15 2007/10/24 14:29:38 dkf Exp $ +'\" RCS: @(#) $Id: SetResult.3,v 1.16 2007/10/26 20:11:52 dgp Exp $ '\" .so man.macros .TH Tcl_SetResult 3 8.0 Tcl "Tcl Library Procedures" @@ -163,11 +163,8 @@ list element, so that the list elements in the result are properly separated. However if the new list element is the first in a list or sub-list (i.e. \fIinterp\fR's current result is empty, or consists of the -single character -.QW { , -or ends in the characters -.QW " {" ) -then no space is added. +single character ``{'', or ends in the characters `` {'') then no +space is added. .PP \fBTcl_FreeResult\fR performs part of the work of \fBTcl_ResetResult\fR. diff --git a/doc/SetVar.3 b/doc/SetVar.3 index 8985cce..025d810 100644 --- a/doc/SetVar.3 +++ b/doc/SetVar.3 @@ -5,7 +5,7 @@ '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. '\" -'\" RCS: @(#) $Id: SetVar.3,v 1.13 2007/10/24 14:29:38 dkf Exp $ +'\" RCS: @(#) $Id: SetVar.3,v 1.14 2007/10/26 20:11:52 dgp Exp $ '\" .so man.macros .TH Tcl_SetVar 3 8.1 Tcl "Tcl Library Procedures" @@ -207,10 +207,7 @@ Tcl list element before setting (or appending to) the variable. A separator space is appended before the new list element unless the list element is going to be the first element in a list or sublist (i.e. the variable's current value is empty, or contains -the single character -.QW { , -or ends in -.QW " }" ). +the single character ``{'', or ends in `` }''). When appending, the original value of the variable must also be a valid list, so that the operation is the appending of a new list element onto a list. diff --git a/doc/SplitList.3 b/doc/SplitList.3 index a8de7cc..798989a 100644 --- a/doc/SplitList.3 +++ b/doc/SplitList.3 @@ -5,7 +5,7 @@ '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. '\" -'\" RCS: @(#) $Id: SplitList.3,v 1.10 2007/10/24 14:29:38 dkf Exp $ +'\" RCS: @(#) $Id: SplitList.3,v 1.11 2007/10/26 20:11:52 dgp Exp $ '\" .so man.macros .TH Tcl_SplitList 3 8.0 Tcl "Tcl Library Procedures" @@ -169,9 +169,7 @@ the command not to be parsed correctly. .VS 8.5 By default, \fBTcl_ConvertElement\fR will use quoting in its output to be sure the first character of an element is not the hash -character (i.e. -.QW # ). -This is to be sure the first element of any list +character (``#''). This is to be sure the first element of any list passed to \fBeval\fR is not mis-parsed as the beginning of a comment. When a list element is not the first element of a list, this quoting is not necessary. When the caller can be sure that the element is diff --git a/doc/StdChannels.3 b/doc/StdChannels.3 index 482196b..5483ef1 100644 --- a/doc/StdChannels.3 +++ b/doc/StdChannels.3 @@ -4,7 +4,7 @@ '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. '\" -'\" RCS: @(#) $Id: StdChannels.3,v 1.11 2007/10/24 14:29:38 dkf Exp $ +'\" RCS: @(#) $Id: StdChannels.3,v 1.12 2007/10/26 20:11:52 dgp Exp $ '\" .so man.macros .TH "Standard Channels" 3 7.5 Tcl "Tcl Library Procedures" @@ -42,10 +42,9 @@ channel information, or when implicitly required during registration of a new channel. .PP These cases differ in how they handle unavailable platform- specific -standard channels. (A channel is not -.QW available -if it could not be successfully opened; for example, in a Tcl -application run as a Windows NT service.) +standard channels. (A channel is not ``available'' if it could not be +successfully opened; for example, in a Tcl application run as a +Windows NT service.) .TP 1) A single standard channel is initialized when it is explicitly diff --git a/doc/StrMatch.3 b/doc/StrMatch.3 index 27f581e..c9e7a16 100644 --- a/doc/StrMatch.3 +++ b/doc/StrMatch.3 @@ -5,7 +5,7 @@ '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. '\" -'\" RCS: @(#) $Id: StrMatch.3,v 1.10 2007/10/24 14:29:38 dkf Exp $ +'\" RCS: @(#) $Id: StrMatch.3,v 1.11 2007/10/26 20:11:52 dgp Exp $ '\" .so man.macros .TH Tcl_StringMatch 3 8.1 Tcl "Tcl Library Procedures" @@ -38,8 +38,7 @@ case-insensitive (1). This utility procedure determines whether a string matches a given pattern. If it does, then \fBTcl_StringMatch\fR returns 1. Otherwise \fBTcl_StringMatch\fR returns 0. The algorithm -used for matching is the same algorithm used in the -.QW "string match" +used for matching is the same algorithm used in the ``string match'' Tcl command and is similar to the algorithm used by the C-shell for file name matching; see the Tcl manual entry for details. .PP diff --git a/doc/SubstObj.3 b/doc/SubstObj.3 index 9b6a6eb..368519e 100644 --- a/doc/SubstObj.3 +++ b/doc/SubstObj.3 @@ -4,7 +4,7 @@ '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. '\" -'\" RCS: @(#) $Id: SubstObj.3,v 1.4 2007/10/24 14:29:38 dkf Exp $ +'\" RCS: @(#) $Id: SubstObj.3,v 1.5 2007/10/26 20:11:52 dgp Exp $ '\" .so man.macros .TH Tcl_SubstObj 3 8.4 Tcl "Tcl Library Procedures" @@ -55,12 +55,10 @@ replaced by the contents of the named variable. .PP When the \fBTCL_SUBST_COMMANDS\fR bit is set in \fIflags\fR, sequences that look like command substitutions for Tcl commands are replaced by -the result of evaluating that script. Where an uncaught -.QW "continue exception" -occurs during the evaluation of a command substitution, an -empty string is substituted for the command. Where an uncaught -.QW "break exception" -occurs during the evaluation of a command substitution, the +the result of evaluating that script. Where an uncaught `continue +exception' occurs during the evaluation of a command substitution, an +empty string is substituted for the command. Where an uncaught `break +exception' occurs during the evaluation of a command substitution, the result of the whole substitution on \fIobjPtr\fR will be truncated at the point immediately before the start of the command substitution, and no characters will be added to the result or substitutions diff --git a/doc/TCL_MEM_DEBUG.3 b/doc/TCL_MEM_DEBUG.3 index eddd082..a0b87c2 100644 --- a/doc/TCL_MEM_DEBUG.3 +++ b/doc/TCL_MEM_DEBUG.3 @@ -3,7 +3,7 @@ '\" Copyright (c) 2000 by Scriptics Corporation. '\" All rights reserved. '\" -'\" RCS: @(#) $Id: TCL_MEM_DEBUG.3,v 1.8 2007/10/24 14:29:38 dkf Exp $ +'\" RCS: @(#) $Id: TCL_MEM_DEBUG.3,v 1.9 2007/10/26 20:11:52 dgp Exp $ '\" .so man.macros .TH TCL_MEM_DEBUG 3 8.1 Tcl "Tcl Library Procedures" @@ -41,9 +41,8 @@ memory usage. .PP When memory debugging is enabled, whenever a call to \fBckalloc\fR is made, slightly more memory than requested is allocated so the memory debugging -code can keep track of the allocated memory, and eight-byte -.QW "guard zones" -are placed in front of and behind the space that will be +code can keep track of the allocated memory, and eight-byte ``guard +zones'' are placed in front of and behind the space that will be returned to the caller. (The sizes of the guard zones are defined by the C #define \fBLOW_GUARD_SIZE\fR and #define \fBHIGH_GUARD_SIZE\fR in the file \fIgeneric/tclCkalloc.c\fR -- it can @@ -52,12 +51,8 @@ performance.) A known pattern is written into the guard zones and, on a call to \fBckfree\fR, the guard zones of the space being freed are checked to see if either zone has been modified in any way. If one has been, the guard bytes and their new contents are identified, and a -.QW "low guard failed" -or -.QW "high guard failed" -message is issued. The -.QW "guard failed" -message includes the address of the memory packet and +``low guard failed'' or ``high guard failed'' message is issued. The +``guard failed'' message includes the address of the memory packet and the file name and line number of the code that called \fBckfree\fR. This allows you to detect the common sorts of one-off problems, where not enough space was allocated to contain the data written, for diff --git a/doc/Tcl.n b/doc/Tcl.n index e770b41..6f7d64f 100644 --- a/doc/Tcl.n +++ b/doc/Tcl.n @@ -5,7 +5,7 @@ '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. '\" -'\" RCS: @(#) $Id: Tcl.n,v 1.15 2007/10/24 14:29:38 dkf Exp $ +'\" RCS: @(#) $Id: Tcl.n,v 1.16 2007/10/26 20:11:52 dgp Exp $ '\" .so man.macros .TH Tcl n "8.5" Tcl "Tcl Built-In Commands" @@ -41,9 +41,8 @@ Different commands interpret their words differently. Words of a command are separated by white space (except for newlines, which are command separators). .IP "[4] \fBDouble quotes.\fR" -If the first character of a word is double-quote -.PQ \N'34' -then the word is terminated by the next double-quote character. +If the first character of a word is double-quote (``"'') then +the word is terminated by the next double-quote character. If semi-colons, close brackets, or white space characters (including newlines) appear between the quotes then they are treated as ordinary characters and included in the word. @@ -52,24 +51,18 @@ are performed on the characters between the quotes as described below. The double-quotes are not retained as part of the word. .VS 8.5 br .IP "[5] \fBArgument expansion.\fR" -If a word starts with the string -.QW {*} -followed by a non-whitespace character, then the leading -.QW {*} -is removed and the rest of the word is parsed and substituted as any -other word. After substitution, the word is parsed again without +If a word starts with the string ``{*}'' followed by a +non-whitespace character, then the leading ``{*}'' is removed +and the rest of the word is parsed and substituted as any other +word. After substitution, the word is parsed again without substitutions, and its words are added to the command being -substituted. For instance, -.QW "cmd a {*}{b c} d {*}{e f}" -is equivalent to -.QW "cmd a b c d e f" . +substituted. For instance, ``cmd a {*}{b c} d {*}{e f}'' is +equivalent to ``cmd a b c d e f''. .VE 8.5 .IP "[6] \fBBraces.\fR" -If the first character of a word is an open brace -.PQ { -and rule [5] does not apply, then -the word is terminated by the matching close brace -.PQ } "" . +If the first character of a word is an open brace (``{'') and +rule [5] does not apply, then +the word is terminated by the matching close brace (``}''). Braces nest within the word: for each additional open brace there must be an additional close brace (however, if an open brace or close brace within the word is @@ -82,23 +75,20 @@ or white space receive any special interpretation. The word will consist of exactly the characters between the outer braces, not including the braces themselves. .IP "[7] \fBCommand substitution.\fR" -If a word contains an open bracket -.PQ [ -then Tcl performs \fIcommand substitution\fR. +If a word contains an open bracket (``['') then Tcl performs +\fIcommand substitution\fR. To do this it invokes the Tcl interpreter recursively to process the characters following the open bracket as a Tcl script. The script may contain any number of commands and must be terminated -by a close bracket -.PQ ] "" . +by a close bracket (``]''). The result of the script (i.e. the result of its last command) is substituted into the word in place of the brackets and all of the characters between them. There may be any number of command substitutions in a single word. Command substitution is not performed on words enclosed in braces. .IP "[8] \fBVariable substitution.\fR" -If a word contains a dollar-sign -.PQ $ -followed by one of the forms described below, then Tcl performs \fIvariable +If a word contains a dollar-sign (``$'') followed by one of the forms +described below, then Tcl performs \fIvariable substitution\fR: the dollar-sign and the following characters are replaced in the word by the value of a variable. Variable substitution may take any of the following forms: @@ -125,9 +115,8 @@ There may be any number of variable substitutions in a single word. Variable substitution is not performed on words enclosed in braces. .RE .IP "[9] \fBBackslash substitution.\fR" -If a backslash -.PQ \e -appears within a word then \fIbackslash substitution\fR occurs. +If a backslash (``\e'') appears within a word then +\fIbackslash substitution\fR occurs. In all cases but those described below the backslash is dropped and the following character is treated as an ordinary character and included in the word. @@ -169,8 +158,7 @@ and the resulting space will be treated as a word separator if it isn't in braces or quotes. .TP 7 \e\e -Backslash -.PQ \e "" . +Backslash (``\e''). .TP 7 \e\fIooo\fR . @@ -196,9 +184,7 @@ Backslash substitution is not performed on words enclosed in braces, except for backslash-newline as described above. .RE .IP "[10] \fBComments.\fR" -If a hash character -.PQ # -appears at a point where Tcl is +If a hash character (``#'') appears at a point where Tcl is expecting the first character of the first word of a command, then the hash character and the characters that follow it, up through the next newline, are treated as a comment and ignored. diff --git a/doc/Tcl_Main.3 b/doc/Tcl_Main.3 index 35251a2..d9f0e98 100644 --- a/doc/Tcl_Main.3 +++ b/doc/Tcl_Main.3 @@ -6,7 +6,7 @@ '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. '\" -'\" RCS: @(#) $Id: Tcl_Main.3,v 1.12 2007/10/24 14:29:38 dkf Exp $ +'\" RCS: @(#) $Id: Tcl_Main.3,v 1.13 2007/10/26 20:11:52 dgp Exp $ '\" .so man.macros .TH Tcl_Main 3 8.4 Tcl "Tcl Library Procedures" @@ -36,9 +36,8 @@ Address of an application-specific event loop procedure. .SH DESCRIPTION .PP \fBTcl_Main\fR can serve as the main program for Tcl-based shell -applications. A -.QW "shell application" -is a program like tclsh or wish that supports both interactive interpretation +applications. A ``shell application'' is a program +like tclsh or wish that supports both interactive interpretation of Tcl and evaluation of a script contained in a file given as a command line argument. \fBTcl_Main\fR is offered as a convenience to developers of shell applications, so they do not have to @@ -92,9 +91,8 @@ the Tcl variables \fIargc\fR, \fIargv\fR, \fIargv0\fR, and .PP When it has finished its own initialization, but before it processes commands, \fBTcl_Main\fR calls the procedure given by the -\fIappInitProc\fR argument. This procedure provides a -.QW hook -for the application to perform its own initialization of the interpreter +\fIappInitProc\fR argument. This procedure provides a ``hook'' for +the application to perform its own initialization of the interpreter created by \fBTcl_Main\fR, such as defining application-specific commands. The procedure must have an interface that matches the type \fBTcl_AppInitProc\fR: diff --git a/doc/TraceVar.3 b/doc/TraceVar.3 index 2567c3a..1e56ef4 100644 --- a/doc/TraceVar.3 +++ b/doc/TraceVar.3 @@ -5,7 +5,7 @@ '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. '\" -'\" RCS: @(#) $Id: TraceVar.3,v 1.16 2007/10/24 14:29:38 dkf Exp $ +'\" RCS: @(#) $Id: TraceVar.3,v 1.17 2007/10/26 20:11:52 dgp Exp $ '\" .so man.macros .TH Tcl_TraceVar 3 7.4 Tcl "Tcl Library Procedures" @@ -353,9 +353,8 @@ It is legal to set a trace on an undefined variable. The variable will still appear to be undefined until the first time its value is set. If an undefined variable is traced and then unset, the unset will fail -with an error, -.QW "no such variable" , -but the trace procedure will still be invoked. +with an error (``no such variable''), but the trace +procedure will still be invoked. .SH "TCL_TRACE_DESTROYED FLAG" .PP diff --git a/doc/Translate.3 b/doc/Translate.3 index 12cccde..9620c12 100644 --- a/doc/Translate.3 +++ b/doc/Translate.3 @@ -5,7 +5,7 @@ '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. '\" -'\" RCS: @(#) $Id: Translate.3,v 1.10 2007/10/24 14:29:38 dkf Exp $ +'\" RCS: @(#) $Id: Translate.3,v 1.11 2007/10/26 20:11:52 dgp Exp $ '\" .so man.macros .TH Tcl_TranslateFileName 3 8.1 Tcl "Tcl Library Procedures" @@ -23,8 +23,7 @@ char * .AP Tcl_Interp *interp in Interpreter in which to report an error, if any. .AP "const char" *name in -File name, which may start with a -.QW ~ . +File name, which may start with a ``~''. .AP Tcl_DString *bufferPtr in/out If needed, this dynamic string is used to store the new file name. At the time of the call it should be uninitialized or free. The diff --git a/doc/WrongNumArgs.3 b/doc/WrongNumArgs.3 index afee7b3..d2febb4 100644 --- a/doc/WrongNumArgs.3 +++ b/doc/WrongNumArgs.3 @@ -4,7 +4,7 @@ '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. '\" -'\" RCS: @(#) $Id: WrongNumArgs.3,v 1.9 2007/10/24 14:29:38 dkf Exp $ +'\" RCS: @(#) $Id: WrongNumArgs.3,v 1.10 2007/10/26 20:11:52 dgp Exp $ '\" .so man.macros .TH Tcl_WrongNumArgs 3 8.0 Tcl "Tcl Library Procedures" @@ -41,8 +41,7 @@ standard error message and stores it in the result object of \fIinterp\fR. The message includes the \fIobjc\fR initial elements of \fIobjv\fR plus \fImessage\fR. For example, if \fIobjv\fR consists of the values \fBfoo\fR and \fBbar\fR, -\fIobjc\fR is 1, and \fImessage\fR is -.QW "\fBfileName count\fR" +\fIobjc\fR is 1, and \fImessage\fR is ``\fBfileName count\fR'' then \fIinterp\fR's result object will be set to the following string: .CS diff --git a/doc/after.n b/doc/after.n index 740a09f..d3d906e 100644 --- a/doc/after.n +++ b/doc/after.n @@ -5,7 +5,7 @@ '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. '\" -'\" RCS: @(#) $Id: after.n,v 1.8 2007/10/24 14:29:38 dkf Exp $ +'\" RCS: @(#) $Id: after.n,v 1.9 2007/10/26 20:11:52 dgp Exp $ '\" .so man.macros .TH after n 7.5 Tcl "Tcl Built-In Commands" @@ -136,7 +136,9 @@ proc doOneStep {} { } doOneStep .CE + .SH "SEE ALSO" concat(n), interp(n), update(n), vwait(n) + .SH KEYWORDS cancel, delay, idle callback, sleep, time diff --git a/doc/append.n b/doc/append.n index 83f0735..71a1bc5 100644 --- a/doc/append.n +++ b/doc/append.n @@ -5,7 +5,7 @@ '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. '\" -'\" RCS: @(#) $Id: append.n,v 1.7 2007/10/24 14:29:38 dkf Exp $ +'\" RCS: @(#) $Id: append.n,v 1.8 2007/10/26 20:11:52 dgp Exp $ '\" .so man.macros .TH append n "" Tcl "Tcl Built-In Commands" @@ -27,11 +27,8 @@ The result of this command is the new value stored in variable \fIvarName\fR. This command provides an efficient way to build up long variables incrementally. -For example, -.QW "\fBappend a $b\fR" -is much more efficient than -.QW "\fBset a $a$b\fR" , -especially when \fB$a\fR is long. +For example, ``\fBappend a $b\fR'' is much more efficient than +``\fBset a $a$b\fR'' if \fB$a\fR is long. .SH EXAMPLE Building a string of comma-separated numbers piecemeal using a loop. .CS @@ -42,7 +39,9 @@ for {set i 1} {$i<=10} {incr i} { puts $var # Prints 0,1,2,3,4,5,6,7,8,9,10 .CE + .SH "SEE ALSO" concat(n), lappend(n) + .SH KEYWORDS append, variable diff --git a/doc/apply.n b/doc/apply.n index 8b5b3ee..1e69e69 100644 --- a/doc/apply.n +++ b/doc/apply.n @@ -41,8 +41,7 @@ The invocation of \fBapply\fR adds a call frame to Tcl's evaluation stack proceeds in this call frame, in the namespace given by \fInamespace\fR or in the global namespace if none was specified. If given, \fInamespace\fR is interpreted relative to the global namespace even if its name does not start -with -.QW :: . +with '::'. .PP The semantics of \fBapply\fR can also be described by: .PP @@ -66,7 +65,6 @@ proc apply {fun args} { This shows how to make a simple general command that applies a transformation to each element of a list. .CS -.ta 2i proc map {lambda list} { set result {} foreach $item $list { @@ -75,24 +73,21 @@ proc map {lambda list} { return $result } map {x {return [string length $x]:$x}} {a bb ccc dddd} - \fB\(->\fI 1:a 2:bb 3:ccc 4:dddd\fR + \fI=> 1:a 2:bb 3:ccc 4:dddd\fR map {x {expr {$x**2 + 3*$x - 2}}} {-4 -3 -2 -1 0 1 2 3 4} - \fB\(->\fI 2 -2 -4 -4 -2 2 8 16 26\fR + \fI=> 2 -2 -4 -4 -2 2 8 16 26\fR .CE .PP The \fBapply\fR command is also useful for defining callbacks for use in the \fBtrace\fR command: .CS -.ta 2i set vbl "123abc" trace add variable vbl write {\fBapply\fR {v1 v2 op} { upvar 1 $v1 v - puts "updated variable to \e"$v\e"" + puts "updated variable to \\"$v\\"" }} set vbl 123 - \fB\(->\fI updated variable to "123"\fR set vbl abc - \fB\(->\fI updated variable to "abc"\fR .CE .SH "SEE ALSO" proc(n), uplevel(n) diff --git a/doc/array.n b/doc/array.n index 8c930ba..73e6ad2 100644 --- a/doc/array.n +++ b/doc/array.n @@ -5,7 +5,7 @@ '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. '\" -'\" RCS: @(#) $Id: array.n,v 1.17 2007/10/25 09:25:27 dkf Exp $ +'\" RCS: @(#) $Id: array.n,v 1.18 2007/10/26 20:11:52 dgp Exp $ '\" .so man.macros .TH array n 8.3 Tcl "Tcl Built-In Commands" @@ -148,7 +148,7 @@ The command always returns an empty string. foreach {color count} [\fBarray get\fR colorcount] { puts "Color: $color Count: $count" } - \(-> Color: blue Count: 4 + => Color: blue Count: 4 Color: white Count: 9 Color: green Count: 5 Color: red Count: 1 @@ -156,7 +156,7 @@ foreach {color count} [\fBarray get\fR colorcount] { foreach color [\fBarray names\fR colorcount] { puts "Color: $color Count: $colorcount($color)" } - \(-> Color: blue Count: 4 + => Color: blue Count: 4 Color: white Count: 9 Color: green Count: 5 Color: red Count: 1 @@ -164,13 +164,13 @@ foreach color [\fBarray names\fR colorcount] { foreach color [lsort [\fBarray names\fR colorcount]] { puts "Color: $color Count: $colorcount($color)" } - \(-> Color: blue Count: 4 + => Color: blue Count: 4 Color: green Count: 5 Color: red Count: 1 Color: white Count: 9 \fBarray statistics\fR colorcount - \(-> 4 entries in table, 4 buckets + => 4 entries in table, 4 buckets number of buckets with 0 entries: 1 number of buckets with 1 entries: 2 number of buckets with 2 entries: 1 @@ -184,7 +184,9 @@ foreach color [lsort [\fBarray names\fR colorcount]] { number of buckets with 10 or more entries: 0 average search distance for entry: 1.2 .CE + .SH "SEE ALSO" list(n), string(n), variable(n), trace(n), foreach(n) + .SH KEYWORDS array, element names, search diff --git a/doc/bgerror.n b/doc/bgerror.n index e64106a..c8887d5 100644 --- a/doc/bgerror.n +++ b/doc/bgerror.n @@ -5,7 +5,7 @@ '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. '\" -'\" RCS: @(#) $Id: bgerror.n,v 1.10 2007/10/24 14:29:38 dkf Exp $ +'\" RCS: @(#) $Id: bgerror.n,v 1.11 2007/10/26 20:11:52 dgp Exp $ '\" .so man.macros .TH bgerror n 7.5 Tcl "Tcl Built-In Commands" @@ -86,7 +86,9 @@ proc bgerror {message} { close $fl } .CE + .SH "SEE ALSO" after(n), interp(n), tclvars(n) + .SH KEYWORDS background error, reporting diff --git a/doc/binary.n b/doc/binary.n index e98917b..5f79036 100644 --- a/doc/binary.n +++ b/doc/binary.n @@ -4,7 +4,7 @@ '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. '\" -'\" RCS: @(#) $Id: binary.n,v 1.31 2007/10/25 14:07:32 dkf Exp $ +'\" RCS: @(#) $Id: binary.n,v 1.32 2007/10/26 20:11:52 dgp Exp $ '\" .so man.macros .TH binary n 8.0 Tcl "Tcl Built-In Commands" @@ -129,9 +129,8 @@ will return a string equivalent to \fB\\xe0\\xe1\\xa0\fR. .IP \fBh\fR 5 Stores a string of \fIcount\fR hexadecimal digits in low-to-high within each byte in the output string. \fIArg\fR must contain a -sequence of characters in the set -.QW 0123456789abcdefABCDEF . -The resulting bytes are emitted in first to last order with the hex digits +sequence of characters in the set ``0123456789abcdefABCDEF''. The +resulting bytes are emitted in first to last order with the hex digits being formatted in low-to-high order within each byte. If \fIarg\fR has fewer than \fIcount\fR digits, then zeros will be used for the remaining digits. If \fIarg\fR has more than the specified number of @@ -396,8 +395,7 @@ position to satisfy the current field specifier, then the corresponding variable is left untouched and \fBbinary scan\fR returns immediately with the number of variables that were set. If there are not enough arguments for all of the fields in the format string that -consume arguments, then an error is generated. The flag character -.QW u +consume arguments, then an error is generated. The flag character 'u' may be given to cause some types to be read as unsigned values. The flag is accepted for all field types but is ignored for non-integer fields. .PP @@ -436,10 +434,8 @@ will be sign extended. Thus the following will occur: set signShort [\fBbinary format\fR s1 0x8000] \fBbinary scan\fR $signShort s1 val; \fI# val == 0xFFFF8000\fR .CE -If you require unsigned values you can include the -.QW u -flag character following the field type. For example, to read an -unsigned short value: +If you require unsigned values you can include the 'u' flag character following +the field type. For example, to read an unsigned short value: .CS set signShort [\fBbinary format\fR s1 0x8000] \fBbinary scan\fR $signShort su1 val; \fI# val == 0x00008000\fR @@ -476,10 +472,7 @@ will return \fB1\fR with \fBabc efghi\fR stored in \fIvar1\fR. .RE .IP \fBb\fR 5 The data is turned into a string of \fIcount\fR binary digits in -low-to-high order represented as a sequence of -.QW 1 -and -.QW 0 +low-to-high order represented as a sequence of ``1'' and ``0'' characters. The data bytes are scanned in first to last order with the bits being taken in low-to-high order within each byte. Any extra bits in the last byte are ignored. If \fIcount\fR is \fB*\fR, then @@ -505,8 +498,7 @@ will return \fB2\fR with \fB01110\fR stored in \fIvar1\fR and .IP \fBH\fR 5 The data is turned into a string of \fIcount\fR hexadecimal digits in high-to-low order represented as a sequence of characters in the set -.QW 0123456789abcdef . -The data bytes are scanned in first to last +``0123456789abcdef''. The data bytes are scanned in first to last order with the hex digits being taken in high-to-low order within each byte. Any extra bits in the last byte are ignored. If \fIcount\fR is \fB*\fR, then all of the remaining hex digits in \fIstring\fR will be @@ -791,7 +783,9 @@ proc \fIreadString\fR {channel} { return [encoding convertfrom utf-8 $data] } .CE + .SH "SEE ALSO" format(n), scan(n), tclvars(n) + .SH KEYWORDS binary, format, scan diff --git a/doc/break.n b/doc/break.n index 83e68ac..1985f78 100644 --- a/doc/break.n +++ b/doc/break.n @@ -5,7 +5,7 @@ '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. '\" -'\" RCS: @(#) $Id: break.n,v 1.8 2007/10/24 14:29:38 dkf Exp $ +'\" RCS: @(#) $Id: break.n,v 1.9 2007/10/26 20:11:52 dgp Exp $ '\" .so man.macros .TH break n "" Tcl "Tcl Built-In Commands" @@ -39,7 +39,9 @@ for {set x 0} {$x<10} {incr x} { puts "x is $x" } .CE + .SH "SEE ALSO" catch(n), continue(n), for(n), foreach(n), return(n), while(n) + .SH KEYWORDS abort, break, loop diff --git a/doc/catch.n b/doc/catch.n index de7207f..ffdbc8b 100644 --- a/doc/catch.n +++ b/doc/catch.n @@ -6,7 +6,7 @@ '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. '\" -'\" RCS: @(#) $Id: catch.n,v 1.14 2007/10/24 14:29:38 dkf Exp $ +'\" RCS: @(#) $Id: catch.n,v 1.15 2007/10/26 20:11:52 dgp Exp $ '\" .so man.macros .TH catch n "8.5" Tcl "Tcl Built-In Commands" @@ -90,7 +90,9 @@ if { [\fBcatch\fR {open $someFile w} fid] } { .PP There are more complex examples of \fBcatch\fR usage in the documentation for the \fBreturn\fR command. + .SH "SEE ALSO" break(n), continue(n), dict(n), error(n), return(n), tclvars(n) + .SH KEYWORDS catch, error diff --git a/doc/cd.n b/doc/cd.n index ded1b0b..2634692 100644 --- a/doc/cd.n +++ b/doc/cd.n @@ -5,7 +5,7 @@ '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. '\" -'\" RCS: @(#) $Id: cd.n,v 1.7 2007/10/24 14:29:38 dkf Exp $ +'\" RCS: @(#) $Id: cd.n,v 1.8 2007/10/26 20:11:52 dgp Exp $ '\" .so man.macros .TH cd n "" Tcl "Tcl Built-In Commands" @@ -37,7 +37,9 @@ current one: .CS \fBcd\fR ../lib .CE + .SH "SEE ALSO" filename(n), glob(n), pwd(n) + .SH KEYWORDS working directory diff --git a/doc/chan.n b/doc/chan.n index 49522d6..f2b6fe7 100644 --- a/doc/chan.n +++ b/doc/chan.n @@ -4,7 +4,7 @@ '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. '\" -'\" RCS: @(#) $Id: chan.n,v 1.12 2007/10/25 14:07:32 dkf Exp $ +'\" RCS: @(#) $Id: chan.n,v 1.13 2007/10/26 20:11:52 dgp Exp $ .so man.macros .TH chan n 8.5 Tcl "Tcl Built-In Commands" .BS @@ -293,9 +293,7 @@ Note that \fIinputChan\fR can become readable during a background copy. You should turn off any \fBchan event\fR or \fBfileevent\fR handlers during a background copy so those handlers do not interfere with the copy. Any I/O attempted by a \fBchan event\fR or -\fBfileevent\fR handler will get a -.QW "channel busy" -error. +\fBfileevent\fR handler will get a "channel busy" error. .PP \fBChan copy\fR translates end-of-line sequences in \fIinputChan\fR and \fIoutputChan\fR according to the \fB\-translation\fR option for @@ -335,11 +333,7 @@ the channel. .PP The argument \fImode\fR specifies if the new channel is opened for reading, writing, or both. It has to be a list containing any of the -strings -.QW "\fBread\fR" -or -.QW "\fBwrite\fR" . -The list must have at least one +strings "\fBread\fR" or "\fBwrite\fR". The list must have at least one element, as a channel you can neither write to nor read from makes no sense. The handler command for the new channel must support the chosen mode, or an error is thrown. @@ -417,9 +411,7 @@ while waiting for the data to arrive. If an application invokes \fBchan gets\fR or \fBchan read\fR on a blocking channel when there is no input data available, the process will block; until the input data arrives, it will not be able to service other events, so it will -appear to the user to -.QW "freeze up" . -With \fBchan event\fR, the +appear to the user to ``freeze up''. With \fBchan event\fR, the process can tell when data is present and only invoke \fBchan gets\fR or \fBchan read\fR when they won't block. .PP @@ -504,11 +496,7 @@ only those channel names that match it (according to the rules of .TP \fBchan pending \fImode channelId\fR . -Depending on whether \fImode\fR is -.QW "input" -or -.QW "output" , -returns the number of +Depending on whether \fImode\fR is "input" or "output", returns the number of bytes of input or output (respectively) currently buffered internally for \fIchannelId\fR (especially useful in a readable event callback to impose application-specific limits on input line lengths to avoid @@ -522,10 +510,7 @@ This subcommand is used by command handlers specified with \fBchan create\fR. It notifies the channel represented by the handle \fIchannelId\fR that the event(s) listed in the \fIeventSpec\fR have occurred. The argument has to be a list containing any of the strings -.QW "\fBread\fR" -and -.QW "\fBwrite\fR" . -The list must contain at least one +"\fBread\fR" and "\fBwrite\fR". The list must contain at least one element as it does not make sense to invoke the command if there are no events to post. .RS diff --git a/doc/clock.n b/doc/clock.n index 46a3528..0f85a7d 100644 --- a/doc/clock.n +++ b/doc/clock.n @@ -10,17 +10,17 @@ clock \- Obtain and manipulate dates and times .SH "SYNOPSIS" package require \fBTcl 8.5\fR .sp -\fBclock add\fR \fItimeVal\fR ?\fIcount unit...\fR? ?\fI\-option value\fR? +\fBclock add\fR \fItimeVal\fR ?\fIcount unit...\fR? ?\fI-option value\fR? .sp -\fBclock clicks\fR ?\fI\-option\fR? +\fBclock clicks\fR ?\fI-option\fR? .sp -\fBclock format\fR \fItimeVal\fR ?\fI\-option value\fR...? +\fBclock format\fR \fItimeVal\fR ?\fI-option value\fR...? .sp \fBclock microseconds\fR .sp \fBclock milliseconds\fR .sp -\fBclock scan\fR \fIinputString\fR ?\fI\-option value\fR...? +\fBclock scan\fR \fIinputString\fR ?\fI-option value\fR...? .sp \fBclock seconds\fR .sp @@ -31,27 +31,27 @@ The \fBclock\fR command performs several operations that obtain and manipulate values that represent times. The command supports several subcommands that determine what action is carried out by the command. .TP -\fBclock add\fR \fItimeVal\fR ?\fIcount unit...\fR? ?\fI\-option value\fR? +\fBclock add\fR \fItimeVal\fR ?\fIcount unit...\fR? ?\fI-option value\fR? Adds a (possibly negative) offset to a time that is expressed as an integer number of seconds. See \fBCLOCK ARITHMETIC\fR for a full description. .TP -\fBclock clicks\fR ?\fI\-option\fR? -If no \fI\-option\fR argument is supplied, returns a high-resolution +\fBclock clicks\fR ?\fI-option\fR? +If no \fI-option\fR argument is supplied, returns a high-resolution time value as a system-dependent integer value. The unit of the value is system-dependent but should be the highest resolution clock available on the system such as a CPU cycle counter. See \fBHIGH RESOLUTION TIMERS\fR for a full description. .sp -If the \fI\-option\fR argument is \fI\-milliseconds\fR, then the command +If the \fI-option\fR argument is \fI-milliseconds\fR, then the command is synonymous with \fBclock milliseconds\fR (see below). This usage is obsolete, and \fBclock milliseconds\fR is to be considered the preferred way of obtaining a count of milliseconds. .sp -If the \fI\-option\fR argument is \fI\-microseconds\fR, then the command +If the \fI-option\fR argument is \fI-microseconds\fR, then the command is synonymous with \fBclock microseconds\fR (see below). This usage is obsolete, and \fBclock microseconds\fR is to be considered the preferred way of obtaining a count of microseconds. .TP -\fBclock format\fR \fItimeVal\fR ?\fI\-option value\fR...? +\fBclock format\fR \fItimeVal\fR ?\fI-option value\fR...? Formats a time that is expressed as an integer number of seconds into a format intended for consumption by users or external programs. See \fBFORMATTING TIMES\fR for a full description. @@ -62,7 +62,7 @@ Returns the current time as an integer number of microseconds. See \fBHIGH RESO \fBclock milliseconds\fR Returns the current time as an integer number of milliseconds. See \fBHIGH RESOLUTION TIMERS\fR for a full description. .TP -\fBclock scan\fR \fIinputString\fR ?\fI\-option value\fR...? +\fBclock scan\fR \fIinputString\fR ?\fI-option value\fR...? Scans a time that is expressed as a character string and produces an integer number of seconds. See \fBSCANNING TIMES\fR for a full description. @@ -93,16 +93,15 @@ to identify an interval of time, for example, \fI3 seconds\fR or \fI1 year\fR. .SS "OPTIONS" .TP -\fB\-base\fR time +\fB-base\fR time Specifies that any relative times present in a \fBclock scan\fR command are to be given relative to \fItime\fR. \fItime\fR must be expressed as a count of nominal seconds from the epoch time of 1 January 1970, 00:00 UTC. .TP -\fB\-format\fR format +\fB-format\fR format Specifies the desired output format for \fBclock format\fR or the expected input format for \fBclock scan\fR. The \fIformat\fR string consists -of any number of characters other than the per-cent sign -.PQ \fI%\fR +of any number of characters other than the per-cent sign ('\fI%\fR') interspersed with any number of \fIformat groups\fR, which are two-character sequences beginning with the per-cent sign. The permissible format groups, and their interpretation, are described under \fBFORMAT GROUPS\fR. @@ -113,21 +112,20 @@ On \fBclock format\fR, the default format is %a %b %d %H:%M:%S %z %Y .CE .PP -On \fBclock scan\fR, the lack of a \fI\-format\fR option indicates that a -.QW "free format scan" -is requested; see \fBFREE FORM SCAN\fR for a description of what happens. +On \fBclock scan\fR, the lack of a \fI-format\fR option indicates that +a "free format scan" is requested; see \fBFREE FORM SCAN\fR for a +description of what happens. .RE .TP -\fB\-gmt\fR boolean +\fB-gmt\fR boolean If \fIboolean\fR is true, specifies that a time specified to \fBclock add\fR, \fBclock format\fR or \fBclock scan\fR should be processed in UTC. If \fIboolean\fR is false, the processing defaults to the local time zone. This usage is obsolete; the correct current usage is to -specify the UTC time zone with -.QW "\fB\-timezone\fR \fI:UTC\fR" -or any of the equivalent ways to specify it. +specify the UTC time zone with '\fB-timezone\fR \fI:UTC\fR' or any of +the equivalent ways to specify it. .TP -\fB\-locale\fR localeName +\fB-locale\fR localeName Specifies that locale-dependent scanning and formatting (and date arithmetic for dates preceding the adoption of the Gregorian calendar) is to be done in the locale identified by \fIlocaleName\fR. The locale name may be any of @@ -140,12 +138,12 @@ descriptions of the individual format groups under \fBFORMAT GROUPS\fR. The effect of locale on clock arithmetic is discussed under \fBCLOCK ARITHMETIC\fR. .TP -\fB\-timezone\fR zoneName +\fB-timezone\fR zoneName Specifies that clock arithmetic, formatting, and scanning are to be done according to the rules for the time zone specified by \fIzoneName\fR. The permissible values, and their interpretation, are discussed under \fBTIME ZONES\fR. -On subcommands that expect a \fB\-timezone\fR argument, the default +On subcommands that expect a \fB-timezone\fR argument, the default is to use the \fIcurrent time zone\fR. The current time zone is determined, in order of preference, by: .RS @@ -165,7 +163,7 @@ years 1902 to 2037) that can be represented in a 32-bit integer. The \fBclock add\fR command performs clock arithmetic on a value (expressed as nominal seconds from the epoch time of 1 January 1970, 00:00 UTC) given as its first argument. The remaining arguments (other than the -possible \fB\-timezone\fR, \fB\-locale\fR and \fB\-gmt\fR options) +possible \fB-timezone\fR, \fB-locale\fR and \fB-gmt\fR options) are integers and keywords in alternation, where the keywords are chosen from \fBseconds\fR, \fBminutes\fR, \fBhours\fR, \fBdays\fR, \fBweeks\fR, \fBmonths\fR, or \fByears\fR, or @@ -286,84 +284,70 @@ expressed in seconds from the epoch time of 1 January 1970, 00:00 UTC, as returned by \fBclock seconds\fR, \fBclock scan\fR, \fBclock add\fR, \fBfile atime\fR or \fBfile mtime\fR. .PP -If a \fB\-format\fR option is present, the following argument is +If a \fB-format\fR option is present, the following argument is a string that specifies how the date and time are to be formatted. The string consists -of any number of characters other than the per-cent sign -.PQ \fI%\fR +of any number of characters other than the per-cent sign ('\fI%\fR') interspersed with any number of \fIformat groups\fR, which are two-character sequences beginning with the per-cent sign. The permissible format groups, and their interpretation, are described under \fBFORMAT GROUPS\fR. .PP -If a \fB\-timezone\fR option is present, the following +If a \fB-timezone\fR option is present, the following argument is a string that specifies the time zone in which the date and time -are to be formatted. As an alternative to -.QW "\fB\-timezone\fR \fI:UTC\fR" , -the obsolete usage -.QW "\fB\-gmt\fR \fItrue\fR" -may be used. See \fBTIME ZONES\fR for the permissible variants for the time -zone. -.PP -If a \fB\-locale\fR option is present, the following argument is +are to be formatted. As an alternative to \fB-timezone\fR \fI:UTC\fR, +the obsolete usage \fB-gmt\fR \fItrue\fR may be used. See +\fBTIME ZONES\fR for the permissible variants for the time zone. +.PP +If a \fB-locale\fR option is present, the following argument is a string that specifies the locale in which the time is to be formatted, in the same format that is used for the \fBmsgcat\fR package. Note -that the default, if \fB\-locale\fR is not specified, is the root locale +that the default, if \fB-locale\fR is not specified, is the root locale \fB{}\fR rather than the current locale. The current locale may -be obtained by using -.QW "\fB\-locale\fR \fBcurrent\fR" . +be obtained by using \fB-locale\fR \fBcurrent\fR. In addition, some platforms support a \fBsystem\fR locale that reflects the user's current choices. For instance, on Windows, the format that the user has selected from dates and times in the Control Panel can be obtained by using the \fBsystem\fR locale. On platforms that do not define a user selection of date and time formats -separate from \fBLC_TIME\fR, -.QW "\fB\-locale\fR \fBsystem\fR" -is synonymous with -.QW "\fB\-locale\fR \fBcurrent\fR" . +separate from \fBLC_TIME\fR, \fB-locale\fR \fBsystem\fR is +synonymous with \fB-locale\fR \fBcurrent\fR. .SH "SCANNING TIMES" The \fBclock scan\fR command accepts times that are formatted as strings and converts them to counts of seconds from the epoch time -of 1 January 1970, 00:00 UTC. It normally takes a \fB\-format\fR +of 1 January 1970, 00:00 UTC. It normally takes a \fB-format\fR option that is followed by a string describing the expected format of the input. (See \fBFREE FORM SCAN\fR for the effect of \fBclock scan\fR without such an argument.) The string consists of any number of -characters other than the per-cent sign -.PQ \fI%\fR "" , +characters other than the per-cent sign ('\fI%\fR'), interspersed with any number of \fIformat groups\fR, which are two-character sequences beginning with the per-cent sign. The permissible format groups, and their interpretation, are described under \fBFORMAT GROUPS\fR. .PP -If a \fB\-timezone\fR option is present, the following +If a \fB-timezone\fR option is present, the following argument is a string that specifies the time zone in which the date and time -are to be interpreted. As an alternative to -.QW "\fB\-timezone\fR \fI:UTC\fR" , -the obsolete usage -.QW "\fB\-gmt\fR \fItrue\fR" -may be used. See \fBTIME ZONES\fR for the permissible variants for the time -zone. -.PP -If a \fB\-locale\fR option is present, the following argument is +are to be interpreted. As an alternative to \fB-timezone\fR \fI:UTC\fR, +the obsolete usage \fB-gmt\fR \fItrue\fR may be used. See +\fBTIME ZONES\fR for the permissible variants for the time zone. +.PP +If a \fB-locale\fR option is present, the following argument is a string that specifies the locale in which the time is to be interpreted, in the same format that is used for the \fBmsgcat\fR package. Note -that the default, if \fB\-locale\fR is not specified, is the root locale -.MT -rather than the current locale. The current locale may be obtained by using -.QW "\fB\-locale\fR \fBcurrent\fR" . +that the default, if \fB-locale\fR is not specified, is the root locale +\fB{}\fR rather than the current locale. The current locale may +be obtained by using \fB-locale\fR \fBcurrent\fR. In addition, some platforms support a \fBsystem\fR locale that reflects the user's current choices. For instance, on Windows, the format that the user has selected from dates and times in the Control Panel can be obtained by using the \fBsystem\fR locale. On platforms that do not define a user selection of date and time formats -separate from \fBLC_TIME\fR, -.QW "\fB\-locale\fR \fBsystem\fR" -is synonymous with -.QW "\fB\-locale\fR \fBcurrent\fR" . +separate from \fBLC_TIME\fR, \fB-locale\fR \fBsystem\fR is +synonymous with \fB-locale\fR \fBcurrent\fR. .PP -If a \fB\-base\fR option is present, the following argument is +If a \fB-base\fR option is present, the following argument is a time (expressed in seconds from the epoch time) that is used as a \fIbase time\fR for interpreting relative times. If no -\fB\-base\fR option is present, the base time is the current time. +\fB-base\fR option is present, the base time is the current time. .PP Scanning of times in fixed format works by determining three things: the date, the time of day, and the time zone. These three are then @@ -438,7 +422,7 @@ combines with the hour and minute. If the string contains neither a \fB%s\fR format group nor a group specifying the hour of the day, then midnight (\fB00:00\fR, the start of the given date) is used. -The time zone is determined by either the \fB\-timezone\fR or \fB\-gmt\fR +The time zone is determined by either the \fB-timezone\fR or \fB-gmt\fR options, or by using the current time zone. .PP If a format string lacks a \fB%z\fR or \fB%Z\fR format group, @@ -603,13 +587,10 @@ and interprets them as the number of the month. .TP \fB%Od\fR, \fB%Oe\fR, \fB%OH\fR, \fB%OI\fR, \fB%Ok\fR, \fB%Ol\fR, \fB%Om\fR, \fB%OM\fR, \fB%OS\fR, \fB%Ou\fR, \fB%Ow\fR, \fB%Oy\fR All of these format groups are synonymous with their counterparts -without the -.QW \fBO\fR , -except that the string is produced and parsed in the locale-dependent -alternative numerals. +without the '\fBO\fR', except that the string is produced and parsed in the +locale-dependent alternative numerals. .TP \fB%p\fR -. On output, produces an indicator for the part of the day, \fBAM\fR or \fBPM\fR, appropriate to the given locale. If the script of the given locale supports multiple letterforms, lowercase is preferred. @@ -728,15 +709,11 @@ Brazilian Standard Time. It is recommended that date/time strings for use by computers use numeric time zones instead. .TP \fB%%\fR -On output, produces a literal -.QW \fB%\fR -character. On input, matches a literal -.QW \fB%\fR -character. +On output, produces a literal '\fB%\fR' character. On input, matches +a literal '\fB%\fR' character. .TP \fB%+\fR -Synonymous with -.QW "\fB%a %b %e %H:%M:%S %Z %Y\fR" . +Synonymous with '\fB%a %b %e %H:%M:%S %Z %Y\fR'. .SH "TIME ZONES" When the \fBclock\fR command is processing a local time, it has several possible sources for the time zone to use. In order of preference, they @@ -745,9 +722,8 @@ are: A time zone specified inside a string being parsed and matched by a \fB%z\fR or \fB%Z\fR format group. .IP [2] -A time zone specified with the \fB\-timezone\fR option to the \fBclock\fR -command (or, equivalently, by -.QW "\fB\-gmt\fR \fB1\fR" ). +A time zone specified with the \fB-timezone\fR option to the \fBclock\fR +command (or, equivalently, by \fB-gmt\fR \fB1\fR). .IP [3] A time zone specified in an environment variable \fBTCL_TZ\fR. .IP [4] @@ -783,14 +759,10 @@ that give the rules for various locales. A complete list of the location names is too lengthy to be listed here. On most Tcl installations, the definitions of the locations are to be found in named files in the directory -.QW "\fI/no_backup/tools/lib/tcl8.5/clock/tzdata\fR" . -On some Unix systems, these + "\fI/no_backup/tools/lib/tcl8.5/clock/tzdata\fR". On some Unix systems, these files are omitted, and the definitions are instead -obtained from system files in -.QW "\fI/usr/share/zoneinfo\fR" , -.QW "\fI/usr/share/lib/zoneinfo\fR" -or -.QW "\fI/usr/local/etc/zoneinfo\fR" . +obtained from system files in "\fI/usr/share/zoneinfo\fR", + "\fI/usr/share/lib/zoneinfo\fR" or "\fI/usr/local/etc/zoneinfo\fR". As a special case, the name \fB:localtime\fR refers to the local time zone as defined by the C library. .PP @@ -812,18 +784,17 @@ Developers wishing to localize the date and time formatting and parsing are referred to \fIhttp://tip.tcl.tk/173\fR for a specification. .SH "FREE FORM SCAN" -If the \fBclock scan\fR command is invoked without a \fB\-format\fR +If the \fBclock scan\fR command is invoked without a \fB-format\fR option, then it requests a \fIfree-form scan.\fR \fI This form of scan is deprecated.\fR The reason for the deprecation -is that there are too many ambiguities. (Does the string -.QW 2000 +is that there are too many ambiguities. (Does the string '2000' represent a year, a time of day, or a quantity?) No set of rules for interpreting free-form dates and times has been found to give unsurprising results in all cases. .PP -If free-form scan is used, only the \fB\-base\fR and \fB\-gmt\fR -options are accepted. The \fB\-timezone\fR and \fB\-locale\fR -options will result in an error if \fB\-format\fR is not supplied. +If free-form scan is used, only the \fB-base\fR and \fB-gmt\fR +options are accepted. The \fB-timezone\fR and \fB-locale\fR +options will result in an error if \fB-format\fR is not supplied. .PP For the benefit of users who need to understand legacy code that uses free-form scan, the documentation for how free-form scan @@ -832,13 +803,13 @@ interprets a string is included here: If only a time is specified, the current date is assumed. If the \fIinputString\fR does not contain a -time zone mnemonic, the local time zone is assumed, unless the \fB\-gmt\fR +time zone mnemonic, the local time zone is assumed, unless the \fB-gmt\fR argument is true, in which case the clock value is calculated assuming that the specified time is relative to Greenwich Mean Time. -\fB\-gmt\fR, if specified, affects only the computed time value; it does not -impact the interpretation of \fB\-base\fR. +\fB-gmt\fR, if specified, affects only the computed time value; it does not +impact the interpretation of \fB-base\fR. .PP -If the \fB\-base\fR flag is specified, the next argument should contain +If the \fB-base\fR flag is specified, the next argument should contain an integer clock value. Only the date in this value is used, not the time. This is useful for determining the time on a specific day or doing other date-relative conversions. @@ -853,14 +824,13 @@ If no meridian is specified, \fBhh\fR is interpreted on a 24-hour clock. .TP \fIdate\fR -A specific month and day with optional year. The acceptable formats are -.QW "\fBmm/dd\fR?\fB/yy\fR?" , -.QW "\fBmonthname dd\fR?\fB, yy\fR?" , -.QW "\fBday, dd monthname \fR?\fByy\fR?" , -.QW "\fBdd monthname yy\fR" , -.QW "?\fBCC\fR?\fByymmdd\fR" , -and -.QW "\fBdd-monthname-\fR?\fBCC\fR?\fByy\fR" . +A specific month and day with optional year. The +acceptable formats are "\fBmm/dd\fR?\fB/yy\fR?", + "\fBmonthname dd\fR?\fB, yy\fR?", + "\fBday, dd monthname \fR?\fByy\fR?", + "\fBdd monthname yy\fR", + "?\fBCC\fR?\fByymmdd\fR", and + "\fBdd-monthname-\fR?\fBCC\fR?\fByy\fR". The default year is the current year. If the year is less than 100, we treat the years 00-68 as 2000-2068 and the years 69-99 as 1969-1999. Not all platforms can represent the years 38-70, so @@ -868,15 +838,11 @@ an error may result if these years are used. .TP \fIISO 8601 point-in-time\fR An ISO 8601 point-in-time specification, such as \fBCCyymmddThhmmss\fR, -where \fBT\fR is the literal -.QW T , -.QW "\fBCCyymmdd hhmmss\fR" , -or -.QW \fBCCyymmddThh:mm:ss\fR . -Note that only these three formats are accepted. +where \fBT\fR is the literal T, "\fBCCyymmdd hhmmss\fR", or +\fBCCyymmddThh:mm:ss\fR. Note that only these three formats are accepted. The command does \fInot\fR accept the full range of point-in-time specifications specified in ISO8601. Other formats can be recognized by -giving an explicit \fI\-format\fR option to the \fBclock scan\fR command. +giving an explicit \fI-format\fR option to the \fBclock scan\fR command. .TP \fIrelative time\fR A specification relative to the current time. The format is \fBnumber diff --git a/doc/close.n b/doc/close.n index f701640..b2c87e5 100644 --- a/doc/close.n +++ b/doc/close.n @@ -5,7 +5,7 @@ '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. '\" -'\" RCS: @(#) $Id: close.n,v 1.11 2007/10/24 14:29:38 dkf Exp $ +'\" RCS: @(#) $Id: close.n,v 1.12 2007/10/26 20:11:52 dgp Exp $ '\" .so man.macros .TH close n 7.5 Tcl "Tcl Built-In Commands" @@ -71,7 +71,9 @@ proc withOpenFile {filename channelVar script} { return -options $options $result } .CE + .SH "SEE ALSO" file(n), open(n), socket(n), eof(n), Tcl_StandardChannels(3) + .SH KEYWORDS blocking, channel, close, nonblocking diff --git a/doc/concat.n b/doc/concat.n index dba0b39..ccc4be0 100644 --- a/doc/concat.n +++ b/doc/concat.n @@ -5,7 +5,7 @@ '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. '\" -'\" RCS: @(#) $Id: concat.n,v 1.8 2007/10/25 14:07:32 dkf Exp $ +'\" RCS: @(#) $Id: concat.n,v 1.9 2007/10/26 20:11:52 dgp Exp $ '\" .so man.macros .TH concat n 8.3 Tcl "Tcl Built-In Commands" @@ -30,31 +30,23 @@ Although \fBconcat\fR will concatenate lists (so the command: .CS \fBconcat\fR a b {c d e} {f {g h}} .CE -will return -.QW "\fBa b c d e f {g h}\fR" -as its result), it will also +will return "\fBa b c d e f {g h}\fR" as its result), it will also concatenate things that are not lists, and hence the command: .CS \fBconcat\fR " a b {c " d " e} f" .CE -will return -.QW "\fBa b {c d e} f\fR" -as its result. +will return "\fBa b {c d e} f\fR" as its result. .PP Note that the concatenation does not remove spaces from the middle of its arguments, so the command: .CS \fBconcat\fR "a b c" { d e f } .CE -will return -.QW "\fBa b c d e f\fR" -(i.e. with three spaces between the -.QW \fBa\fR , -the -.QW \fBb\fR -and the -.QW \fBc\fR ). +will return "\fBa b c d e f\fR" (i.e. with three spaces between +the \fBa\fR, the \fBb\fR and the \fBc\fR). + .SH "SEE ALSO" append(n), eval(n) + .SH KEYWORDS concatenate, join, lists diff --git a/doc/continue.n b/doc/continue.n index 93e7d1c..3c92b40 100644 --- a/doc/continue.n +++ b/doc/continue.n @@ -5,7 +5,7 @@ '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. '\" -'\" RCS: @(#) $Id: continue.n,v 1.8 2007/10/24 14:29:38 dkf Exp $ +'\" RCS: @(#) $Id: continue.n,v 1.9 2007/10/26 20:11:52 dgp Exp $ '\" .so man.macros .TH continue n "" Tcl "Tcl Built-In Commands" @@ -39,7 +39,9 @@ for {set x 0} {$x<10} {incr x} { puts "x is $x" } .CE + .SH "SEE ALSO" break(n), for(n), foreach(n), return(n), while(n) + .SH KEYWORDS continue, iteration, loop diff --git a/doc/dde.n b/doc/dde.n index a492498..1c344a5 100644 --- a/doc/dde.n +++ b/doc/dde.n @@ -5,7 +5,7 @@ '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. '\" -'\" RCS: @(#) $Id: dde.n,v 1.19 2007/10/25 14:07:32 dkf Exp $ +'\" RCS: @(#) $Id: dde.n,v 1.20 2007/10/26 20:11:52 dgp Exp $ '\" .so man.macros .TH dde n 1.3 dde "Tcl Bundled Packages" @@ -48,19 +48,14 @@ The following commands are a subset of the full Dynamic Data Exchange set of commands. .TP \fBdde servername \fR?\fB-force\fR? ?\fB-handler \fIproc\fR? ?\fB--\fR? ?\fItopic\fR? -. \fBdde servername\fR registers the interpreter as a DDE server with the service name \fBTclEval\fR and the topic name specified by \fItopic\fR. If no \fItopic\fR is given, \fBdde servername\fR returns the name of the current topic or the empty string if it is not registered as a service. If the given \fItopic\fR name is already in use, then a -suffix of the form -.QW " #2" -or -.QW " #3" -is appended to the name to make it +suffix of the form ' #2' or ' #3' is appended to the name to make it unique. The command's result will be the name actually used. The -\fB\-force\fR option is used to force registration of precisely the +\fB-force\fR option is used to force registration of precisely the given \fItopic\fR name. .IP The \fB-handler\fR option specifies a Tcl procedure that will be called to @@ -70,7 +65,6 @@ procedure is called with all the arguments provided by the remote call. .TP \fBdde execute\fR ?\fB\-async\fR? \fIservice topic data\fR -. \fBdde execute\fR takes the \fIdata\fR and sends it to the server indicated by \fIservice\fR with the topic indicated by \fItopic\fR. Typically, \fIservice\fR is the name of an application, and \fItopic\fR is a file to @@ -82,7 +76,6 @@ script did not run, unless the \fB\-async\fR flag was used, in which case the command returns immediately with no error. .TP \fBdde poke \fIservice topic item data\fR -. \fBdde poke\fR passes the \fIdata\fR to the server indicated by \fIservice\fR using the \fItopic\fR and \fIitem\fR specified. Typically, \fIservice\fR is the name of an application. \fItopic\fR is application @@ -92,7 +85,6 @@ it must always be non-null. The \fIdata\fR field is given to the remote application. .TP \fBdde request\fR ?\fB\-binary\fR? \fIservice topic item\fR -. \fBdde request\fR is typically used to get the value of something; the value of a cell in Microsoft Excel or the text of a selection in Microsoft Word. \fIservice\fR is typically the name of an application, @@ -103,7 +95,6 @@ string with terminating null. If \fB\-binary\fR is specified, the result is returned as a byte array. .TP \fBdde services \fIservice topic\fR -. \fBdde services\fR returns a list of service-topic pairs that currently exist on the machine. If \fIservice\fR and \fItopic\fR are both empty strings ({}), then all service-topic pairs currently @@ -115,7 +106,6 @@ service-topic pair currently exists, it is returned; otherwise, an empty string is returned. .TP \fBdde eval\fR ?\fB\-async\fR? \fItopic cmd \fR?\fIarg arg ...\fR? -. \fBdde eval\fR evaluates a command and its arguments using the interpreter specified by \fItopic\fR. The DDE service must be the \fBTclEval\fR service. The \fB\-async\fR option requests asynchronous invocation. The @@ -161,7 +151,9 @@ particularly important website: package require dde \fBdde execute\fR iexplore WWW_OpenURL http://www.tcl.tk/ .CE + .SH "SEE ALSO" tk(n), winfo(n), send(n) + .SH KEYWORDS application, dde, name, remote execution diff --git a/doc/dict.n b/doc/dict.n index 0f76aa9..7a26778 100644 --- a/doc/dict.n +++ b/doc/dict.n @@ -4,7 +4,7 @@ '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. '\" -'\" RCS: @(#) $Id: dict.n,v 1.13 2007/10/24 14:29:38 dkf Exp $ +'\" RCS: @(#) $Id: dict.n,v 1.14 2007/10/26 20:11:52 dgp Exp $ '\" .so man.macros .TH dict n 8.5 Tcl "Tcl Built-In Commands" @@ -257,7 +257,7 @@ foreach id [\fBdict keys\fR $employeeInfo] { puts "Hello, [\fBdict get\fR $employeeInfo $id forenames]!" } .CE -.PP + A localizable version of \fBstring toupper\fR: .CS # Set up the basic C locale @@ -277,7 +277,9 @@ foreach c [split {abcdefghijklmnopqrstuvwxyz} ""] { set upperCaseMap [\fBdict get\fR $capital $env(LANG)] set upperCase [string map $upperCaseMap $string] .CE + .SH "SEE ALSO" append(n), array(n), foreach(n), incr(n), list(n), lappend(n), set(n) + .SH KEYWORDS dictionary, create, update, lookup, iterate, filter diff --git a/doc/encoding.n b/doc/encoding.n index 376780c..4016b83 100644 --- a/doc/encoding.n +++ b/doc/encoding.n @@ -4,7 +4,7 @@ '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. '\" -'\" RCS: @(#) $Id: encoding.n,v 1.11 2007/10/26 12:25:06 dkf Exp $ +'\" RCS: @(#) $Id: encoding.n,v 1.12 2007/10/26 20:11:52 dgp Exp $ '\" .so man.macros .TH encoding n "8.1" Tcl "Tcl Built-In Commands" @@ -82,12 +82,13 @@ of the original string. The \fBencoding\fR command can be used to convert this string to the expected Japanese Unicode characters. For example, .CS -set s [\fBencoding convertfrom\fR euc-jp "\exA4\exCF"] +set s [\fBencoding convertfrom\fR euc-jp "\\xA4\\xCF"] .CE -would return the Unicode string -.QW "\eu306F" , -which is the Hiragana letter HA. +would return the Unicode string "\\u306F", which is the Hiragana +letter HA. + .SH "SEE ALSO" -fconfigure(n), Tcl_GetEncoding(3) +Tcl_GetEncoding(3) + .SH KEYWORDS encoding diff --git a/doc/eof.n b/doc/eof.n index 8503259..cb856e9 100644 --- a/doc/eof.n +++ b/doc/eof.n @@ -5,7 +5,7 @@ '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. '\" -'\" RCS: @(#) $Id: eof.n,v 1.7 2007/10/24 14:29:38 dkf Exp $ +'\" RCS: @(#) $Id: eof.n,v 1.8 2007/10/26 20:11:52 dgp Exp $ '\" .so man.macros .TH eof n 7.5 Tcl "Tcl Built-In Commands" @@ -55,7 +55,9 @@ while {1} { puts "Read record: $record" } .CE + .SH "SEE ALSO" file(n), open(n), close(n), fblocked(n), Tcl_StandardChannels(3) + .SH KEYWORDS channel, end of file diff --git a/doc/exec.n b/doc/exec.n index 619f1e9..01f7004 100644 --- a/doc/exec.n +++ b/doc/exec.n @@ -6,7 +6,7 @@ '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. '\" -'\" RCS: @(#) $Id: exec.n,v 1.18 2007/10/25 14:07:32 dkf Exp $ +'\" RCS: @(#) $Id: exec.n,v 1.19 2007/10/26 20:11:52 dgp Exp $ '\" .so man.macros .TH exec n 8.5 Tcl "Tcl Built-In Commands" @@ -49,12 +49,9 @@ If an \fIarg\fR (or pair of \fIarg\fRs) has one of the forms described below then it is used by \fBexec\fR to control the flow of input and output among the subprocess(es). Such arguments will not be passed to the subprocess(es). In forms -such as -.QW "< \fIfileName\fR" , -\fIfileName\fR may either be in a separate argument from -.QW < -or in the same argument with no intervening space (i.e. -.QW <\fIfileName\fR ). +such as ``< \fIfileName\fR'' \fIfileName\fR may either be in a +separate argument from ``<'' or in the same argument with no +intervening space (i.e. ``<\fIfileName\fR''). .TP 15 | Separates distinct commands in the pipeline. The standard output @@ -137,9 +134,8 @@ If standard output has not been redirected then the \fBexec\fR command returns the standard output from the last command in the pipeline, .VS 8.5 -unless -.QW 2>@1 -was specified, in which case standard error is included as well. +unless ``2>@1'' was specified, in which case +standard error is included as well. .VE 8.5 If any of the commands in the pipeline exit abnormally or are killed or suspended, then \fBexec\fR will return an error @@ -165,17 +161,12 @@ normally end with newlines. However, if \fB\-keepnewline\fR is specified then the trailing newline is retained. .PP -If standard input isn't redirected with -.QW < , -.QW << -or -.QW <@ -then the standard input for the first command in the +If standard input isn't redirected with ``<'' or ``<<'' +or ``<@'' then the standard input for the first command in the pipeline is taken from the application's current standard input. .PP -If the last \fIarg\fR is -.QW & -then the pipeline will be executed in background. +If the last \fIarg\fR is ``&'' then the pipeline will be +executed in background. In this case the \fBexec\fR command will return a list whose elements are the process identifiers for all of the subprocesses in the pipeline. @@ -191,16 +182,14 @@ no slashes then the directories in the PATH environment variable are searched for an executable by the given name. If the name contains a slash then it must refer to an executable -reachable from the current directory. No -.QW glob -expansion or other shell-like substitutions +reachable from the current directory. +No ``glob'' expansion or other shell-like substitutions are performed on the arguments to commands. .SH "PORTABILITY ISSUES" .TP \fBWindows\fR (all versions) . -Reading from or writing to a socket, using the -.QW \fB@\0\fIfileId\fR +Reading from or writing to a socket, using the ``\fB@\0\fIfileId\fR'' notation, does not work. When reading from a socket, a 16-bit DOS application will hang and a 32-bit application will return immediately with end-of-file. When either type of application writes to a socket, the @@ -225,11 +214,8 @@ path separator, it may or may not be recognized as a path name, depending on the program. .PP Additionally, when calling a 16-bit DOS or Windows 3.X application, all path -names must use the short, cryptic, path format (e.g., using -.QW applba~1.def -instead of -.QW applbakery.default ), -which can be obtained with the +names must use the short, cryptic, path format (e.g., using ``applba~1.def'' +instead of ``applbakery.default''), which can be obtained with the \fBfile attributes $fileName -shortname\fR command. .PP Two or more forward or backward slashes in a row in a path refer to a @@ -288,8 +274,7 @@ The Windows NT home directory. The directories listed in the path. .PP In order to execute shell built-in commands like \fBdir\fR and \fBcopy\fR, -the caller must prepend the desired command with -.QW "\fBcmd.exe /c\0\fR" +the caller must prepend the desired command with ``\fBcmd.exe /c\0\fR'' because built-in commands are not implemented using executables. .RE .TP @@ -314,8 +299,7 @@ The Windows 9x home directory. The directories listed in the path. .PP In order to execute shell built-in commands like \fBdir\fR and \fBcopy\fR, -the caller must prepend the desired command with -.QW "\fBcommand.com /c\0\fR" +the caller must prepend the desired command with ``\fBcommand.com /c\0\fR'' because built-in commands are not implemented using executables. .PP Once a 16-bit DOS application has read standard input from a console and @@ -327,9 +311,7 @@ at this time. .PP Redirection between the \fBNUL:\fR device and a 16-bit application does not always work. When redirecting from \fBNUL:\fR, some applications may hang, -others will get an infinite stream of -.QW 0x01 -bytes, and some will actually +others will get an infinite stream of ``0x01'' bytes, and some will actually correctly get an immediate end-of-file; the behavior seems to depend upon something compiled into the application itself. When redirecting greater than 4K or so to \fBNUL:\fR, some applications will hang. The above problems do not @@ -428,10 +410,9 @@ differences in behaviour between \fBexec\fR and DOS batch files. .PP When in doubt, use the command \fBauto_execok\fR: it will return the complete path to the program as seen by the \fBexec\fR command. This -applies especially when you want to run -.QW "internal" -commands like \fIdir\fR from a Tcl script (if you just want to list -filenames, use the \fBglob\fR command.) To do that, use this: +applies especially when you want to run "internal" commands like +\fIdir\fR from a Tcl script (if you just want to list filenames, use +the \fBglob\fR command.) To do that, use this: .CS \fBexec\fR {*}[auto_execok dir] *.tcl .CE diff --git a/doc/expr.n b/doc/expr.n index 2a1b18c..1d2c4f3 100644 --- a/doc/expr.n +++ b/doc/expr.n @@ -6,7 +6,7 @@ '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. '\" -'\" RCS: @(#) $Id: expr.n,v 1.26 2007/10/25 09:35:14 dkf Exp $ +'\" RCS: @(#) $Id: expr.n,v 1.27 2007/10/26 20:11:52 dgp Exp $ '\" .so man.macros .TH expr n 8.5 Tcl "Tcl Built-In Commands" @@ -107,11 +107,11 @@ the variable \fBb\fR has the value 6. Then the command on the left side of each of the lines below will produce the value on the right side of the line: .CS -.ta 3.5i -\fBexpr\fR 3.1 + $a \fB\(-> \fI6.1\fR -\fBexpr\fR 2 + "$a.$b" \fB\(-> \fI5.6\fR -\fBexpr\fR 4*[llength "6 2"] \fB\(-> \fI8\fR -\fBexpr\fR {{word one} < "word $a"} \fB\(-> \fI0\fR +.ta 6c +\fBexpr\fR 3.1 + $a \fI6.1\fR +\fBexpr\fR 2 + "$a.$b" \fI5.6\fR +\fBexpr\fR 4*[llength "6 2"] \fI8\fR +\fBexpr\fR {{word one} < "word $a"} \fI0\fR .CE .SS OPERATORS .PP @@ -203,9 +203,9 @@ precedence level. For example, the command .CE returns 0. .PP -The \fB&&\fR, \fB||\fR, and \fB?:\fR operators have -.QW "lazy evaluation" , -just as in C, which means that operands are not evaluated if they are +The \fB&&\fR, \fB||\fR, and \fB?:\fR operators have ``lazy +evaluation'', just as in C, +which means that operands are not evaluated if they are not needed to determine the outcome. For example, in the command .CS \fBexpr {$v ? [a] : [b]}\fR @@ -273,8 +273,8 @@ returns 1, while \fBexpr\fR {5 / 4.0} \fBexpr\fR {5 / ( [string length "abcd"] + 0.0 )} .CE -both return 1.25. Floating-point values are always returned with a -.QW \fB.\fR +both return 1.25. +Floating-point values are always returned with a ``\fB.\fR'' or an \fBe\fR so that they will not look like integer values. For example, .CS @@ -338,9 +338,8 @@ unbraced expressions that contain command substitutions. These expressions must be implemented by generating new code each time the expression is executed. .SH EXAMPLES -Define a procedure that computes an -.QW "interesting" -mathematical function: +Define a procedure that computes an "interesting" mathematical +function: .CS proc tcl::mathfunc::calc {x y} { \fBexpr\fR { ($x**2 - $y**2) / exp($x**2 + $y**2) } @@ -380,14 +379,16 @@ Generate a random integer in the range 0..99 inclusive: .CS set randNum [\fBexpr\fR { int(100 * rand()) }] .CE + .SH "SEE ALSO" -array(n), for(n), if(n), mathfunc(n), namespace(n), proc(n), string(n), -Tcl(n), while(n) +array(n), for(n), if(n), mathfunc(n), namespace(n), proc(n), string(n), Tcl(n), while(n) + .SH KEYWORDS arithmetic, boolean, compare, expression, fuzzy comparison + .SH COPYRIGHT -.nf -Copyright \(co 1993 The Regents of the University of California. -Copyright \(co 1994-2000 Sun Microsystems Incorporated. -Copyright \(co 2005 by Kevin B. Kenny. All rights reserved. -.fi +Copyright (c) 1993 The Regents of the University of California. +.br +Copyright (c) 1994-2000 Sun Microsystems Incorporated. +.br +Copyright (c) 2005 by Kevin B. Kenny . All rights reserved. diff --git a/doc/fcopy.n b/doc/fcopy.n index d59ddf8..766cca2 100644 --- a/doc/fcopy.n +++ b/doc/fcopy.n @@ -5,7 +5,7 @@ '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. '\" -'\" RCS: @(#) $Id: fcopy.n,v 1.13 2007/10/25 14:07:32 dkf Exp $ +'\" RCS: @(#) $Id: fcopy.n,v 1.14 2007/10/26 20:11:52 dgp Exp $ '\" .so man.macros .TH fcopy n 8.0 Tcl "Tcl Built-In Commands" @@ -59,9 +59,7 @@ then all data already queued for \fIoutchan\fR is written out. Note that \fIinchan\fR can become readable during a background copy. You should turn off any \fBfileevent\fR handlers during a background copy so those handlers do not interfere with the copy. -Any I/O attempted by a \fBfileevent\fR handler will get a -.QW "channel busy" -error. +Any I/O attempted by a \fBfileevent\fR handler will get a "channel busy" error. .PP \fBFcopy\fR translates end-of-line sequences in \fIinchan\fR and \fIoutchan\fR according to the \fB\-translation\fR option @@ -80,16 +78,16 @@ means that the incoming characters are converted internally first UTF-8 and then into the encoding of the channel \fBfcopy\fR writes to. See the manual entry for \fBfconfigure\fR for details on the \fB\-encoding\fR and \fB\-translation\fR options. No conversion is -done if both channels are set to encoding -.QW "binary" -and have matching translations. If only the output channel is set to encoding -.QW "binary" -the system will write the internal UTF-8 representation of the incoming -characters. If only the input channel is set to encoding -.QW "binary" -the system will assume that the incoming bytes are valid UTF-8 characters and -convert them according to the output encoding. The behaviour of the system for -bytes which are not valid UTF-8 characters is undefined in this case. +done if both channels are +set to encoding "binary" and have matching translations. If only the +output channel is set to +encoding "binary" the system will write the internal UTF-8 +representation of the incoming characters. If only the input channel +is set to encoding "binary" the system will assume that the incoming +bytes are valid UTF-8 characters and convert them according to the +output encoding. The behaviour of the system for bytes which are not +valid UTF-8 characters is undefined in this case. + .SH EXAMPLES .PP The first example transfers the contents of one channel exactly to @@ -146,7 +144,9 @@ set total 0 -command [list CopyMore $in $out $chunk] vwait done .CE + .SH "SEE ALSO" eof(n), fblocked(n), fconfigure(n), file(n) + .SH KEYWORDS blocking, channel, end of line, end of file, nonblocking, read, translation diff --git a/doc/file.n b/doc/file.n index 2c3558c..adf54b6 100644 --- a/doc/file.n +++ b/doc/file.n @@ -5,7 +5,7 @@ '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. '\" -'\" RCS: @(#) $Id: file.n,v 1.46 2007/10/25 14:07:32 dkf Exp $ +'\" RCS: @(#) $Id: file.n,v 1.47 2007/10/26 20:11:52 dgp Exp $ '\" .so man.macros .TH file n 8.3 Tcl "Tcl Built-In Commands" @@ -47,11 +47,11 @@ flags and their values. The second form returns the value for the specific option. The third form sets one or more of the values. The values are as follows: .PP -On Unix, \fB\-group\fR gets or sets the group name for the file. A group id -can be given to the command, but it returns a group name. \fB\-owner\fR gets +On Unix, \fB-group\fR gets or sets the group name for the file. A group id +can be given to the command, but it returns a group name. \fB-owner\fR gets or sets the user name of the owner of the file. The command returns the owner name, but the numerical id can be passed when setting the -owner. \fB\-permissions\fR sets or retrieves the octal code that chmod(1) +owner. \fB-permissions\fR sets or retrieves the octal code that chmod(1) uses. This command does also has limited support for setting using the symbolic attributes for chmod(1), of the form [ugo]?[[+\-=][rwxst],[...]], where multiple symbolic attributes can be separated by commas (example: @@ -59,24 +59,24 @@ where multiple symbolic attributes can be separated by commas (example: permissions for group and other). A simplified \fBls\fR style string, of the form rwxrwxrwx (must be 9 characters), is also supported (example: \fBrwxr\-xr\-t\fR is equivalent to 01755). -On versions of Unix supporting file flags, \fB\-readonly\fR gives the +On versions of Unix supporting file flags, \fB-readonly\fR gives the value or sets or clears the readonly attribute of the file, i.e. the user immutable flag \fBuchg\fR to chflags(1). .PP -On Windows, \fB\-archive\fR gives the value or sets or clears the -archive attribute of the file. \fB\-hidden\fR gives the value or sets -or clears the hidden attribute of the file. \fB\-longname\fR will +On Windows, \fB-archive\fR gives the value or sets or clears the +archive attribute of the file. \fB-hidden\fR gives the value or sets +or clears the hidden attribute of the file. \fB-longname\fR will expand each path element to its long version. This attribute cannot be -set. \fB\-readonly\fR gives the value or sets or clears the readonly -attribute of the file. \fB\-shortname\fR gives a string where every +set. \fB-readonly\fR gives the value or sets or clears the readonly +attribute of the file. \fB-shortname\fR gives a string where every path element is replaced with its short (8.3) version of the -name. This attribute cannot be set. \fB\-system\fR gives or sets or +name. This attribute cannot be set. \fB-system\fR gives or sets or clears the value of the system attribute of the file. .PP -On Mac OS X and Darwin, \fB\-creator\fR gives or sets the -Finder creator type of the file. \fB\-hidden\fR gives or sets or clears -the hidden attribute of the file. \fB\-readonly\fR gives or sets or -clears the readonly attribute of the file. \fB\-rsrclength\fR gives +On Mac OS X and Darwin, \fB-creator\fR gives or sets the +Finder creator type of the file. \fB-hidden\fR gives or sets or clears +the hidden attribute of the file. \fB-readonly\fR gives or sets or +clears the readonly attribute of the file. \fB-rsrclength\fR gives the length of the resource fork of the file, this attribute can only be set to the value 0, which results in the resource fork being stripped off the file. @@ -122,9 +122,7 @@ Trying to delete a non-existent file is not considered an error. Trying to delete a read-only file will cause the file to be deleted, even if the \fB\-force\fR flags is not specified. If the \fB\-force\fR option is specified on a directory, Tcl will attempt both to change -permissions and move the current directory -.QW pwd -out of the given path +permissions and move the current directory 'pwd' out of the given path if that is necessary to allow the deletion to proceed. Arguments are processed in the order specified, halting at the first error, if any. A \fB\-\|\-\fR marks the end of switches; the argument following the @@ -134,10 +132,9 @@ a \fB\-\fR. \fBfile dirname \fIname\fR Returns a name comprised of all of the path components in \fIname\fR excluding the last element. If \fIname\fR is a relative file name and -only contains one path element, then returns -.QW \fB.\fR . -If \fIname\fR refers to a root directory, then the root directory is -returned. For example, +only contains one path element, then returns ``\fB.\fR''. If \fIname\fR +refers to a root directory, then the root directory is returned. For +example, .RS .CS \fBfile dirname c:/\fR @@ -198,7 +195,7 @@ is always canonical for the current platform: \fB/\fR for Unix and Windows. .RE .TP -\fBfile link ?\fI\-linktype\fR? \fIlinkName\fR ?\fItarget\fR? +\fBfile link ?\fI-linktype\fR? \fIlinkName\fR ?\fItarget\fR? . If only one argument is given, that argument is assumed to be \fIlinkName\fR, and this command returns the value of the link given by @@ -219,20 +216,15 @@ link is created. . If the user wishes to make a link of a specific type only, (and signal an error if for some reason that is not possible), then the optional -\fI\-linktype\fR argument should be given. Accepted values for -\fI\-linktype\fR are -.QW "\-symbolic" -and -.QW "\-hard" . +\fI-linktype\fR argument should be given. Accepted values for +\fI-linktype\fR are "-symbolic" and "-hard". . On Unix, symbolic links can be made to relative paths, and those paths must be relative to the actual \fIlinkName\fR's location (not to the cwd), but on all other platforms where relative links are not supported, target paths will always be converted to absolute, normalized form before the link is created (and therefore relative paths are interpreted -as relative to the cwd). Furthermore, -.QW "~user" -paths are always expanded +as relative to the cwd). Furthermore, "~user" paths are always expanded to absolute form. When creating links on filesystems that either do not support any links, or do not support the specific type requested, an error message will be returned. In particular Windows 95, 98 and ME do @@ -280,20 +272,16 @@ under Windows. Returns a unique normalized path representation for the file-system object (file, directory, link, etc), whose string value can be used as a unique identifier for it. A normalized path is an absolute path which has -all -.QW ../ , -.QW ./ -removed. Also it is one which is in the -.QW standard +all '../', './' removed. Also it is one which is in the ``standard'' format for the native platform. On Unix, this means the segments leading up to the path must be free of symbolic links/aliases (but the very last path component may be a symbolic link), and on Windows it also means we want the long form with that form's case-dependence (which gives us a unique, case-dependent path). The one exception concerning the last link in the path is necessary, because Tcl or the user may wish to -operate on the actual symbolic link itself (for example \fBfile -delete\fR, \fBfile rename\fR, \fBfile copy\fR are defined to operate -on symbolic links, not on the things that they point to). +operate on the actual symbolic link itself (for example 'file delete', 'file +rename', 'file copy' are defined to operate on symbolic links, not on the +things that they point to). .RE .TP \fBfile owned \fIname\fR @@ -346,9 +334,7 @@ switches; the argument following the \fB\-\|\-\fR will be treated as a \fBfile rootname \fIname\fR . Returns all of the characters in \fIname\fR up to but not including the -last -.QW . -character in the last component of name. If the last +last ``.'' character in the last component of name. If the last component of \fIname\fR doesn't contain a dot, then returns \fIname\fR. .TP \fBfile separator\fR ?\fIname\fR? @@ -402,19 +388,12 @@ the filesystem to use for the file, and the second, if given, an arbitrary string representing the filesystem-specific nature or type of the location within that filesystem. If a filesystem only supports one type of file, the second element may not be supplied. For example the -native files have a first element -.QW native , -and a second element which +native files have a first element 'native', and a second element which when given is a platform-specific type name for the file's system -(e.g. -.QW NTFS , -.QW FAT , -on Windows). A generic virtual file system might return the list -.QW "vfs ftp" -to represent a file on a remote ftp site mounted as a virtual -filesystem through an extension called -.QW vfs . -If the file does not belong to any filesystem, an error is generated. +(e.g. 'NTFS', 'FAT', on Windows). A generic virtual file system might return +the list 'vfs ftp' to represent a file on a remote ftp site mounted as a +virtual filesystem through an extension called 'vfs'. If the file does +not belong to any filesystem, an error is generated. .TP \fBfile tail \fIname\fR . @@ -432,15 +411,13 @@ Returns a string giving the type of file \fIname\fR, which will be one of .TP \fBfile volumes\fR . -Returns the absolute paths to the volumes mounted on the system, as a proper -Tcl list. Without any virtual filesystems mounted as root volumes, on UNIX, -the command will always return -.QW "/" , -since all filesystems are locally mounted. On Windows, it will return a list -of the available local drives (e.g. -.QW "a:/ c:/" ). -If any virtual filesystem has mounted additional volumes, they will be in the -returned list. +Returns the absolute paths to the volumes mounted on the system, as a +proper Tcl list. Without any virtual filesystems mounted as root +volumes, on UNIX, the command will always return "/", since all +filesystems are locally mounted. +On Windows, it will return a list of the available local drives +(e.g. {a:/ c:/}). If any virtual filesystem has mounted additional +volumes, they will be in the returned list. .TP \fBfile writable \fIname\fR . @@ -487,7 +464,7 @@ set oldName foobar.txt set newName foo/bar.txt # Make sure that where we're going to move to exists... if {![\fBfile isdirectory\fR [\fBfile dirname\fR $newName]]} { - \fBfile mkdir\fR [\fBfile dirname\fR $newName] + \fBfile mkdir\fR [\fBfile dirname\fR $newName] } \fBfile rename\fR $oldName $newName \fBfile link\fR -symbolic $oldName $newName diff --git a/doc/fileevent.n b/doc/fileevent.n index 385d5ec..6d3bc19 100644 --- a/doc/fileevent.n +++ b/doc/fileevent.n @@ -5,7 +5,7 @@ '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. '\" -'\" RCS: @(#) $Id: fileevent.n,v 1.10 2007/10/24 14:29:38 dkf Exp $ +'\" RCS: @(#) $Id: fileevent.n,v 1.11 2007/10/26 20:11:52 dgp Exp $ '\" .so man.macros .TH fileevent n 7.5 Tcl "Tcl Built-In Commands" @@ -30,9 +30,7 @@ interact with the user while waiting for the data to arrive. If an application invokes \fBgets\fR or \fBread\fR on a blocking channel when there is no input data available, the process will block; until the input data arrives, it will not be able to service other events, so it will -appear to the user to -.QW "freeze up" . -With \fBfileevent\fR, the process can +appear to the user to ``freeze up''. With \fBfileevent\fR, the process can tell when data is present and only invoke \fBgets\fR or \fBread\fR when they won't block. .PP @@ -112,12 +110,15 @@ proc GetData {chan} { \fBfileevent\fR $chan readable [list GetData $chan] .CE + .SH CREDITS .PP \fBfileevent\fR is based on the \fBaddinput\fR command created by Mark Diekhans. + .SH "SEE ALSO" fconfigure(n), gets(n), interp(n), puts(n), read(n), Tcl_StandardChannels(3) + .SH KEYWORDS asynchronous I/O, blocking, channel, event handler, nonblocking, readable, script, writable. diff --git a/doc/filename.n b/doc/filename.n index 65403bd..8f70f1f 100644 --- a/doc/filename.n +++ b/doc/filename.n @@ -4,7 +4,7 @@ '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. '\" -'\" RCS: @(#) $Id: filename.n,v 1.16 2007/10/25 14:07:32 dkf Exp $ +'\" RCS: @(#) $Id: filename.n,v 1.17 2007/10/26 20:11:52 dgp Exp $ '\" .so man.macros .TH filename n 7.5 Tcl "Tcl Built-In Commands" @@ -142,36 +142,29 @@ will be correctly substituted using the \fB$HOME\fR environment variable, just like for Unix. .SH "PORTABILITY ISSUES" .PP -Not all file systems are case sensitive, so scripts should avoid code that -depends on the case of characters in a file name. In addition, the character -sets allowed on different devices may differ, so scripts should choose file -names that do not contain special characters like: \fB<>:?"/\e|\fR. -.\"" Reset emacs highlighting -The safest approach is to use names consisting of alphanumeric characters -only. Care should be taken with filenames which contain spaces (common on -Windows systems) and filenames where the backslash is the directory separator -(Windows native path names). Also Windows 3.1 only supports file names with a -root of no more than 8 characters and an extension of no more than 3 -characters. +Not all file systems are case sensitive, so scripts should avoid code +that depends on the case of characters in a file name. In addition, +the character sets allowed on different devices may differ, so scripts +should choose file names that do not contain special characters like: +\fB<>:?"/\e|\fR. The safest approach is to use names consisting of +alphanumeric characters only. Care should be taken with filenames +which contain spaces (common on Windows systems) and +filenames where the backslash is the directory separator (Windows +native path names). Also Windows 3.1 only supports file +names with a root of no more than 8 characters and an extension of no +more than 3 characters. .PP -On Windows platforms there are file and path length restrictions. Complete -paths or filenames longer than about 260 characters will lead to errors in -most file operations. +On Windows platforms there are file and path length restrictions. +Complete paths or filenames longer than about 260 characters will lead +to errors in most file operations. .PP -Another Windows peculiarity is that any number of trailing dots -.QW "." -in filenames are totally ignored, so, for example, attempts to create a file -or directory with a name -.QW "foo." -will result in the creation of a file or directory with name -.QW "foo" . -This fact is reflected in the results of -.QW \fBfile normalize\fR . -Furthermore, a file name consisting only of dots -.QW "........." -or dots with trailing characters -.QW ".....abc" -is illegal. +Another Windows peculiarity is that any number of trailing dots '.' in +filenames are totally ignored, so, for example, attempts to create a +file or directory with a name "foo." will result in the creation of a +file/directory with name "foo". This fact is reflected in the +results of 'file normalize'. Furthermore, a file name consisting only +of dots '.........' or dots with trailing characters '.....abc' is +illegal. .SH KEYWORDS current directory, absolute file name, relative file name, volume-relative file name, portability diff --git a/doc/for.n b/doc/for.n index 8dcd880..912e579 100644 --- a/doc/for.n +++ b/doc/for.n @@ -5,14 +5,14 @@ '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. '\" -'\" RCS: @(#) $Id: for.n,v 1.6 2007/10/24 14:29:38 dkf Exp $ +'\" RCS: @(#) $Id: for.n,v 1.7 2007/10/26 20:11:52 dgp Exp $ '\" .so man.macros .TH for n "" Tcl "Tcl Built-In Commands" .BS '\" Note: do not modify the .SH NAME line immediately below! .SH NAME -for \- `For' loop +for \- ``For'' loop .SH SYNOPSIS \fBfor \fIstart test next body\fR .BE diff --git a/doc/format.n b/doc/format.n index e2386f6..3ba307c 100644 --- a/doc/format.n +++ b/doc/format.n @@ -5,7 +5,7 @@ '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. '\" -'\" RCS: @(#) $Id: format.n,v 1.16 2007/10/25 14:07:32 dkf Exp $ +'\" RCS: @(#) $Id: format.n,v 1.17 2007/10/26 20:11:52 dgp Exp $ '\" .so man.macros .TH format n 8.1 Tcl "Tcl Built-In Commands" @@ -50,8 +50,8 @@ The fields that are present must appear in the order given above. The paragraphs below discuss each of these fields in turn. .PP If the \fB%\fR is followed by a decimal number and a \fB$\fR, as in -.QW \fB%2$d\fR , -then the value to convert is not taken from the next sequential argument. +``\fB%2$d\fR'', then the value to convert is not taken from the +next sequential argument. Instead, it is taken from the argument indicated by the number, where 1 corresponds to the first \fIarg\fR. If the conversion specifier requires multiple arguments because @@ -156,10 +156,7 @@ Convert integer to unsigned octal string. .TP 10 \fBx\fR or \fBX\fR Convert integer to unsigned hexadecimal string, using digits -.QW 0123456789abcdef -for \fBx\fR and -.QW 0123456789ABCDEF -for \fBX\fR). +``0123456789abcdef'' for \fBx\fR and ``0123456789ABCDEF'' for \fBX\fR). .TP 10 \fBc\fR Convert integer to the Unicode character it represents. @@ -175,9 +172,8 @@ If the precision is 0 then no decimal point is output. .TP 10 \fBe\fR or \fBE\fR Convert number to scientific notation in the -form -.QW "\fIx.yyy\fBe\(+-\fIzz\fR" , -where the number of \fIy\fR's is determined by the precision (default: 6). +form \fIx.yyy\fBe\(+-\fIzz\fR, where the number of \fIy\fR's is determined +by the precision (default: 6). If the precision is 0 then no decimal point is output. If the \fBE\fR form is used then \fBE\fR is printed instead of \fBe\fR. diff --git a/doc/glob.n b/doc/glob.n index ca92e2a..c20ce49 100644 --- a/doc/glob.n +++ b/doc/glob.n @@ -5,7 +5,7 @@ '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. '\" -'\" RCS: @(#) $Id: glob.n,v 1.19 2007/10/24 14:29:38 dkf Exp $ +'\" RCS: @(#) $Id: glob.n,v 1.20 2007/10/26 20:11:52 dgp Exp $ '\" .so man.macros .TH glob n 8.3 Tcl "Tcl Built-In Commands" @@ -19,9 +19,7 @@ glob \- Return names of files that match patterns .SH DESCRIPTION .PP -This command performs file name -.QW globbing -in a fashion similar to +This command performs file name ``globbing'' in a fashion similar to the csh shell. It returns a list of the files whose names match any of the \fIpattern\fR arguments. No particular order is guaranteed in the list, so if a sorted list is required the caller should use @@ -103,9 +101,8 @@ The following are equivalent: \fBglob */\fR .CE .RE -except that the first case doesn't return the trailing -.QW / -and is more platform independent. +except that the first case doesn't return the trailing ``/'' and +is more platform independent. .RE .TP \fB\-\|\-\fR @@ -132,38 +129,20 @@ Matches the character \fIx\fR. \fB{\fIa\fB,\fIb\fB,\fI...\fR} Matches any of the strings \fIa\fR, \fIb\fR, etc. .LP -On Unix, as with csh, a -.QW . -at the beginning of a file's name or just after a -.QW / -must be matched explicitly or with a {} construct, unless the -.QW "-types hidden" -flag is given (since -.QW . -at the beginning +On Unix, as with csh, a ``.'' at the beginning of a file's name or just +after a ``/'' must be matched explicitly or with a {} construct, +unless the ``-types hidden'' flag is given (since ``.'' at the beginning of a file's name indicates that it is hidden). On other platforms, -files beginning with a -.QW . -are handled no differently to any others, -except the special directories -.QW . -and -.QW .. -which must be matched explicitly (this is to avoid a recursive pattern like -.QW "glob -join * * * *" -from recursing up the directory hierarchy as well as down). In addition, all -.QW / -characters must be matched explicitly. +files beginning with a ``.'' are handled no differently to any others, +except the special directories ``.'' and ``..'' which must be matched +explicitly (this is to avoid a recursive pattern like ``glob -join * * +* *'' from recursing up the directory hierarchy as well as down). +In addition, all ``/'' characters must be matched explicitly. .LP -If the first character in a \fIpattern\fR is -.QW ~ -then it refers to the home directory for the user whose name follows the -.QW ~ . -If the -.QW ~ -is followed immediately by -.QW / -then the value of the HOME environment variable is used. +If the first character in a \fIpattern\fR is ``~'' then it refers +to the home directory for the user whose name follows the ``~''. +If the ``~'' is followed immediately by ``/'' then the value of +the HOME environment variable is used. .LP The \fBglob\fR command differs from csh globbing in two ways. First, it does not sort its result list (use the \fBlsort\fR @@ -173,33 +152,24 @@ exist; in csh no check for existence is made unless a pattern contains a ?, *, or [] construct. .LP When the \fBglob\fR command returns relative paths whose filenames -start with a tilde -.QW ~ -(for example through \fBglob *\fR or +start with a tilde ``~'' (for example through \fBglob *\fR or \fBglob -tails\fR, the returned list will not quote the tilde with -.QW ./ . -This means care must be taken if those names are later to +``./''. This means care must be taken if those names are later to be used with \fBfile join\fR, to avoid them being interpreted as absolute paths pointing to a given user's home directory. .SH "PORTABILITY ISSUES" -.TP +.PP \fBWindows\fR . For Windows UNC names, the servername and sharename components of the path may not contain ?, *, or [] constructs. On Windows NT, if \fIpattern\fR is -of the form -.QW \fB~\fIusername\fB@\fIdomain\fR -it refers to the home +of the form ``\fB~\fIusername\fB@\fIdomain\fR'' it refers to the home directory of the user whose account information resides on the specified NT domain server. Otherwise, user account information is obtained from the local computer. On Windows 95 and 98, \fBglob\fR accepts patterns -like -.QW .../ -and -.QW ..../ -for successively higher up parent directories. -.RS -.PP +like ``.../'' and ``..../'' for successively higher up parent directories. + +. Since the backslash character has a special meaning to the glob command, glob patterns containing Windows style path separators need special care. The pattern \fIC:\e\efoo\e\e*\fR is interpreted as @@ -226,12 +196,7 @@ Find all subdirectories of the current directory: \fBglob\fR \-type d * .CE .PP -Find all files whose name contains an -.QW a , -a -.QW b -or the sequence -.QW cde : +Find all files whose name contains an "a", a "b" or the sequence "cde": .CS \fBglob\fR \-type f *{a,b,cde}* .CE diff --git a/doc/history.n b/doc/history.n index e796575..b27c485 100644 --- a/doc/history.n +++ b/doc/history.n @@ -5,7 +5,7 @@ '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. '\" -'\" RCS: @(#) $Id: history.n,v 1.5 2007/10/24 14:29:38 dkf Exp $ +'\" RCS: @(#) $Id: history.n,v 1.6 2007/10/26 20:11:52 dgp Exp $ '\" .so man.macros .TH history n "" Tcl "Tcl Built-In Commands" @@ -21,9 +21,8 @@ history \- Manipulate the history list .PP The \fBhistory\fR command performs one of several operations related to recently-executed commands recorded in a history list. Each of -these recorded commands is referred to as an -.QW event . -When specifying an event to the \fBhistory\fR command, the following +these recorded commands is referred to as an ``event''. When +specifying an event to the \fBhistory\fR command, the following forms may be used: .IP [1] A number: if positive, it refers to the event with @@ -93,8 +92,7 @@ The current mechanism is more limited, and the old history operations \fBsubstitute\fR and \fBwords\fR have been removed. (As a consolation, the \fBclear\fR operation was added.) .PP -The history option \fBredo\fR results in much simpler -.QW "history revision" . +The history option \fBredo\fR results in much simpler ``history revision''. When this option is invoked then the most recent event is modified to eliminate the history command and replace it with the result of the history command. diff --git a/doc/http.n b/doc/http.n index d88b88d..5457d02 100644 --- a/doc/http.n +++ b/doc/http.n @@ -6,7 +6,7 @@ '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. '\" -'\" RCS: @(#) $Id: http.n,v 1.26 2007/10/24 14:29:38 dkf Exp $ +'\" RCS: @(#) $Id: http.n,v 1.27 2007/10/26 20:11:53 dgp Exp $ '\" .so man.macros .TH "http" n 2.5 http "Tcl Bundled Packages" @@ -89,8 +89,7 @@ flags and values that define the configuration: The Accept header of the request. The default is */*, which means that all types of documents are accepted. Otherwise you can supply a comma-separated list of mime type patterns that you are -willing to receive. For example, -.QW "image/gif, image/jpeg, text/*" . +willing to receive. For example, "image/gif, image/jpeg, text/*". .TP \fB\-proxyhost\fR \fIhostname\fR The name of the proxy host, if any. If this value is the @@ -121,8 +120,7 @@ characters. .TP \fB\-useragent\fR \fIstring\fR The value of the User-Agent header in the HTTP request. The default -is -.QW "\fBTcl http client package 2.5\fR" . +is \fB"Tcl http client package 2.4."\fR .RE .TP \fB::http::geturl\fR \fIurl\fR ?\fIoptions\fR? @@ -342,6 +340,7 @@ set token [::http::geturl https://my.secure.site/] \fB::http::unregister\fR \fIproto\fR This procedure unregisters a protocol handler that was previously registered via \fB::http::register\fR. + .SH "ERRORS" The \fB::http::geturl\fR procedure will raise errors in the following cases: invalid command line options, @@ -386,8 +385,7 @@ If the HTTP transaction completes entirely, then status will be \fBok\fR. However, you should still check the \fB::http::code\fR value to get the HTTP status. The \fB::http::ncode\fR procedure provides just the numeric error (e.g., 200, 404 or 500) while the \fB::http::code\fR -procedure returns a value like -.QW "HTTP 404 File not found" . +procedure returns a value like "HTTP 404 File not found". .TP eof If the server closes the socket without replying, then no error @@ -406,6 +404,7 @@ transaction. If it can read the server's response it will end up with an \fBok\fR status, otherwise it will have an \fBeof\fR status. + .SH "STATE ARRAY" The \fB::http::geturl\fR procedure returns a \fItoken\fR that can be used to get to the state of the HTTP transaction in the form of a Tcl array. @@ -535,7 +534,9 @@ proc httpCopyProgress {args} { flush stderr } .CE + .SH "SEE ALSO" safe(n), socket(n), safesock(n) + .SH KEYWORDS security policy, socket diff --git a/doc/if.n b/doc/if.n index 44bd80d..a77253c 100644 --- a/doc/if.n +++ b/doc/if.n @@ -5,7 +5,7 @@ '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. '\" -'\" RCS: @(#) $Id: if.n,v 1.6 2007/10/24 14:29:38 dkf Exp $ +'\" RCS: @(#) $Id: if.n,v 1.7 2007/10/26 20:11:53 dgp Exp $ '\" .so man.macros .TH if n "" Tcl "Tcl Built-In Commands" @@ -32,8 +32,7 @@ then \fBbody2\fR is executed, and so on. If none of the expressions evaluates to true then \fIbodyN\fR is executed. The \fBthen\fR and \fBelse\fR arguments are optional -.QW noise words -to make the command easier to read. +``noise words'' to make the command easier to read. There may be any number of \fBelseif\fR clauses, including zero. \fIBodyN\fR may also be omitted as long as \fBelse\fR is omitted too. The return value from the command is the result of the body script diff --git a/doc/info.n b/doc/info.n index 54babfb..2b6ca87 100644 --- a/doc/info.n +++ b/doc/info.n @@ -7,7 +7,7 @@ '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. '\" -'\" RCS: @(#) $Id: info.n,v 1.20 2007/10/25 14:07:32 dkf Exp $ +'\" RCS: @(#) $Id: info.n,v 1.21 2007/10/26 20:11:53 dgp Exp $ '\" .so man.macros .TH info n 8.4 Tcl "Tcl Built-In Commands" @@ -23,7 +23,7 @@ info \- Return information about the state of the Tcl interpreter .PP This command provides information about various internals of the Tcl interpreter. -The legal \fIoption\fRs (which may be abbreviated) are: +The legal \fIoption\fR's (which may be abbreviated) are: .TP \fBinfo args \fIprocname\fR Returns a list containing the names of the arguments to procedure @@ -98,16 +98,12 @@ gives a level relative to the current command (0 refers to the current command, i.e., \fBinfo frame\fR itself, -1 to its caller, and so on). .sp This is similar to how \fBinfo level\fR works, except that this -subcommand reports all frames, like \fBsource\fRd scripts, -\fBeval\fRs, \fBuplevel\fRs, etc. +subcommand reports all frames, like \fBsource\fR'd scripts, +\fBeval\fR's, \fBuplevel\fR's, etc. .sp -Note that for nested commands, like -.QW "foo [[bar [[x]]]]" -only -.QW "x" -will be seen by an \fBinfo frame\fR invoked within -.QW "x" . -This is the same as for \fBinfo level\fR and error stack traces. +Note that for nested commands, like "foo [[bar [[x]]]]" only "x" will +be seen by an \fBinfo frame\fR invoked within "x". This is the same as +for \fBinfo level\fR and error stack traces. .sp The result dictionary may contain the keys listed below, with the specified meanings for their values: @@ -317,9 +313,7 @@ If \fIpattern\fR is a qualified name, the resulting list of variable names has each matching namespace variable qualified with the name of its namespace. -Note that a currently-visible variable may not yet -.QW "exist" -if it has not +Note that a currently-visible variable may not yet "exist" if it has not been set (e.g. a variable declared but not set by \fBvariable\fR). .SH EXAMPLE This command prints out a procedure suitable for saving in a Tcl diff --git a/doc/interp.n b/doc/interp.n index c7fbf18..852b84a 100644 --- a/doc/interp.n +++ b/doc/interp.n @@ -5,7 +5,7 @@ '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. '\" -'\" RCS: @(#) $Id: interp.n,v 1.30 2007/10/24 14:29:38 dkf Exp $ +'\" RCS: @(#) $Id: interp.n,v 1.31 2007/10/26 20:11:53 dgp Exp $ '\" .so man.macros .TH interp n 7.6 Tcl "Tcl Built-In Commands" @@ -107,9 +107,7 @@ may be anywhere in the hierarchy of interpreters under the interpreter invoking the command. \fISrcPath\fR and \fIsrcCmd\fR identify the source of the alias. \fISrcPath\fR is a Tcl list whose elements select a particular -interpreter. For example, -.QW "\fBa b\fR" -identifies an interpreter +interpreter. For example, ``\fBa b\fR'' identifies an interpreter \fBb\fR, which is a slave of interpreter \fBa\fR, which is a slave of the invoking interpreter. An empty list specifies the interpreter invoking the command. \fIsrcCmd\fR gives the name of a new @@ -570,10 +568,9 @@ as they would be for any other command invoked in that interpreter. The command procedure for the source command takes its arguments and merges them with the \fItargetCmd\fR and \fIarg\fRs for the alias to create a new array of arguments. If the words -of \fIsrcCmd\fR were -.QW "\fIsrcCmd arg1 arg2 ... argN\fR" , +of \fIsrcCmd\fR were ``\fIsrcCmd arg1 arg2 ... argN\fR'', the new set of words will be -.QW "\fItargetCmd arg arg ... arg arg1 arg2 ... argN\fR" , +``\fItargetCmd arg arg ... arg arg1 arg2 ... argN\fR'', where \fItargetCmd\fR and \fIarg\fRs are the values supplied when the alias was created. \fITargetCmd\fR is then used to locate a command procedure in the target interpreter, and that command procedure diff --git a/doc/join.n b/doc/join.n index 2696295..cdc8df8 100644 --- a/doc/join.n +++ b/doc/join.n @@ -5,7 +5,7 @@ '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. '\" -'\" RCS: @(#) $Id: join.n,v 1.6 2007/10/25 09:25:27 dkf Exp $ +'\" RCS: @(#) $Id: join.n,v 1.7 2007/10/26 20:11:53 dgp Exp $ '\" .so man.macros .TH join n "" Tcl "Tcl Built-In Commands" @@ -16,6 +16,7 @@ join \- Create a string by joining together list elements .SH SYNOPSIS \fBjoin \fIlist \fR?\fIjoinString\fR? .BE + .SH DESCRIPTION .PP The \fIlist\fR argument must be a valid Tcl list. @@ -26,20 +27,20 @@ The \fIjoinString\fR argument defaults to a space character. .SH EXAMPLES Making a comma-separated list: .CS -.ta 2i set data {1 2 3 4 5} \fBjoin\fR $data ", " - \fB\(->\fI 1, 2, 3, 4, 5\fR + \fB=> 1, 2, 3, 4, 5\fR .CE .PP Using \fBjoin\fR to flatten a list by a single level: .CS -.ta 2i set data {1 {2 3} 4 {5 {6 7} 8}} \fBjoin\fR $data - \fB\(->\fI 1 2 3 4 5 {6 7} 8\fR + \fB=> 1 2 3 4 5 {6 7} 8\fR .CE + .SH "SEE ALSO" list(n), lappend(n), split(n) + .SH KEYWORDS element, join, list, separator diff --git a/doc/lappend.n b/doc/lappend.n index d8d669a..7a20649 100644 --- a/doc/lappend.n +++ b/doc/lappend.n @@ -6,7 +6,7 @@ '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. '\" -'\" RCS: @(#) $Id: lappend.n,v 1.12 2007/10/24 14:29:38 dkf Exp $ +'\" RCS: @(#) $Id: lappend.n,v 1.13 2007/10/26 20:11:53 dgp Exp $ '\" .so man.macros .TH lappend n "" Tcl "Tcl Built-In Commands" @@ -28,11 +28,9 @@ given by the \fIvalue\fR arguments. \fBLappend\fR is similar to \fBappend\fR except that the \fIvalue\fRs are appended as list elements rather than raw text. This command provides a relatively efficient way to build up -large lists. For example, -.QW "\fBlappend a $b\fR" -is much more efficient than -.QW "\fBset a [concat $a [list $b]]\fR" , -especially when \fB$a\fR is long. +large lists. For example, ``\fBlappend a $b\fR'' is much +more efficient than ``\fBset a [concat $a [list $b]]\fR'' when +\fB$a\fR is long. .SH EXAMPLE Using \fBlappend\fR to build up a list of numbers. .CS diff --git a/doc/lassign.n b/doc/lassign.n index 4d1c3c8..b01f308 100644 --- a/doc/lassign.n +++ b/doc/lassign.n @@ -5,7 +5,7 @@ '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. '\" -'\" RCS: @(#) $Id: lassign.n,v 1.2 2007/10/25 09:31:52 dkf Exp $ +'\" RCS: @(#) $Id: lassign.n,v 1.3 2007/10/26 20:11:53 dgp Exp $ '\" .so man.macros .TH lassign n 8.5 Tcl "Tcl Built-In Commands" @@ -16,6 +16,7 @@ lassign \- Assign list elements to variables .SH SYNOPSIS \fBlassign \fIlist varName \fR?\fIvarName ...\fR? .BE + .SH DESCRIPTION .PP This command treats the value \fIlist\fR as a list and assigns @@ -28,30 +29,27 @@ unassigned elements is returned. An illustration of how multiple assignment works, and what happens when there are either too few or too many elements. .CS -.ta 2.5i -lassign {a b c} x y z \fB\(->\fI Empty return\fR -puts $x \fB\(->\fI Prints "a"\fR -puts $y \fB\(->\fI Prints "b"\fR -puts $z \fB\(->\fI Prints "c"\fR +lassign {a b c} x y z ;# Empty return +puts $x ;# Prints "a" +puts $y ;# Prints "b" +puts $z ;# Prints "c" -lassign {d e} x y z \fB\(->\fI Empty return\fR -puts $x \fB\(->\fI Prints "d"\fR -puts $y \fB\(->\fI Prints "e"\fR -puts $z \fB\(->\fI Prints ""\fR +lassign {d e} x y z ;# Empty return +puts $x ;# Prints "d" +puts $y ;# Prints "e" +puts $z ;# Prints "" -lassign {f g h i} x y \fB\(->\fI Returns "h i"\fR -puts $x \fB\(->\fI Prints "f"\fR -puts $y \fB\(->\fI Prints "g"\fR +lassign {f g h i} x y ;# Returns "h i" +puts $x ;# Prints "f" +puts $y ;# Prints "g" .CE -.PP The \fBlassign\fR command has other uses. It can be used to create -the analogue of the -.QW shift -command in many shell languages like this: +the analogue of the "shift" command in many shell languages like this: .CS set ::argv [lassign $::argv argumentToReadOff] .CE .SH "SEE ALSO" lindex(n), list(n), lset(n), set(n) + .SH KEYWORDS assign, element, list, multiple, set, variable diff --git a/doc/library.n b/doc/library.n index 83fe0fd..faf9ec8 100644 --- a/doc/library.n +++ b/doc/library.n @@ -5,7 +5,7 @@ '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. '\" -'\" RCS: @(#) $Id: library.n,v 1.19 2007/10/24 14:29:38 dkf Exp $ +'\" RCS: @(#) $Id: library.n,v 1.20 2007/10/26 20:11:53 dgp Exp $ .so man.macros .TH library n "8.0" Tcl "Tcl Built-In Commands" .BS @@ -54,6 +54,7 @@ If the library procedure \fBTcl_Init\fR is invoked from an application's The code in \fBinit.tcl\fR will define the \fBunknown\fR procedure and arrange for the other procedures to be loaded on-demand using the auto-load mechanism defined below. + .SH "COMMAND PROCEDURES" .PP The following procedures are provided in the Tcl library: @@ -136,9 +137,7 @@ definition and the next word of the line is taken as the procedure's name. Procedure definitions that don't appear in this way (e.g. they have spaces before the \fBproc\fR) will not be indexed. If your -script contains -.QW dangerous -code, such as global initialization +script contains "dangerous" code, such as global initialization code or procedure names with special characters like \fB$\fR, \fB*\fR, \fB[\fR or \fB]\fR, you are safer using auto_mkindex_old. .RE @@ -175,9 +174,7 @@ their initialization. They call this procedure to look for their script library in several standard directories. The last component of the name of the library directory is normally \fIbasenameversion\fR -(e.g., tk8.0), but it might be -.QW library -when in the build hierarchies. +(e.g., tk8.0), but it might be "library" when in the build hierarchies. The \fIinitScript\fR file will be sourced into the interpreter once it is found. The directory in which this file is found is stored into the global variable \fIvarName\fR. @@ -233,6 +230,7 @@ Returns the index of the first word boundary before the starting index boundaries before the starting point in the given string. The index returned refers to the second character of the pair that comprises a boundary. + .SH "VARIABLES" .PP The following global variables are defined or used by the procedures in @@ -273,9 +271,7 @@ a default value is used. \fBenv(TCLLIBPATH)\fR If set, then it must contain a valid Tcl list giving directories to search during auto-load operations. Directories must be specified in -Tcl format, using -.QW / -as the path separator, regardless of platform. +Tcl format, using "/" as the path separator, regardless of platform. This variable is only used when initializing the \fBauto_path\fR variable. .TP \fBtcl_nonwordchars\fR @@ -294,7 +290,9 @@ word or not. If the pattern matches a character, the character is considered to be a word character. On Windows platforms, words are comprised of any character that is not a space, tab, or newline. Under Unix, words are comprised of numbers, letters or underscores. + .SH "SEE ALSO" info(n), re_syntax(n) + .SH KEYWORDS auto-exec, auto-load, library, unknown, word, whitespace diff --git a/doc/lindex.n b/doc/lindex.n index f8f1e40..e459a2b 100644 --- a/doc/lindex.n +++ b/doc/lindex.n @@ -6,7 +6,7 @@ '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. '\" -'\" RCS: @(#) $Id: lindex.n,v 1.13 2007/10/25 09:25:27 dkf Exp $ +'\" RCS: @(#) $Id: lindex.n,v 1.14 2007/10/26 20:11:53 dgp Exp $ '\" .so man.macros .TH lindex n 8.4 Tcl "Tcl Built-In Commands" @@ -67,20 +67,17 @@ is synonymous with lindex [lindex [lindex $a 1] 2] 3 .CE .SH EXAMPLES -.PP -Demonstrating how the index list system works. .CS -.ta 5i -\fBlindex\fR {a b c} \fB\(->\fI a b c\fR -\fBlindex\fR {a b c} {} \fB\(->\fI a b c\fR -\fBlindex\fR {a b c} 0 \fB\(->\fI a\fR -\fBlindex\fR {a b c} 2 \fB\(->\fI c\fR -\fBlindex\fR {a b c} end \fB\(->\fI c\fR -\fBlindex\fR {a b c} end-1 \fB\(->\fI b\fR -\fBlindex\fR {{a b c} {d e f} {g h i}} 2 1 \fB\(->\fI h\fR -\fBlindex\fR {{a b c} {d e f} {g h i}} {2 1} \fB\(->\fI h\fR -\fBlindex\fR {{{a b} {c d}} {{e f} {g h}}} 1 1 0 \fB\(->\fI g\fR -\fBlindex\fR {{{a b} {c d}} {{e f} {g h}}} {1 1 0} \fB\(->\fI g\fR +\fBlindex\fR {a b c} \fI=> a b c\fR +\fBlindex\fR {a b c} {} \fI=> a b c\fR +\fBlindex\fR {a b c} 0 \fI=> a\fR +\fBlindex\fR {a b c} 2 \fI=> c\fR +\fBlindex\fR {a b c} end \fI=> c\fR +\fBlindex\fR {a b c} end-1 \fI=> b\fR +\fBlindex\fR {{a b c} {d e f} {g h i}} 2 1 \fI=> h\fR +\fBlindex\fR {{a b c} {d e f} {g h i}} {2 1} \fI=> h\fR +\fBlindex\fR {{{a b} {c d}} {{e f} {g h}}} 1 1 0 \fI=> g\fR +\fBlindex\fR {{{a b} {c d}} {{e f} {g h}}} {1 1 0} \fI=> g\fR .CE .SH "SEE ALSO" list(n), lappend(n), linsert(n), llength(n), lsearch(n), @@ -88,5 +85,6 @@ lset(n), lsort(n), lrange(n), lreplace(n), .VS 8.5 string(n) .VE + .SH KEYWORDS element, index, list diff --git a/doc/llength.n b/doc/llength.n index 47884a3..59fa400 100644 --- a/doc/llength.n +++ b/doc/llength.n @@ -6,7 +6,7 @@ '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. '\" -'\" RCS: @(#) $Id: llength.n,v 1.11 2007/10/24 14:29:38 dkf Exp $ +'\" RCS: @(#) $Id: llength.n,v 1.12 2007/10/26 20:11:53 dgp Exp $ '\" .so man.macros .TH llength n "" Tcl "Tcl Built-In Commands" @@ -17,10 +17,12 @@ llength \- Count the number of elements in a list .SH SYNOPSIS \fBllength \fIlist\fR .BE + .SH DESCRIPTION .PP Treats \fIlist\fR as a list and returns a decimal string giving the number of elements in it. + .SH EXAMPLES The result is the number of elements: .CS @@ -46,8 +48,10 @@ An empty list is not necessarily an empty string: % set var { }; puts "[string length $var],[\fBllength\fR $var]" 1,0 .CE + .SH "SEE ALSO" list(n), lappend(n), lindex(n), linsert(n), lsearch(n), lset(n), lsort(n), lrange(n), lreplace(n) + .SH KEYWORDS element, list, length diff --git a/doc/load.n b/doc/load.n index a9e0c80..c3f8862 100644 --- a/doc/load.n +++ b/doc/load.n @@ -4,7 +4,7 @@ '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. '\" -'\" RCS: @(#) $Id: load.n,v 1.18 2007/10/24 14:29:38 dkf Exp $ +'\" RCS: @(#) $Id: load.n,v 1.19 2007/10/26 20:11:53 dgp Exp $ '\" .so man.macros .TH load n 7.5 Tcl "Tcl Built-In Commands" @@ -110,15 +110,12 @@ the package, Tcl picks the file that was loaded first. .TP \fBWindows\fR\0\0\0\0\0 . -When a load fails with a -.QW "library not found" -error, it is also possible that a dependent library was not found. To -see the dependent libraries, type -.QW "dumpbin -imports " -in a DOS console to see what the library must import. -When loading a DLL in the current directory, Windows will ignore -.QW ./ -as a path specifier and use a search heuristic to find the DLL instead. +When a load fails with "library not found" error, it is also possible +that a dependent library was not found. To see the dependent libraries, +type ``dumpbin -imports '' in a DOS console to see what the +library must import. +When loading a DLL in the current directory, Windows will ignore ``./'' as +a path specifier and use a search heuristic to find the DLL instead. To avoid this, load the DLL with: .CS \fBload\fR [file join [pwd] mylib.DLL] diff --git a/doc/lrange.n b/doc/lrange.n index e1ce35a..b2fb3b8 100644 --- a/doc/lrange.n +++ b/doc/lrange.n @@ -6,7 +6,7 @@ '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. '\" -'\" RCS: @(#) $Id: lrange.n,v 1.13 2007/10/24 14:29:38 dkf Exp $ +'\" RCS: @(#) $Id: lrange.n,v 1.14 2007/10/26 20:11:53 dgp Exp $ '\" .so man.macros .TH lrange n 7.4 Tcl "Tcl Built-In Commands" @@ -34,14 +34,10 @@ If \fIlast\fR is greater than or equal to the number of elements in the list, then it is treated as if it were \fBend\fR. If \fIfirst\fR is greater than \fIlast\fR then an empty string is returned. -Note: -.QW "\fBlrange \fIlist first first\fR" -does not always produce the same result as -.QW "\fBlindex \fIlist first\fR" -(although it often does +Note: ``\fBlrange \fIlist first first\fR'' does not always produce the +same result as ``\fBlindex \fIlist first\fR'' (although it often does for simple fields that aren't enclosed in braces); it does, however, -produce exactly the same results as -.QW "\fBlist [lindex \fIlist first\fB]\fR" . +produce exactly the same results as ``\fBlist [lindex \fIlist first\fB]\fR'' .SH EXAMPLES Selecting the first two elements: .CS diff --git a/doc/lrepeat.n b/doc/lrepeat.n index 4b1ebce..fdd1388 100644 --- a/doc/lrepeat.n +++ b/doc/lrepeat.n @@ -4,7 +4,7 @@ '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. '\" -'\" RCS: @(#) $Id: lrepeat.n,v 1.3 2007/10/25 09:25:27 dkf Exp $ +'\" RCS: @(#) $Id: lrepeat.n,v 1.4 2007/10/26 20:11:53 dgp Exp $ '\" .so man.macros .TH lrepeat n 8.5 Tcl "Tcl Built-In Commands" @@ -17,23 +17,18 @@ lrepeat \- Build a list by repeating elements .BE .SH DESCRIPTION .PP -The \fBlrepeat\fR command creates a list of size \fInumber\fR \(mu \fInumber -of elements\fR by repeating \fInumber\fR times the sequence of elements -\fIelement1 element2 ...\fR. The \fInumber\fR must be a positive integer, and -each \fIelementN\fR can be any Tcl value. -.PP -Note that -.QW "\fBlrepeat 1 arg ...\fR" -is identical to -.QW "\fBlist arg ...\fR" , -though the \fIarg\fR is required with \fBlrepeat\fR. +The \fBlrepeat\fR command creates a list of size \fInumber * number of +elements\fR by repeating \fInumber\fR times the sequence of elements +\fIelement1 element2 ...\fR. \fInumber\fR must be a positive integer, +\fIelementn\fR can be any Tcl value. Note that \fBlrepeat 1 arg ...\fR +is identical to \fBlist arg ...\fR, though the \fIarg\fR is required +with \fBlrepeat\fR. .SH EXAMPLES .CS -.ta 3i -lrepeat 3 a \fB\(->\fI a a a\fR -lrepeat 3 [lrepeat 3 0] \fB\(->\fI {0 0 0} {0 0 0} {0 0 0}\fR -lrepeat 3 a b c \fB\(->\fI a b c a b c a b c\fR -lrepeat 3 [lrepeat 2 a] b c \fB\(->\fI {a a} b c {a a} b c {a a} b c\fR +lrepeat 3 a => a a a +lrepeat 3 [lrepeat 3 0] => {0 0 0} {0 0 0} {0 0 0} +lrepeat 3 a b c => a b c a b c a b c +lrepeat 3 [lrepeat 2 a] b c => {a a} b c {a a} b c {a a} b c .CE .SH "SEE ALSO" list(n), lappend(n), linsert(n), llength(n), lset(n) diff --git a/doc/lreplace.n b/doc/lreplace.n index 652a9a9..1a43cba 100644 --- a/doc/lreplace.n +++ b/doc/lreplace.n @@ -6,7 +6,7 @@ '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. '\" -'\" RCS: @(#) $Id: lreplace.n,v 1.14 2007/10/24 14:29:38 dkf Exp $ +'\" RCS: @(#) $Id: lreplace.n,v 1.15 2007/10/26 20:11:53 dgp Exp $ '\" .so man.macros .TH lreplace n 7.4 Tcl "Tcl Built-In Commands" @@ -17,6 +17,7 @@ lreplace \- Replace elements in a list with new elements .SH SYNOPSIS \fBlreplace \fIlist first last \fR?\fIelement element ...\fR? .BE + .SH DESCRIPTION .PP \fBlreplace\fR returns a new list formed by replacing one or more elements of @@ -32,16 +33,16 @@ end of the list. list, and \fBend\fR refers to the last element of the list. If \fIlist\fR is empty, then \fIfirst\fR and \fIlast\fR are ignored. .VE -.PP + If \fIfirst\fR is less than zero, it is considered to refer to the first element of the list. For non-empty lists, the element indicated by \fIfirst\fR must exist. -.PP + If \fIlast\fR is less than zero but greater than \fIfirst\fR, then any specified elements will be prepended to the list. If \fIlast\fR is less than \fIfirst\fR then no elements are deleted; the new elements are simply inserted before \fIfirst\fR. -.PP + The \fIelement\fR arguments specify zero or more new arguments to be added to the list in place of those that were deleted. Each \fIelement\fR argument will become a separate element of @@ -68,11 +69,14 @@ a b c d e % set var [\fBlreplace\fR $var end end] a b c d .CE + .SH "SEE ALSO" list(n), lappend(n), lindex(n), linsert(n), llength(n), lsearch(n), lset(n), lrange(n), lsort(n), .VS 8.5 string(n) .VE + + .SH KEYWORDS element, list, replace diff --git a/doc/lreverse.n b/doc/lreverse.n index e0d53c8..b1cd594 100644 --- a/doc/lreverse.n +++ b/doc/lreverse.n @@ -1,15 +1,15 @@ -.\" -*- nroff -*- -.\" Copyright (c) 2006 by Donal K. Fellows. All rights reserved. -.\" -.\" See the file "license.terms" for information on usage and redistribution -.\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. -.\" -.\" RCS: @(#) $Id: lreverse.n,v 1.3 2007/10/25 09:25:27 dkf Exp $ -.\" +'\" -*- nroff -*- +'\" Copyright (c) 2006 by Donal K. Fellows. All rights reserved. +'\" +'\" See the file "license.terms" for information on usage and redistribution +'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. +'\" +'\" RCS: @(#) $Id: lreverse.n,v 1.4 2007/10/26 20:11:53 dgp Exp $ +'\" .so man.macros .TH lreverse n 8.5 Tcl "Tcl Built-In Commands" .BS -.\" Note: do not modify the .SH NAME line immediately below! +'\" Note: do not modify the .SH NAME line immediately below! .SH NAME lreverse \- Reverse the order of a list .SH SYNOPSIS @@ -21,11 +21,11 @@ The \fBlreverse\fR command returns a list that has the same elements as its input list, \fIlist\fR, except with the elements in the reverse order. .SH EXAMPLES .CS -.ta 3i -\fBlreverse\fR {a a b c} \fB\(->\fI c b a a\fR -\fBlreverse\fR {a b {c d} e f} \fB\(->\fI f e {c d} b a\fR +\fBlreverse\fR {a a b c} => c b a a +\fBlreverse\fR {a b {c d} e f} => f e {c d} b a .CE .SH "SEE ALSO" list(n), lsearch(n), lsort(n) + .SH KEYWORDS element, list, reverse diff --git a/doc/lsearch.n b/doc/lsearch.n index 1d382f3..de37270 100644 --- a/doc/lsearch.n +++ b/doc/lsearch.n @@ -7,7 +7,7 @@ '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. '\" -'\" RCS: @(#) $Id: lsearch.n,v 1.28 2007/10/25 09:25:27 dkf Exp $ +'\" RCS: @(#) $Id: lsearch.n,v 1.29 2007/10/26 20:11:53 dgp Exp $ '\" .so man.macros .TH lsearch n 8.5 Tcl "Tcl Built-In Commands" @@ -18,6 +18,7 @@ lsearch \- See if a list contains a particular element .SH SYNOPSIS \fBlsearch \fR?\fIoptions\fR? \fIlist pattern\fR .BE + .SH DESCRIPTION .PP This command searches the elements of \fIlist\fR to see if one @@ -33,23 +34,19 @@ is \fB\-glob\fR. If more than one matching style is specified, the last matching style given takes precedence. .TP \fB\-exact\fR -. \fIPattern\fR is a literal string that is compared for exact equality against each list element. .TP \fB\-glob\fR -. \fIPattern\fR is a glob-style pattern which is matched against each list element using the same rules as the \fBstring match\fR command. .TP \fB\-regexp\fR -. \fIPattern\fR is treated as a regular expression and matched against each list element using the rules described in the \fBre_syntax\fR reference page. .TP \fB\-sorted\fR -. The list elements are in sorted order. If this option is specified, \fBlsearch\fR will use a more efficient searching algorithm to search \fIlist\fR. If no other options are specified, \fIlist\fR is assumed @@ -68,18 +65,15 @@ indices will be in numeric order. If values are returned, the order of the values will be the order of those values within the input \fIlist\fR. .TP \fB\-inline\fR -. The matching value is returned instead of its index (or an empty string if no value matches.) If \fB\-all\fR is also specified, then the result of the command is the list of all values that matched. .TP \fB\-not\fR -. This negates the sense of the match, returning the index of the first non-matching value in the list. .TP \fB\-start\fR\0\fIindex\fR -. The list is searched starting at position \fIindex\fR. .VS 8.5 The interpretation of the \fIindex\fR value is the same as @@ -93,12 +87,10 @@ and \fB\-sorted\fR options. If more than one is specified, the last one takes precedence. The default is \fB\-ascii\fR. .TP \fB\-ascii\fR -. The list elements are to be examined as Unicode strings (the name is for backward-compatibility reasons.) .TP \fB\-dictionary\fR -. The list elements are to be compared using dictionary-style comparisons (see \fBlsort\fR for a fuller description). Note that this only makes a meaningful difference from the \fB\-ascii\fR option when @@ -106,19 +98,16 @@ the \fB\-sorted\fR option is given, because values are only dictionary-equal when exactly equal. .TP \fB\-integer\fR -. The list elements are to be compared as integers. .VS 8.5 .TP \fB\-nocase\fR -. Causes comparisons to be handled in a case-insensitive manner. Has no effect if combined with the \fB\-dictionary\fR, \fB\-integer\fR, or \fB\-real\fR options. .VE 8.5 .TP \fB\-real\fR -. The list elements are to be compared as floating-point values. .SS "SORTED LIST OPTIONS" These options (only meaningful with the \fB\-sorted\fR option) specify @@ -126,12 +115,10 @@ how the list is sorted. If more than one is given, the last one takes precedence. The default option is \fB\-increasing\fR. .TP \fB\-decreasing\fR -. The list elements are sorted in decreasing order. This option is only meaningful when used with \fB\-sorted\fR. .TP \fB\-increasing\fR -. The list elements are sorted in increasing order. This option is only meaningful when used with \fB\-sorted\fR. .SS "NESTED LIST OPTIONS" @@ -140,14 +127,12 @@ These options are used to search lists of lists. They may be used with any other options. .TP \fB\-index\fR\0\fIindexList\fR -. This option is designed for use when searching within nested lists. The \fIindexList\fR argument gives a path of indices (much as might be used with the \fBlindex\fR or \fBlset\fR commands) within each element to allow the location of the term being matched against. .TP \fB\-subindices\fR -. If this option is given, the index result from this command (or every index result when \fB\-all\fR is also specified) will be a complete path (suitable for use with \fBlindex\fR or \fBlset\fR) within the @@ -157,55 +142,52 @@ overall list to the term found. This option has no effect unless the .SH EXAMPLES Basic searching: .CS -.ta 2i \fBlsearch\fR {a b c d e} c - \fB\(->\fI 2\fR + => 2 \fBlsearch\fR -all {a b c a b c} c - \fB\(->\fI 2 5\fR + => 2 5 .CE -.PP + Using \fBlsearch\fR to filter lists: .CS -.ta 2i \fBlsearch\fR -inline {a20 b35 c47} b* - \fB\(->\fI b35\fR + => b35 \fBlsearch\fR -inline -not {a20 b35 c47} b* - \fB\(->\fI a20\fR + => a20 \fBlsearch\fR -all -inline -not {a20 b35 c47} b* - \fB\(->\fI a20 c47\fR + => a20 c47 \fBlsearch\fR -all -not {a20 b35 c47} b* - \fB\(->\fI 0 2\fR + => 0 2 .CE -This can even do a -.QW set-like -removal operation: +This can even do a "set-like" removal operation: .CS -.ta 2i \fBlsearch\fR -all -inline -not -exact {a b c a d e a f g a} a - \fB\(->\fI b c d e f g\fR + => b c d e f g .CE -.PP + Searching may start part-way through the list: .CS -.ta 2i \fBlsearch\fR -start 3 {a b c a b c} c - \fB\(->\fI 5\fR + => 5 .CE -.PP + It is also possible to search inside elements: .CS -.ta 2i \fBlsearch\fR -index 1 -all -inline {{a abc} {b bcd} {c cde}} *bc* - \fB\(->\fI {a abc} {b bcd}\fR + => {a abc} {b bcd} .CE + .SH "SEE ALSO" foreach(n), list(n), lappend(n), lindex(n), linsert(n), llength(n), lset(n), lsort(n), lrange(n), lreplace(n), .VS 8.5 string(n) .VE + + .SH KEYWORDS list, match, pattern, regular expression, search, string -.\" Local Variables: -.\" mode: nroff -.\" End: + +'\" Local Variables: +'\" mode: nroff +'\" End: diff --git a/doc/lset.n b/doc/lset.n index 7b7889f..30822fb 100755 --- a/doc/lset.n +++ b/doc/lset.n @@ -4,7 +4,7 @@ '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. '\" -'\" RCS: @(#) $Id: lset.n,v 1.11 2007/10/25 09:25:27 dkf Exp $ +'\" RCS: @(#) $Id: lset.n,v 1.12 2007/10/26 20:11:53 dgp Exp $ '\" .so man.macros .TH lset n 8.4 Tcl "Tcl Built-In Commands" @@ -79,37 +79,33 @@ of a list. If an index is outside the permitted range, an error is reported. .SH EXAMPLES In each of these examples, the initial value of \fIx\fR is: .CS -.ta 2i set x [list [list a b c] [list d e f] [list g h i]] - \fB\(->\fR {a b c} {d e f} {g h i} + => {a b c} {d e f} {g h i} .CE The indicated return value also becomes the new value of \fIx\fR (except in the last case, which is an error which leaves the value of \fIx\fR unchanged.) .CS -.ta 2i -lset x {j k l} \fB\(->\fR j k l -lset x {} {j k l} \fB\(->\fR j k l -lset x 0 j \fB\(->\fR j {d e f} {g h i} -lset x 2 j \fB\(->\fR {a b c} {d e f} j -lset x end j \fB\(->\fR {a b c} {d e f} j -lset x end-1 j \fB\(->\fR {a b c} j {g h i} -lset x 2 1 j \fB\(->\fR {a b c} {d e f} {g j i} -lset x {2 1} j \fB\(->\fR {a b c} {d e f} {g j i} -lset x {2 3} j \fB\(->\fR \fIlist index out of range\fR +lset x {j k l} => j k l +lset x {} {j k l} => j k l +lset x 0 j => j {d e f} {g h i} +lset x 2 j => {a b c} {d e f} j +lset x end j => {a b c} {d e f} j +lset x end-1 j => {a b c} j {g h i} +lset x 2 1 j => {a b c} {d e f} {g j i} +lset x {2 1} j => {a b c} {d e f} {g j i} +lset x {2 3} j => \fIlist index out of range\fR .CE In the following examples, the initial value of \fIx\fR is: .CS -.ta 2i set x [list [list [list a b] [list c d]] \e [list [list e f] [list g h]]] - \fB\(->\fR {{a b} {c d}} {{e f} {g h}} + => {{a b} {c d}} {{e f} {g h}} .CE The indicated return value also becomes the new value of \fIx\fR. .CS -.ta 2i -lset x 1 1 0 j \fB\(->\fR {{a b} {c d}} {{e f} {j h}} -lset x {1 1 0} j \fB\(->\fR {{a b} {c d}} {{e f} {j h}} +lset x 1 1 0 j => {{a b} {c d}} {{e f} {j h}} +lset x {1 1 0} j => {{a b} {c d}} {{e f} {j h}} .CE .SH "SEE ALSO" list(n), lappend(n), lindex(n), linsert(n), llength(n), lsearch(n), @@ -117,5 +113,7 @@ lsort(n), lrange(n), lreplace(n), .VS 8.5 string(n) .VE + + .SH KEYWORDS element, index, list, replace, set diff --git a/doc/lsort.n b/doc/lsort.n index 6fc96ae..c2c1be8 100644 --- a/doc/lsort.n +++ b/doc/lsort.n @@ -7,7 +7,7 @@ '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. '\" -'\" RCS: @(#) $Id: lsort.n,v 1.23 2007/10/24 14:29:38 dkf Exp $ +'\" RCS: @(#) $Id: lsort.n,v 1.24 2007/10/26 20:11:53 dgp Exp $ '\" .so man.macros .TH lsort n 8.5 Tcl "Tcl Built-In Commands" @@ -59,14 +59,11 @@ be considered less than, equal to, or greater than the second, respectively. .TP 20 \fB\-increasing\fR -Sort the list in increasing order (i.e. -.QW smallest -items first). This is the default. +Sort the list in increasing order (``smallest'' items first). +This is the default. .TP 20 \fB\-decreasing\fR -Sort the list in decreasing order (i.e. -.QW largest -items first). +Sort the list in decreasing order (``largest'' items first). .TP 20 \fB\-indices\fR .VS "8.5 (TIP#217)" diff --git a/doc/mathfunc.n b/doc/mathfunc.n index 054e47d..53b3747 100644 --- a/doc/mathfunc.n +++ b/doc/mathfunc.n @@ -6,7 +6,7 @@ '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. '\" -'\" RCS: @(#) $Id: mathfunc.n,v 1.14 2007/10/25 14:07:32 dkf Exp $ +'\" RCS: @(#) $Id: mathfunc.n,v 1.15 2007/10/26 20:11:53 dgp Exp $ '\" .so man.macros .TH mathfunc n 8.5 Tcl "Tcl Mathematical Functions" @@ -85,13 +85,9 @@ package require \fBTcl 8.5\fR .SH "DESCRIPTION" .PP The \fBexpr\fR command handles mathematical functions of the form -.QW \fBsin($x)\fR -or -.QW \fBatan2($y,$x)\fR -by converting them to calls of the form -.QW "\fB[tcl::mathfunc::sin [expr {$x}]]\fR" -or -.QW "\fB[tcl::mathfunc::atan2 [expr {$y}] [expr {$x}]]\fR" . +\fBsin($x)\fR or \fBatan2($y,$x)\fR by converting them to calls of the +form \fB[tcl::mathfunc::sin [expr {$x}]]\fR or +\fB[tcl::mathfunc::atan2 [expr {$y}] [expr {$x}]]\fR. A number of math functions are available by default within the namespace \fB::tcl::mathfunc\fR; these functions are also available for code apart from \fBexpr\fR, by invoking the given commands @@ -113,59 +109,46 @@ of which work solely with floating-point numbers unless otherwise noted: .PP .TP \fBabs(\fIarg\fB)\fR -. Returns the absolute value of \fIarg\fR. \fIArg\fR may be either integer or floating-point, and the result is returned in the same form. .TP \fBacos(\fIarg\fB)\fR -. Returns the arc cosine of \fIarg\fR, in the range [\fI0\fR,\fIpi\fR] radians. \fIArg\fR should be in the range [\fI-1\fR,\fI1\fR]. .TP \fBasin(\fIarg\fB)\fR -. Returns the arc sine of \fIarg\fR, in the range [\fI-pi/2\fR,\fIpi/2\fR] radians. \fIArg\fR should be in the range [\fI-1\fR,\fI1\fR]. .TP \fBatan(\fIarg\fB)\fR -. Returns the arc tangent of \fIarg\fR, in the range [\fI-pi/2\fR,\fIpi/2\fR] radians. .TP \fBatan2(\fIy, x\fB)\fR -. Returns the arc tangent of \fIy\fR/\fIx\fR, in the range [\fI-pi\fR,\fIpi\fR] radians. \fIx\fR and \fIy\fR cannot both be 0. If \fIx\fR is greater than \fI0\fR, this is equivalent to \fBatan(\fIy/x\fB)\fR. .TP \fBbool(\fIarg\fB)\fR -. Accepts any numeric value, or any string acceptable to \fBstring is boolean\fR, and returns the corresponding boolean value \fB0\fR or \fB1\fR. Non-zero numbers are true. Other numbers are false. Non-numeric strings produce boolean value in -agreement with -.QW "\fBstring is true\fR" -and -.QW "\fBstring is false\fR" . +agreement with \fBstring is true\fR and \fBstring is false\fR. .TP \fBceil(\fIarg\fB)\fR -. Returns the smallest integral floating-point value (i.e. with a zero fractional part) not less than \fIarg\fR. The argument may be any numeric value. .TP \fBcos(\fIarg\fB)\fR -. Returns the cosine of \fIarg\fR, measured in radians. .TP \fBcosh(\fIarg\fB)\fR -. Returns the hyperbolic cosine of \fIarg\fR. If the result would cause an overflow, an error is returned. .TP \fBdouble(\fIarg\fB)\fR -. The argument may be any numeric value, If \fIarg\fR is a floating-point value, returns \fIarg\fR, otherwise converts \fIarg\fR to floating-point and returns the converted value. May return @@ -181,28 +164,23 @@ truncate their range to fit in particular storage widths. .VE 8.5 .TP \fBexp(\fIarg\fB)\fR -. Returns the exponential of \fIarg\fR, defined as \fIe\fR**\fIarg\fR. If the result would cause an overflow, an error is returned. .TP \fBfloor(\fIarg\fB)\fR -. Returns the largest integral floating-point value (i.e. with a zero fractional part) not greater than \fIarg\fR. The argument may be any numeric value. .TP \fBfmod(\fIx, y\fB)\fR -. Returns the floating-point remainder of the division of \fIx\fR by \fIy\fR. If \fIy\fR is 0, an error is returned. .TP \fBhypot(\fIx, y\fB)\fR -. Computes the length of the hypotenuse of a right-angled triangle -.QW "\fBsqrt(\fIx\fR*\fIx\fR+\fIy\fR*\fIy\fB)\fR" . +\fBsqrt(\fIx\fR*\fIx\fR+\fIy\fR*\fIy\fB)\fR. .TP \fBint(\fIarg\fB)\fR -. The argument may be any numeric value. The integer part of \fIarg\fR is determined, and then the low order bits of that integer value up to the machine word size are returned as an integer value. For reference, @@ -210,39 +188,32 @@ the number of bytes in the machine word are stored in \fBtcl_platform(wordSize)\fR. .TP \fBisqrt(\fIarg\fB)\fR -. Computes the integer part of the square root of \fIarg\fR. \fIArg\fR must be a positive value, either an integer or a floating point number. Unlike \fBsqrt\fR, which is limited to the precision of a floating point number, \fIisqrt\fR will return a result of arbitrary precision. .TP \fBlog(\fIarg\fB)\fR -. Returns the natural logarithm of \fIarg\fR. \fIArg\fR must be a positive value. .TP \fBlog10(\fIarg\fB)\fR -. Returns the base 10 logarithm of \fIarg\fR. \fIArg\fR must be a positive value. .TP \fBmax(\fIarg\fB, \fI...\fB)\fR -. Accepts one or more numeric arguments. Returns the one argument with the greatest value. .TP \fBmin(\fIarg\fB, \fI...\fB)\fR -. Accepts one or more numeric arguments. Returns the one argument with the least value. .TP \fBpow(\fIx, y\fB)\fR -. Computes the value of \fIx\fR raised to the power \fIy\fR. If \fIx\fR is negative, \fIy\fR must be an integer value. .TP \fBrand()\fR -. Returns a pseudo-random floating-point value in the range (\fI0\fR,\fI1\fR). The generator algorithm is a simple linear congruential generator that is not cryptographically secure. Each result from \fBrand\fR completely @@ -252,42 +223,34 @@ one-time passwords. The seed of the generator is initialized from the internal clock of the machine or may be set with the \fBsrand\fR function. .TP \fBround(\fIarg\fB)\fR -. If \fIarg\fR is an integer value, returns \fIarg\fR, otherwise converts \fIarg\fR to integer by rounding and returns the converted value. .TP \fBsin(\fIarg\fB)\fR -. Returns the sine of \fIarg\fR, measured in radians. .TP \fBsinh(\fIarg\fB)\fR -. Returns the hyperbolic sine of \fIarg\fR. If the result would cause an overflow, an error is returned. .TP \fBsqrt(\fIarg\fB)\fR -. The argument may be any non-negative numeric value. Returns a floating-point value that is the square root of \fIarg\fR. May return \fBInf\fR when the argument is a numeric value that exceeds the square of the maximum value of the floating-point range. .TP \fBsrand(\fIarg\fB)\fR -. The \fIarg\fR, which must be an integer, is used to reset the seed for the random number generator of \fBrand\fR. Returns the first random number (see \fBrand()\fR) from that seed. Each interpreter has its own seed. .TP \fBtan(\fIarg\fB)\fR -. Returns the tangent of \fIarg\fR, measured in radians. .TP \fBtanh(\fIarg\fB)\fR -. Returns the hyperbolic tangent of \fIarg\fR. .TP \fBwide(\fIarg\fB)\fR -. The argument may be any numeric value. The integer part of \fIarg\fR is determined, and then the low order 64 bits of that integer value are returned as an integer value. @@ -302,8 +265,8 @@ for new implementations. .SH "SEE ALSO" expr(n), namespace(n) .SH "COPYRIGHT" -.nf -Copyright \(co 1993 The Regents of the University of California. -Copyright \(co 1994-2000 Sun Microsystems Incorporated. -Copyright \(co 2005, 2006 by Kevin B. Kenny . -.fi +Copyright (c) 1993 The Regents of the University of California. +.br +Copyright (c) 1994-2000 Sun Microsystems Incorporated. +.br +Copyright (c) 2005, 2006 by Kevin B. Kenny . diff --git a/doc/mathop.n b/doc/mathop.n index fd7c673..6d55e02 100644 --- a/doc/mathop.n +++ b/doc/mathop.n @@ -4,7 +4,7 @@ .\" See the file "license.terms" for information on usage and redistribution .\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. .\" -.\" RCS: @(#) $Id: mathop.n,v 1.5 2007/10/25 14:07:32 dkf Exp $ +.\" RCS: @(#) $Id: mathop.n,v 1.6 2007/10/26 20:11:53 dgp Exp $ .\" .so man.macros .TH mathop n 8.5 Tcl "Tcl Mathematical Operator Commands" @@ -125,10 +125,7 @@ Each \fInumber\fR must have an integral value. . Returns the result of raising each value to the power of the result of recursively operating on the result of processing the following arguments, so -.QW "\fB** 2 3 4\fR" -is the same as -.QW "\fB** 2 [** 3 4]\fR" . -Each \fInumber\fR may be +\fB** 2 3 4\fR is the same as \fB** 2 [** 3 4]\fR. Each \fInumber\fR may be any numeric value, though the second number must not be fractional if the first is negative. If no arguments are given, the result will be one, and if only one argument is given, the result will be that argument. diff --git a/doc/memory.n b/doc/memory.n index 0c2cd7b..05d107a 100644 --- a/doc/memory.n +++ b/doc/memory.n @@ -3,7 +3,7 @@ '\" Copyright (c) 2000 by Scriptics Corporation. '\" All rights reserved. '\" -'\" RCS: @(#) $Id: memory.n,v 1.7 2007/10/25 14:07:32 dkf Exp $ +'\" RCS: @(#) $Id: memory.n,v 1.8 2007/10/26 20:11:53 dgp Exp $ '\" .so man.macros .TH memory n 8.1 Tcl "Tcl Built-In Commands" @@ -13,6 +13,7 @@ memory \- Control Tcl memory debugging capabilities .SH SYNOPSIS \fBmemory \fIoption \fR?\fIarg arg ...\fR? .BE + .SH DESCRIPTION .PP The \fBmemory\fR command gives the Tcl developer control of Tcl's memory @@ -22,11 +23,9 @@ memory debugging enabled (when \fBTCL_MEM_DEBUG\fR is defined at compile time), and after \fBTcl_InitMemory\fR has been called. .TP \fBmemory active\fR \fIfile\fR -. Write a list of all currently allocated memory to the specified \fIfile\fR. .TP \fBmemory break_on_malloc\fR \fIcount\fR -. After the \fIcount\fR allocations have been performed, \fBckalloc\fR outputs a message to this effect and that it is now attempting to enter the C debugger. Tcl will then issue a \fISIGINT\fR signal against itself. @@ -34,26 +33,22 @@ If you are running Tcl under a C debugger, it should then enter the debugger command mode. .TP \fBmemory info\fR -. Returns a report containing the total allocations and frees since Tcl began, the current packets allocated (the current number of calls to \fBckalloc\fR not met by a corresponding call to \fBckfree\fR), the current bytes allocated, and the maximum number of packets and bytes allocated. .TP -\fBmemory init \fR[\fBon\fR|\fBoff\fR] -. +\fB memory init [on|off]\fR Turn on or off the pre-initialization of all allocated memory with bogus bytes. Useful for detecting the use of uninitialized values. .TP \fBmemory onexit\fR \fIfile\fR -. Causes a list of all allocated memory to be written to the specified \fIfile\fR during the finalization of Tcl's memory subsystem. Useful for checking that memory is properly cleaned up during process exit. .TP \fBmemory tag\fR \fIstring\fR -. Each packet of memory allocated by \fBckalloc\fR can have associated with it a string-valued tag. In the lists of allocated memory generated by \fBmemory active\fR and \fBmemory onexit\fR, the tag for each packet @@ -61,8 +56,8 @@ is printed along with other information about the packet. The \fBmemory tag\fR command sets the tag value for subsequent calls to \fBckalloc\fR to be \fIstring\fR. .TP -\fBmemory trace \fR[\fBon\fR|\fBoff\fR] -. +\fBmemory trace [on|off]\fR +.br Turns memory tracing on or off. When memory tracing is on, every call to \fBckalloc\fR causes a line of trace information to be written to \fIstderr\fR, consisting of the word \fIckalloc\fR, followed by the @@ -76,11 +71,8 @@ Calls to \fBckfree\fR are traced in the same manner. .RE .TP \fBmemory trace_on_at_malloc\fR \fIcount\fR -. -Enable memory tracing after \fIcount\fR \fBckalloc\fRs have been performed. -For example, if you enter -.QW "\fBmemory trace_on_at_malloc 100\fR" , -. +Enable memory tracing after \fIcount\fR \fBckalloc\fR's have been performed. +For example, if you enter \fBmemory trace_on_at_malloc 100\fR, after the 100th call to \fBckalloc\fR, memory trace information will begin being displayed for all allocations and frees. Since there can be a lot of memory activity before a problem occurs, judicious use of this option @@ -89,8 +81,7 @@ produced), if you can identify a number of allocations that occur before the problem sets in. The current number of memory allocations that have occurred since Tcl started is printed on a guard zone failure. .TP -\fBmemory validate \fR[\fBon\fR|\fBoff\fR] -. +\fBmemory validate [on|off]\fR Turns memory validation on or off. When memory validation is enabled, on every call to \fBckalloc\fR or \fBckfree\fR, the guard zones are checked for every piece of memory currently in existence that was @@ -101,8 +92,9 @@ overwrite can be detected on the first call to \fBckalloc\fR or \fBckfree\fR after the overwrite occurred, rather than when the specific memory with the overwritten guard zone(s) is freed, which may occur long after the overwrite occurred. + .SH "SEE ALSO" -ckalloc(3), ckfree(3), Tcl_ValidateAllMemory(3), Tcl_DumpActiveMemory(3), -TCL_MEM_DEBUG +ckalloc, ckfree, Tcl_ValidateAllMemory, Tcl_DumpActiveMemory, TCL_MEM_DEBUG + .SH KEYWORDS memory, debug diff --git a/doc/msgcat.n b/doc/msgcat.n index aaa8b4f..7bff211 100644 --- a/doc/msgcat.n +++ b/doc/msgcat.n @@ -33,13 +33,13 @@ msgcat \- Tcl message catalog .sp \fB::msgcat::mcunknown \fIlocale src-string\fR .BE + .SH DESCRIPTION .PP The \fBmsgcat\fR package provides a set of functions that can be used to manage multi-lingual user interfaces. -Text strings are defined in a -.QW "message catalog" -which is independent from the application, and +Text strings are defined in a ``message catalog'' which +is independent from the application, and which can be edited or localized without modifying the application source code. New languages or locales are provided by adding a new file to @@ -94,16 +94,14 @@ locale set in msgcat by \fB::msgcat::mclocale\fR, and cannot be set independently. For example, if the current locale is en_US_funky, then \fB::msgcat::mcpreferences\fR .VS 1.4 -returns -.QW "\fBen_US_funky en_US en {}\fR" . +returns \fB{en_US_funky en_US en {}}\fR. .VE 1.4 .TP \fB::msgcat::mcload \fIdirname\fR Searches the specified directory for files that match the language specifications returned by \fB::msgcat::mcpreferences\fR -(note that these are all lowercase), extended by the file extension -.QW .msg . -Each matching file is +(note that these are all lowercase), extended by the file +extension ``.msg''. Each matching file is read in order, assuming a UTF-8 encoding. The file contents are then evaluated as a Tcl script. This means that Unicode characters may be present in the message file either directly in their UTF-8 @@ -122,9 +120,8 @@ Sets the translation for multiple source strings in \fIsrc-trans-list\fR in the specified \fIlocale\fR and the current namespace. \fIsrc-trans-list\fR must have an even number of elements and is in -the form -.QW "\fIsrc-string translate-string\fR ?\fIsrc-string translate-string ...\fR?}" . -The \fB::msgcat::mcmset\fR command can be significantly +the form {\fIsrc-string translate-string\fR ?\fIsrc-string +translate-string ...\fR?} \fB::msgcat::mcmset\fR can be significantly faster than multiple invocations of \fB::msgcat::mcset\fR. The function returns the number of translations set. .TP @@ -144,15 +141,10 @@ The locale is specified to \fBmsgcat\fR by a locale string passed to \fB::msgcat::mclocale\fR. The locale string consists of a language code, an optional country code, and an optional -system-specific code, each separated by -.QW _ . -The country and language +system-specific code, each separated by ``_''. The country and language codes are specified in standards ISO-639 and ISO-3166. -For example, the locale -.QW en -specifies English and -.QW en_US -specifies U.S. English. +For example, the locale ``en'' specifies English and ``en_US'' specifies +U.S. English. .PP When the msgcat package is first loaded, the locale is initialized according to the user's environment. The variables \fBenv(LC_ALL)\fR, @@ -171,20 +163,12 @@ On Windows, if none of those environment variables is set, msgcat will attempt to extract locale information from the registry. If all these attempts to discover an initial locale from the user's environment fail, msgcat defaults to an initial -locale of -.QW C . +locale of ``C''. .PP -When a locale is specified by the user, a -.QW "best match" -search is +When a locale is specified by the user, a ``best match'' search is performed during string translation. For example, if a user specifies .VS 1.4 -en_GB_Funky, the locales -.QW en_GB_Funky , -.QW en_GB , -.QW en -and -.MT +en_GB_Funky, the locales ``en_GB_Funky'', ``en_GB'', ``en'' and ``'' (the empty string) .VE 1.4 are searched in order until a matching translation @@ -217,13 +201,10 @@ hello from ::foo When searching for a translation of a message, the message catalog will search first the current namespace, then the parent of the current namespace, and so on until -the global namespace is reached. This allows child namespaces to -.QW inherit -messages from their parent namespace. +the global namespace is reached. This allows child namespaces +to "inherit" messages from their parent namespace. .PP -For example, executing (in the -.QW en -locale) the code +For example, executing (in the ``en'' locale) the code .CS \fB::msgcat::mcset\fR en m1 ":: message1" \fB::msgcat::mcset\fR en m2 ":: message2" @@ -254,36 +235,28 @@ to the following conditions: All message files for a package are in the same directory. .IP [2] The message file name is a msgcat locale specifier (all lowercase) -followed by -.QW .msg . -For example: -.RS +followed by ``.msg''. For example: .CS es.msg -- spanish en_gb.msg -- United Kingdom English .CE .VS 1.4 -\fIException:\fR The message file for the root locale -.MT -is called \fBROOT.msg\fR. This exception is made so as not to +\fIException:\fR The message file for the root locale ``'' is +called \fBROOT.msg\fR. This exception is made so as not to cause peculiar behavior, such as marking the message file as -.QW hidden -on Unix file systems. +``hidden'' on Unix file systems. .VE 1.4 -.RE .IP [3] The file contains a series of calls to \fBmcset\fR and \fBmcmset\fR, setting the necessary translation strings for the language, likely enclosed in a \fBnamespace eval\fR so that all source strings are tied to the namespace of the package. For example, a short \fBes.msg\fR might contain: -.RS .CS namespace eval ::mypackage { \fB::msgcat::mcset\fR es "Free Beer!" "Cerveza Gracias!" } .CE -.RE .SH "RECOMMENDED MESSAGE SETUP FOR PACKAGES" .PP If a package is installed into a subdirectory of the @@ -295,13 +268,12 @@ During package installation, create a subdirectory .IP [2] Copy your *.msg files into that directory. .IP [3] -Add the following command to your package initialization script: -.RS + Add the following command to your package +initialization script: .CS # load language files, stored in msgs subdirectory \fB::msgcat::mcload\fR [file join [file dirname [info script]] msgs] .CE -.RE .SH "POSITIONAL CODES FOR FORMAT AND SCAN COMMANDS" .PP It is possible that a message string used as an argument @@ -314,7 +286,8 @@ format "We produced %d units in location %s" $num $city format "In location %s we produced %d units" $city $num .CE .PP -This can be handled by using the positional parameters: +This can be handled by using the positional +parameters: .CS format "We produced %1\\$d units in location %2\\$s" $num $city format "In location %2\\$s we produced %1\\$d units" $num $city @@ -322,14 +295,12 @@ format "In location %2\\$s we produced %1\\$d units" $num $city .PP Similarly, positional parameters can be used with \fBscan\fR to extract values from internationalized strings. -.PP -\fINote:\fR for the specific case of formatting a string, you should -take advantage of the fact that the \fB::msgcat::mc\fR command already -passes its string through \fBformat\fR internally. .SH CREDITS .PP The message catalog code was developed by Mark Harrison. + .SH "SEE ALSO" format(n), scan(n), namespace(n), package(n) + .SH KEYWORDS internationalization, i18n, localization, l10n, message, text, translation diff --git a/doc/namespace.n b/doc/namespace.n index 09fa371..f1af905 100644 --- a/doc/namespace.n +++ b/doc/namespace.n @@ -7,12 +7,12 @@ '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. '\" -'\" RCS: @(#) $Id: namespace.n,v 1.22 2007/10/24 14:29:38 dkf Exp $ +'\" RCS: @(#) $Id: namespace.n,v 1.23 2007/10/26 20:11:53 dgp Exp $ '\" .so man.macros .TH namespace n 8.5 Tcl "Tcl Built-In Commands" .BS -.\" Note: do not modify the .SH NAME line immediately below! +'\" Note: do not modify the .SH NAME line immediately below! .SH NAME namespace \- create and manipulate contexts for commands and variables .SH SYNOPSIS @@ -55,10 +55,9 @@ First, it can be evaluated in any namespace and will cause Second, additional arguments can be appended to the resulting script and they will be passed to \fIscript\fR as additional arguments. For example, suppose the command -.QW "\fBset script [namespace code {foo bar}]\fR" +\fBset script [namespace code {foo bar}]\fR is invoked in namespace \fB::a::b\fR. -Then -.QW \fBeval\0"$script\0x\0y"\fR +Then \fBeval "$script x y"\fR can be executed in any namespace (assuming the value of \fBscript\fR has been passed in properly) and will have the same effect as the command @@ -73,8 +72,7 @@ of how this is used to create callback scripts. .TP \fBnamespace current\fR Returns the fully-qualified name for the current namespace. -The actual name of the global namespace is -.MT +The actual name of the global namespace is ``'' (i.e., an empty string), but this command returns \fB::\fR for the global namespace as a convenience to programmers. @@ -220,7 +218,7 @@ If \fInamespace\fR is not specified, the fully-qualified name of the current namespace's parent is returned. .TP \fBnamespace path\fR ?\fInamespaceList\fR? -.\" Should really have the .TP inside the .VS, but that triggers a groff bug +'\" Should really have the .TP inside the .VS, but that triggers a groff bug .VS 8.5 Returns the command resolution path of the current namespace. If \fInamespaceList\fR is specified as a list of named namespaces, the @@ -361,9 +359,8 @@ Qualified names are similar to the hierarchical path names for Unix files or Tk widgets, except that \fB::\fR is used as the separator instead of \fB/\fR or \fB.\fR. -The topmost or global namespace has the name -.MT -(i.e., an empty string), although \fB::\fR is a synonym. +The topmost or global namespace has the name ``'' (i.e., an empty string), +although \fB::\fR is a synonym. As an example, the name \fB::safe::interp::create\fR refers to the command \fBcreate\fR in the namespace \fBinterp\fR that is a child of namespace \fB::safe\fR, @@ -834,7 +831,9 @@ Look up where the command imported in the previous example came from: .CS puts "grill came from [\fBnamespace origin\fR grill]" .CE + .SH "SEE ALSO" interp(n), upvar(n), variable(n) + .SH KEYWORDS command, ensemble, exported, internal, variable diff --git a/doc/open.n b/doc/open.n index 686d8e1..f71e920 100644 --- a/doc/open.n +++ b/doc/open.n @@ -5,12 +5,12 @@ '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. '\" -'\" RCS: @(#) $Id: open.n,v 1.29 2007/10/24 14:29:38 dkf Exp $ +'\" RCS: @(#) $Id: open.n,v 1.30 2007/10/26 20:11:53 dgp Exp $ '\" .so man.macros .TH open n 8.3 Tcl "Tcl Built-In Commands" .BS -.\" Note: do not modify the .SH NAME line immediately below! +'\" Note: do not modify the .SH NAME line immediately below! .SH NAME open \- Open a file-based or command pipeline channel .SH SYNOPSIS @@ -66,7 +66,7 @@ Set the initial access position to the end of the file. All of the legal \fIaccess\fR values above may have the character \fBb\fR added as the second or third character in the value to indicate that the opened channel should be configured with the -\fB\-translation binary\fR option, making the channel suitable for +\fB-translation binary\fR option, making the channel suitable for reading or writing of binary data. .VE 8.5 .PP @@ -88,7 +88,7 @@ Set the file pointer to the end of the file prior to each write. .VS 8.5 .TP 15 \fBBINARY\fR -Configure the opened channel with the \fB\-translation binary\fR option. +Configure the opened channel with the \fB-translation binary\fR option. .VE 8.5 .TP 15 \fBCREAT\fR @@ -119,12 +119,12 @@ If a new file is created as part of opening it, \fIpermissions\fR (an integer) is used to set the permissions for the new file in conjunction with the process's file mode creation mask. \fIPermissions\fR defaults to 0666. + .SH "COMMAND PIPELINES" .PP -If the first character of \fIfileName\fR is -.QW | -then the remaining characters of \fIfileName\fR are treated as a list of -arguments that describe a command pipeline to invoke, in the same style as the +If the first character of \fIfileName\fR is ``|'' then the +remaining characters of \fIfileName\fR are treated as a list of arguments +that describe a command pipeline to invoke, in the same style as the arguments for \fBexec\fR. In this case, the channel identifier returned by \fBopen\fR may be used to write to the command's input pipe or read from its output pipe, @@ -162,15 +162,10 @@ This option is a set of 4 comma-separated values: the baud rate, parity, number of data bits, and number of stop bits for this serial port. The \fIbaud\fR rate is a simple integer that specifies the connection speed. \fIParity\fR is one of the following letters: \fBn\fR, \fBo\fR, \fBe\fR, -\fBm\fR, \fBs\fR; respectively signifying the parity options of -.QW none , -.QW odd , -.QW even , -.QW mark , -or -.QW space . -\fIData\fR is the number of data bits and should be an integer from 5 to 8, -while \fIstop\fR is the number of stop bits and should be the integer 1 or 2. +\fBm\fR, \fBs\fR; respectively signifying the parity options of ``none'', +``odd'', ``even'', ``mark'', or ``space''. \fIData\fR is the number of +data bits and should be an integer from 5 to 8, while \fIstop\fR is the +number of stop bits and should be the integer 1 or 2. .TP \fB\-handshake\fR \fItype\fR (Windows and Unix). This option is used to setup automatic handshake @@ -181,14 +176,14 @@ If \fItype\fR is \fBnone\fR then any handshake is switched off. \fBrtscts\fR activates hardware handshake. Hardware handshake signals are described below. For software handshake \fBxonxoff\fR the handshake characters can be redefined -with \fB\-xchar\fR. +with \fB-xchar\fR. An additional hardware handshake \fBdtrdsr\fR is available only under Windows. There is no default handshake configuration, the initial value depends on your operating system settings. -The \fB\-handshake\fR option cannot be queried. +The \fB-handshake\fR option cannot be queried. .TP \fB\-queue\fR -(Windows and Unix). The \fB\-queue\fR option can only be queried. +(Windows and Unix). The \fB-queue\fR option can only be queried. It returns a list of two integers representing the current number of bytes in the input and output queue respectively. .TP @@ -197,7 +192,7 @@ of bytes in the input and output queue respectively. read operations. It specifies the maximum interval between the reception of two bytes in milliseconds. For Unix systems the granularity is 100 milliseconds. -The \fB\-timeout\fR option does not affect write operations or +The \fB-timeout\fR option does not affect write operations or nonblocking reads. This option cannot be queried. .TP @@ -211,10 +206,10 @@ The BREAK condition (see below) is enabled and disabled with \fB{BREAK 1}\fR and It's not a good idea to change the \fBRTS\fR (or \fBDTR\fR) signal with active hardware handshake \fBrtscts\fR (or \fBdtrdsr\fR). The result is unpredictable. -The \fB\-ttycontrol\fR option cannot be queried. +The \fB-ttycontrol\fR option cannot be queried. .TP \fB\-ttystatus\fR -(Windows and Unix). The \fB\-ttystatus\fR option can only be +(Windows and Unix). The \fB-ttystatus\fR option can only be queried. It returns the current modem status and handshake input signals (see below). The result is a list of signal,value pairs with a fixed order, @@ -250,6 +245,7 @@ In case of a serial communication error, \fBread\fR or \fBputs\fR returns a general Tcl file I/O error. \fBfconfigure -lasterror\fR can be called to get a list of error details. See below for an explanation of the various error codes. + .SH "SERIAL PORT SIGNALS" .PP RS-232 is the most commonly used standard electrical interface for serial @@ -280,9 +276,8 @@ serial port is opened. \fBData Set Ready:\fR The complement to DTR. Tells the workstation that the modem is ready to establish a link. .IP \fBDCD(input)\fR -\fBData Carrier Detect:\fR This line becomes active when a modem detects a -.QW Carrier -signal. +\fBData Carrier Detect:\fR This line becomes active when a modem detects +a "Carrier" signal. .IP \fBRI(input)\fR \fBRing Indicator:\fR Goes active when the modem detects an incoming call. .IP \fBBREAK\fR @@ -292,6 +287,7 @@ milliseconds. Normally a receive or transmit data signal stays at the mark (on=1) voltage until the next character is transferred. A BREAK is sometimes used to reset the communications line or change the operating mode of communications hardware. + .SH "ERROR CODES (Windows only)" .PP A lot of different errors may occur during serial read operations or during @@ -330,10 +326,10 @@ may cause this error. .TP 10 \fBBREAK\fR A BREAK condition has been detected by your UART (see above). + .SH "PORTABILITY ISSUES" .TP \fBWindows \fR(all versions) -. Valid values for \fIfileName\fR to open a serial port are of the form \fBcom\fIX\fB:\fR, where \fIX\fR is a number, generally from 1 to 4. This notation only works for serial ports from 1 to 9, if the system @@ -344,7 +340,6 @@ where X is any number that corresponds to a serial port; please note that this method is considerably slower on Windows 95 and Windows 98. .TP \fBWindows NT\fR -. When running Tcl interactively, there may be some strange interactions between the real console, if one is present, and a command pipeline that uses standard input or output. If a command pipeline is opened for reading, some @@ -359,16 +354,14 @@ is not accessing the console, or if the command pipeline does not use standard input or output, but is redirected from or to a file, then the above problems do not occur. .TP -\fBWindows 95\fR -. +\fBWindows 95\fR A command pipeline that executes a 16-bit DOS application cannot be opened for both reading and writing, since 16-bit DOS applications that receive standard input from a pipe and send standard output to a pipe run synchronously. Command pipelines that do not execute 16-bit DOS applications run asynchronously and can be opened for both reading and writing. -.RS -.PP +.sp When running Tcl interactively, there may be some strange interactions between the real console, if one is present, and a command pipeline that uses standard input or output. If a command pipeline is opened for reading from @@ -381,7 +374,7 @@ console at the same time. If the command pipeline is started from a script, so that Tcl is not accessing the console, or if the command pipeline does not use standard input or output, but is redirected from or to a file, then the above problems do not occur. -.PP +.sp Whether or not Tcl is running interactively, if a command pipeline is opened for reading from a 16-bit DOS application, the call to \fBopen\fR will not return until end-of-file has been received from the command pipeline's @@ -389,17 +382,14 @@ standard output. If a command pipeline is opened for writing to a 16-bit DOS application, no data will be sent to the command pipeline's standard output until the pipe is actually closed. This problem occurs because 16-bit DOS applications are run synchronously, as described above. -.RE .TP \fBUnix\fR\0\0\0\0\0\0\0 -. Valid values for \fIfileName\fR to open a serial port are generally of the form \fB/dev/tty\fIX\fR, where \fIX\fR is \fBa\fR or \fBb\fR, but the name of any pseudo-file that maps to a serial port may be used. Advanced configuration options are only supported for serial ports when Tcl is built to use the POSIX serial interface. -.RS -.PP +.sp When running Tcl interactively, there may be some strange interactions between the console, if one is present, and a command pipeline that uses standard input. If a command pipeline is opened for reading, some @@ -409,7 +399,6 @@ both Tcl and the child application are competing for the console at the same time. If the command pipeline is started from a script, so that Tcl is not accessing the console, or if the command pipeline does not use standard input, but is redirected from a file, then the above problem does not occur. -.RE .LP See the PORTABILITY ISSUES section of the \fBexec\fR command for additional information not specific to command pipelines about executing @@ -423,9 +412,11 @@ if {[catch {close $fl} err]} { puts "ls command failed: $err" } .CE + .SH "SEE ALSO" -chan(n), close(n), exec(n), fconfigure(n), file(n), filename(n), gets(n), -pid(n), puts(n), read(n), fopen(3) +file(n), close(n), filename(n), fconfigure(n), gets(n), read(n), +puts(n), exec(n), pid(n), fopen(3) + .SH KEYWORDS access mode, append, create, file, non-blocking, open, permissions, pipeline, process, serial diff --git a/doc/package.n b/doc/package.n index f304af2..ce5c955 100644 --- a/doc/package.n +++ b/doc/package.n @@ -4,7 +4,7 @@ '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. '\" -'\" RCS: @(#) $Id: package.n,v 1.19 2007/10/25 10:13:35 dkf Exp $ +'\" RCS: @(#) $Id: package.n,v 1.20 2007/10/26 20:11:53 dgp Exp $ '\" .so man.macros .TH package n 7.5 Tcl "Tcl Built-In Commands" @@ -29,6 +29,7 @@ package \- Facilities for package loading and version control \fBpackage prefer \fR?\fBlatest\fR|\fBstable\fR? .fi .BE + .SH DESCRIPTION .PP This command keeps a simple database of the packages available for @@ -109,13 +110,10 @@ vsatisfies\fR. If multiple versions are suitable the implementation with the highest version is chosen. This last part is additionally influenced by the selection mode set with \fBpackage prefer\fR. .PP -In the -.QW "stable" -selection mode the command will select the highest +In the "stable" selection mode the command will select the highest stable version satisfying the requirements, if any. If no stable version satisfies the requirements, the highest unstable version -satisfying the requirements will be selected. In the -.QW "latest" +satisfying the requirements will be selected. In the "latest" selection mode the command will accept the highest version satisfying all the requirements, regardless of its stableness. .PP @@ -145,10 +143,7 @@ of \fIpackage\fR is acceptable to the caller. This command is equivalent to \fBpackage require \fIpackage version\fR-\fIversion\fR. .TP \fBpackage unknown \fR?\fIcommand\fR? -. -This command supplies a -.QW "last resort" -command to invoke during +This command supplies a ``last resort'' command to invoke during \fBpackage require\fR if no suitable version of a package can be found in the \fBpackage ifneeded\fR database. If the \fIcommand\fR argument is supplied, it contains the first part @@ -183,24 +178,17 @@ have any of the forms: .RS .TP min -This form is called -.QW "min-bounded" . +This form is called "min-bounded". .TP min- -This form is called -.QW "min-unbound" . +This form is called "min-unbound". .TP min-max -This form is called -.QW "bounded" . +This form is called "bounded". .RE .RS .PP -where -.QW "min" -and -.QW "max" -are valid version numbers. The legacy syntax is +where "min" and "max" are valid version numbers. The legacy syntax is a special case of the extended syntax, keeping backward compatibility. Regarding satisfaction the rules are: .RE @@ -209,9 +197,7 @@ compatibility. Regarding satisfaction the rules are: The \fIversion\fR has to pass at least one of the listed \fIrequirement\fRs to be satisfactory. .IP [2] -A version satisfies a -.QW "bounded" -requirement when +A version satisfies a "bounded" requirement when .RS .IP [a] For \fImin\fR equal to the \fImax\fR if, and only if the \fIversion\fR @@ -219,63 +205,42 @@ is equal to the \fImin\fR. .IP [b] Otherwise if, and only if the \fIversion\fR is greater than or equal to the \fImin\fR, and less than the \fImax\fR, where both \fImin\fR -and \fImax\fR have been padded internally with -.QW a0 . -Note that while the comparison to \fImin\fR is inclusive, the comparison to +and \fImax\fR have been padded internally with 'a0'. Note that while +the comparison to \fImin\fR is inclusive, the comparison to \fImax\fR is exclusive. .RE .IP [3] -A -.QW "min-bounded" -requirement is a -.QW "bounded" -requirement in disguise, +A "min-bounded" requirement is a "bounded" requirement in disguise, with the \fImax\fR part implicitly specified as the next higher major version number of the \fImin\fR part. A version satisfies it per the rules above. .IP [4] -A \fIversion\fR satisfies a -.QW "min-unbound" -requirement if, and only if +A \fIversion\fR satisfies a "min-unbound" requirement if, and only if it is greater than or equal to the \fImin\fR, where the \fImin\fR has -been padded internally with -.QW a0 . -There is no constraint to a maximum. +been padded internally with 'a0'. There is no constraint to a maximum. .RE .TP \fBpackage prefer \fR?\fBlatest\fR|\fBstable\fR? -With no arguments, the commands returns either -.QW "latest" -or -.QW "stable" , +With no arguments, the commands returns either "latest" or "stable", whichever describes the current mode of selection logic used by \fBpackage require\fR. .RS .PP -When passed the argument -.QW "latest" , -it sets the selection logic mode to -.QW "latest" . +When passed the argument "latest", it sets the selection logic mode to +"latest". .PP -When passed the argument -.QW "stable" , -if the mode is already -.QW "stable" , -that value is kept. If the mode is already -.QW "latest" , then the attempt to set it back to -.QW "stable" -is ineffective and the mode value remains -.QW "latest" . +When passed the argument "stable", if the mode is already "stable", +that value is kept. If the mode is already "latest", then the attempt +to set it back to "stable" is ineffective and the mode value remains +"latest". .PP When passed any other value as an argument, raise an invalid argument error. .PP When an interpreter is created, its initial selection mode value is set to -.QW "stable" -unless the environment variable \fBTCL_PKG_PREFER_LATEST\fR +"stable" unless the environment variable \fBTCL_PKG_PREFER_LATEST\fR is set. If that environment variable is defined (with any value) then -the initial (and permanent) selection mode value is set to -.QW "latest" . +the initial (and permanent) selection mode value is set to "latest". .RE .SH "VERSION NUMBERS" .PP @@ -288,29 +253,16 @@ For example, version 2.1 is later than 1.3 and version 3.4.6 is later than 3.3.5. Missing fields are equivalent to zeroes: version 1.3 is the same as version 1.3.0 and 1.3.0.0, so it is earlier than 1.3.1 or 1.3.0.2. -In addition, the letters -.QW a -(alpha) and/or -.QW b -(beta) may appear +In addition, the letters 'a' (alpha) and/or 'b' (beta) may appear exactly once to replace a dot for separation. These letters -semantically add a negative specifier into the version, where -.QW a -is -2, and -.QW b -is -1. Each may be specified only once, and -.QW a -and -.QW b -are mutually exclusive in a specifier. Thus 1.3a1 becomes (semantically) +semantically add a negative specifier into the version, where 'a' is +-2, and 'b' is -1. Each may be specified only once, and 'a' or 'b' are +mutually exclusive in a specifier. Thus 1.3a1 becomes (semantically) 1.3.-2.1, 1.3b1 is 1.3.-1.1. Negative numbers are not directly allowed in version specifiers. -A version number not containing the letters -.QW a -or -.QW b -as specified above is called a \fBstable\fR version, whereas presence -of the letters causes the version to be called is \fBunstable\fR. +A version number not containing the letters 'a' or 'b' as specified +above is called a \fBstable\fR version, whereas presence of the letters +causes the version to be called is \fBunstable\fR. A later version number is assumed to be upwards compatible with an earlier version number as long as both versions have the same major version number. @@ -324,7 +276,7 @@ to work unmodified with either version 1.7.3 or version 3.1. The recommended way to use packages in Tcl is to invoke \fBpackage require\fR and \fBpackage provide\fR commands in scripts, and use the procedure \fBpkg_mkIndex\fR to create package index files. -Once you have done this, packages will be loaded automatically +Once you've done this, packages will be loaded automatically in response to \fBpackage require\fR commands. See the documentation for \fBpkg_mkIndex\fR for details. .SH EXAMPLES @@ -346,7 +298,9 @@ if {[catch {\fBpackage require\fR Snack}]} { # We have the package, configure the app to use it } .CE + .SH "SEE ALSO" msgcat(n), packagens(n), pkgMkIndex(n) + .SH KEYWORDS package, version diff --git a/doc/packagens.n b/doc/packagens.n index 5376efa..beef5f1 100644 --- a/doc/packagens.n +++ b/doc/packagens.n @@ -2,7 +2,7 @@ '\" Copyright (c) 1998-2000 by Scriptics Corporation. '\" All rights reserved. '\" -'\" RCS: @(#) $Id: packagens.n,v 1.6 2007/10/24 14:29:38 dkf Exp $ +'\" RCS: @(#) $Id: packagens.n,v 1.7 2007/10/26 20:11:53 dgp Exp $ '\" .so man.macros .TH pkg::create n 8.3 Tcl "Tcl Built-In Commands" @@ -20,6 +20,7 @@ pkg::create \- Construct an appropriate `package ifneeded' command for a given p library. It is used to create an appropriate \fBpackage ifneeded\fR command for a given package specification. It can be used to construct a \fBpkgIndex.tcl\fR file for use with the \fBpackage\fR mechanism. + .SH OPTIONS The parameters supported are: .TP @@ -45,7 +46,9 @@ specifies a Tcl library that must be loaded with the specified. .PP At least one \fB\-load\fR or \fB\-source\fR parameter must be given. + .SH "SEE ALSO" package(n) + .SH KEYWORDS auto-load, index, package, version diff --git a/doc/pkgMkIndex.n b/doc/pkgMkIndex.n index 957906f..e1083ef 100644 --- a/doc/pkgMkIndex.n +++ b/doc/pkgMkIndex.n @@ -4,7 +4,7 @@ '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. '\" -'\" RCS: @(#) $Id: pkgMkIndex.n,v 1.19 2007/10/24 14:29:38 dkf Exp $ +'\" RCS: @(#) $Id: pkgMkIndex.n,v 1.20 2007/10/26 20:11:53 dgp Exp $ '\" .so man.macros .TH pkg_mkIndex n 8.3 Tcl "Tcl Built-In Commands" @@ -40,8 +40,7 @@ The \fIdir\fR argument gives the name of a directory and each \fIpattern\fR argument is a \fBglob\fR-style pattern that selects script or binary files in \fIdir\fR. The default pattern is \fB*.tcl\fR and \fB*.[info sharedlibextension]\fR. -.RS -.PP +.br \fBPkg_mkIndex\fR will create a file \fBpkgIndex.tcl\fR in \fIdir\fR with package information about all the files given by the \fIpattern\fR arguments. @@ -55,7 +54,7 @@ or if you have dependencies among files, you may have to use the \fB\-load\fR option or adjust the order in which \fBpkg_mkIndex\fR processes the files. See COMPLEX CASES below. -.RE + .IP [3] Install the package as a subdirectory of one of the directories given by the \fBtcl_pkgPath\fR variable. If \fB$tcl_pkgPath\fR contains more @@ -69,8 +68,7 @@ the package's script and/or binary files as well as the \fBpkgIndex.tcl\fR file. As long as the package is installed as a subdirectory of a directory in \fB$tcl_pkgPath\fR it will automatically be found during \fBpackage require\fR commands. -.RS -.PP +.br If you install the package anywhere else, then you must ensure that the directory containing the package is in the \fBauto_path\fR global variable or an immediate subdirectory of one of the directories in \fBauto_path\fR. @@ -83,7 +81,6 @@ You can add a directory to \fBauto_path\fR explicitly in your application, or you can add the directory to your \fBTCLLIBPATH\fR environment variable: if this environment variable is present, Tcl initializes \fBauto_path\fR from it during application startup. -.RE .IP [4] Once the above steps have been taken, all you need to do to use a package is to invoke \fBpackage require\fR. @@ -97,6 +94,7 @@ in \fBauto_path\fR, but only one will actually be loaded in a given interpreter, based on the first call to \fBpackage require\fR. Different versions of a package may be loaded in different interpreters. + .SH OPTIONS The optional switches are: .TP 15 @@ -123,6 +121,7 @@ the \fBtclLog\fR procedure, which by default prints to stderr. .TP 15 \fB\-\-\fR End of the flags, in case \fIdir\fR begins with a dash. + .SH "PACKAGES AND THE AUTO-LOADER" .PP The package management facilities overlap somewhat with the auto-loader, @@ -142,6 +141,7 @@ If you use \fBpkg_mkIndex\fR to index a package, its commands cannot be invoked until \fBpackage require\fR has been used to select a version; in contrast, packages indexed with \fBauto_mkindex\fR can be used immediately since there is no version control. + .SH "HOW IT WORKS" .PP \fBPkg_mkIndex\fR depends on the \fBpackage unknown\fR command, @@ -164,6 +164,7 @@ is invoked. Thus, after invoking \fBpackage require\fR you may not see the package's commands in the interpreter, but you will be able to invoke the commands and they will be auto-loaded. + .SH "DIRECT LOADING" .PP Some packages, for instance packages which use namespaces and export @@ -172,6 +173,7 @@ that their package files be loaded immediately upon \fBpackage require\fR instead of delaying the actual loading to the first use of one of the package's command. This is the default mode when generating the package index. It can be overridden by specifying the \fI\-lazy\fR argument. + .SH "COMPLEX CASES" Most complex cases of dependencies among scripts and binary files, and packages being split among scripts and @@ -227,7 +229,9 @@ other files that provide part of the same package. If you must use \fB\-load\fR, then you must specify the scripts first; otherwise the package loaded from the binary file may mask the package defined by the scripts. + .SH "SEE ALSO" package(n) + .SH KEYWORDS auto-load, index, package, version diff --git a/doc/re_syntax.n b/doc/re_syntax.n index 47873c5..56fd2c8 100644 --- a/doc/re_syntax.n +++ b/doc/re_syntax.n @@ -5,7 +5,7 @@ '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. '\" -'\" RCS: @(#) $Id: re_syntax.n,v 1.12 2007/10/26 12:25:06 dkf Exp $ +'\" RCS: @(#) $Id: re_syntax.n,v 1.13 2007/10/26 20:11:53 dgp Exp $ '\" .so man.macros .TH re_syntax n "8.1" Tcl "Tcl Built-In Commands" @@ -19,17 +19,12 @@ re_syntax \- Syntax of Tcl regular expressions A \fIregular expression\fR describes strings of characters. It's a pattern that matches certain strings and doesn't match others. .SH "DIFFERENT FLAVORS OF REs" -Regular expressions -.PQ RE s , -as defined by POSIX, come in two flavors: \fIextended\fR REs -.PQ ERE s -and \fIbasic\fR REs -.PQ BRE s . +Regular expressions (``RE''s), as defined by POSIX, come in two +flavors: \fIextended\fR REs (``EREs'') and \fIbasic\fR REs (``BREs''). EREs are roughly those of the traditional \fIegrep\fR, while BREs are roughly those of the traditional \fIed\fR. This implementation adds -a third flavor, \fIadvanced\fR REs -.PQ ARE s , -basically EREs with some significant extensions. +a third flavor, \fIadvanced\fR REs (``AREs''), basically EREs with +some significant extensions. .PP This manual page primarily describes AREs. BREs mostly exist for backward compatibility in some old programs; they will be discussed at @@ -43,8 +38,7 @@ the Perl5 extensions (thanks, Henry!). Much of the description of regular expressions below is copied verbatim from his manual entry. .PP An ARE is one or more \fIbranches\fR, -separated by -.QW \fB|\fR , +separated by `\fB|\fR', matching anything that matches any of the branches. .PP A branch is zero or more \fIconstraints\fR or \fIquantified atoms\fR, @@ -95,9 +89,8 @@ An atom is one of: matches a match for \fIre\fR (\fIre\fR is any regular expression) with the match noted for possible reporting .IP \fB(?:\fIre\fB)\fR -as previous, but does no reporting (a -.QW non-capturing -set of parentheses) +as previous, but does no reporting (a ``non-capturing'' set of +parentheses) .IP \fB()\fR matches an empty string, noted for possible reporting .IP \fB(?:)\fR @@ -109,17 +102,15 @@ a \fIbracket expression\fR, matching any one of the \fIchars\fR (see matches any single character .IP \fB\e\fIk\fR matches the non-alphanumeric character \fIk\fR -taken as an ordinary character, e.g. -.QW \fB\e\e\fR -matches a backslash character +taken as an ordinary character, e.g. \fB\e\e\fR matches a backslash +character .IP \fB\e\fIc\fR where \fIc\fR is alphanumeric (possibly followed by other characters), an \fIescape\fR (AREs only), see \fBESCAPES\fR below .IP \fB{\fR when followed by a character other than a digit, matches the -left-brace character -.QW \fB{\fR ; -when followed by a digit, it is the beginning of a \fIbound\fR (see above) +left-brace character `\fB{\fR'; when followed by a digit, it is the +beginning of a \fIbound\fR (see above) .IP \fIx\fR where \fIx\fR is a single character with no other significance, matches that character. @@ -149,122 +140,67 @@ substring matching \fIre\fR begins The lookahead constraints may not contain back references (see later), and all parentheses within them are considered non-capturing. .PP -An RE may not end with -.QW \fB\e\fR . +An RE may not end with `\fB\e\fR'. .SH "BRACKET EXPRESSIONS" A \fIbracket expression\fR is a list of characters enclosed in -.QW \fB[\|]\fR . -It normally matches any single character from the list (but see -below). If the list begins with -.QW \fB^\fR , -it matches any single character (but see below) \fInot\fR from the -rest of the list. -.PP -If two characters in the list are separated by -.QW \fB\-\fR , -this is shorthand for the full \fIrange\fR of characters between those two -(inclusive) in the collating sequence, e.g. -.QW \fB[0\-9]\fR -in Unicode matches any conventional decimal digit. Two ranges may not share an -endpoint, so e.g. -.QW \fBa\-c\-e\fR -is illegal. Ranges are very collating-sequence-dependent, and portable -programs should avoid relying on them. -.PP -To include a literal -.QW \fB]\fR -or -.QW \fB\-\fR -in the list, the simplest method is to enclose it in -.QW \fB[.\fR -and -.QW \fB.]\fR -to make it a collating element (see below). Alternatively, make it the first -character (following a possible -.QW \fB^\fR ), -or (AREs only) precede it with -.QW \fB\e\fR . -Alternatively, for -.QW \fB\-\fR , -make it the last character, or the second endpoint of a range. To use a -literal -.QW \fB\-\fR -as the first endpoint of a range, make it a collating element -or (AREs only) precede it with -.QW \fB\e\fR . -With the exception of these, some combinations using -.QW \fB[\fR -(see next paragraphs), and escapes, all other special characters lose their -special significance within a bracket expression. +`\fB[\|]\fR'. It normally matches any single character from the list +(but see below). If the list begins with `\fB^\fR', it matches any +single character (but see below) \fInot\fR from the rest of the list. +.PP +If two characters in the list are separated by `\fB\-\fR', this is +shorthand for the full \fIrange\fR of characters between those two +(inclusive) in the collating sequence, e.g. \fB[0\-9]\fR in Unicode +matches any conventional decimal digit. Two ranges may not share an +endpoint, so e.g. \fBa\-c\-e\fR is illegal. Ranges are very +collating-sequence-dependent, and portable programs should avoid +relying on them. +.PP +To include a literal \fB]\fR or \fB\-\fR in the list, the simplest +method is to enclose it in \fB[.\fR and \fB.]\fR to make it a +collating element (see below). Alternatively, make it the first +character (following a possible `\fB^\fR'), or (AREs only) precede it +with `\fB\e\fR'. Alternatively, for `\fB\-\fR', make it the last +character, or the second endpoint of a range. To use a literal +\fB\-\fR as the first endpoint of a range, make it a collating element +or (AREs only) precede it with `\fB\e\fR'. With the exception of +these, some combinations using \fB[\fR (see next paragraphs), and +escapes, all other special characters lose their special significance +within a bracket expression. .PP Within a bracket expression, a collating element (a character, a multi-character sequence that collates as if it were a single character, or a collating-sequence name for either) enclosed in -.QW \fB[.\fR -and -.QW \fB.]\fR -stands for the sequence of characters of that collating element. -The sequence is a single element of the bracket +\fB[.\fR and \fB.]\fR stands for the sequence of characters of that +collating element. The sequence is a single element of the bracket expression's list. A bracket expression in a locale that has multi-character collating elements can thus match more than one character. So (insidiously), a bracket expression that starts with -.QW \fB^\fR -can match multi-character collating elements even if none of +\fB^\fR can match multi-character collating elements even if none of them appear in the bracket expression! (\fINote:\fR Tcl currently has no multi-character collating elements. This information is only for illustration.) .PP -For example, assume the collating sequence includes a -.QW \fBch\fR -multi-character collating element. Then the RE -.QW \fB[[.ch.]]*c\fR -(zero or more -.QW \fBch\fR 's -followed by -.QW \fBc\fR ) -matches the first five characters of -.QW \fBchchcc\fR . -Also, the RE -.QW \fB[^c]b\fR -matches all of -.QW \fBchb\fR -(because -.QW \fB[^c]\fR -matches the multi-character -.QW \fBch\fR ). -.PP -Within a bracket expression, a collating element enclosed in -.QW \fB[=\fR -and -.QW \fB=]\fR -is an equivalence class, standing for the sequences of +For example, assume the collating sequence includes a \fBch\fR +multi-character collating element. Then the RE \fB[[.ch.]]*c\fR (zero +or more \fBch\fR's followed by \fBc\fR) matches the first five +characters of `\fBchchcc\fR'. Also, the RE \fB[^c]b\fR matches all of +`\fBchb\fR' (because \fB[^c]\fR matches the multi-character \fBch\fR). +.PP +Within a bracket expression, a collating element enclosed in \fB[=\fR +and \fB=]\fR is an equivalence class, standing for the sequences of characters of all collating elements equivalent to that one, including itself. (If there are no other equivalent collating elements, the -treatment is as if the enclosing delimiters were -.QW \fB[.\fR \& -and -.QW \fB.]\fR .) -For example, if -.QW \fBo\fR -and -.QW \fB\N'244'\fR -are the members of an equivalence class, then -.QW \fB[[=o=]]\fR , -.QW \fB[[=\N'244'=]]\fR , -and -.QW \fB[o\N'244']\fR \& -are all synonymous. An equivalence class may +treatment is as if the enclosing delimiters were `\fB[.\fR'\& and +`\fB.]\fR'.) For example, if \fBo\fR and \fB\o'o^'\fR are the members +of an equivalence class, then `\fB[[=o=]]\fR', `\fB[[=\o'o^'=]]\fR', +and `\fB[o\o'o^']\fR'\& are all synonymous. An equivalence class may not be an endpoint of a range. (\fINote:\fR Tcl currently implements only the Unicode locale. It doesn't define any equivalence classes. The examples above are just illustrations.) .PP Within a bracket expression, the name of a \fIcharacter class\fR -enclosed in -.QW \fB[:\fR -and -.QW \fB:]\fR -stands for the list of all -characters (not all collating elements!) belonging to that class. +enclosed in \fB[:\fR and \fB:]\fR stands for the list of all +characters (not all collating elements!) belonging to that class. Standard character classes are: .IP \fBalpha\fR 8 A letter. @@ -279,9 +215,7 @@ A hexadecimal digit. .IP \fBalnum\fR 8 An alphanumeric (letter or digit). .IP \fBprint\fR 8 -A -.QW "printable" -(same as graph, except also including space). +A "printable" (same as graph, except also including space). .IP \fBblank\fR 8 A space or tab character. .IP \fBspace\fR 8 @@ -298,35 +232,23 @@ implementation has only one locale: the Unicode locale.) A character class may not be used as an endpoint of a range. .PP There are two special cases of bracket expressions: the bracket -expressions -.QW \fB[[:<:]]\fR -and -.QW \fB[[:>:]]\fR -are constraints, matching +expressions \fB[[:<:]]\fR and \fB[[:>:]]\fR are constraints, matching empty strings at the beginning and end of a word respectively. -.\" note, discussion of escapes below references this definition of word +'\" note, discussion of escapes below references this definition of word A word is defined as a sequence of word characters that is neither preceded nor followed by word characters. A word character is an -\fIalnum\fR character or an underscore -.PQ \fB_\fR "" . -These special bracket expressions are deprecated; users of AREs should use +\fIalnum\fR character or an underscore (\fB_\fR). These special +bracket expressions are deprecated; users of AREs should use constraint escapes instead (see below). .SH ESCAPES -Escapes (AREs only), which begin with a -.QW \fB\e\fR -followed by an +Escapes (AREs only), which begin with a \fB\e\fR followed by an alphanumeric character, come in several varieties: character entry, -class shorthands, constraint escapes, and back references. A -.QW \fB\e\fR +class shorthands, constraint escapes, and back references. A \fB\e\fR followed by an alphanumeric character but not constituting a valid escape is illegal in AREs. In EREs, there are no escapes: outside a -bracket expression, a -.QW \fB\e\fR -followed by an alphanumeric character +bracket expression, a \fB\e\fR followed by an alphanumeric character merely stands for that character as an ordinary character, and inside -a bracket expression, -.QW \fB\e\fR -is an ordinary character. (The latter +a bracket expression, \fB\e\fR is an ordinary character. (The latter is the one actual incompatibility between EREs and AREs.) .PP Character-entry escapes (AREs only) exist to make it easier to specify @@ -348,9 +270,8 @@ applications where there are multiple levels of backslash processing are the same as those of \fIX\fR, and whose other bits are all zero .TP \fB\ee\fR -the character whose collating-sequence name is -.QW \fBESC\fR , -or failing that, the character with octal value 033 +the character whose collating-sequence name is `\fBESC\fR', or failing +that, the character with octal value 033 .TP \fB\ef\fR formfeed, as in C @@ -394,27 +315,16 @@ reference (see below)) the character whose octal value is \fB0\fIxyz\fR .RE .PP -Hexadecimal digits are -.QR 0 9 , -.QR a f , -and -.QR A F . -Octal digits are -.QR 0 7 . +Hexadecimal digits are `\fB0\fR'-`\fB9\fR', `\fBa\fR'-`\fBf\fR', and +`\fBA\fR'-`\fBF\fR'. Octal digits are `\fB0\fR'-`\fB7\fR'. .PP The character-entry escapes are always taken as ordinary characters. -For example, -.QW \fB\e135\fR -is -.QW \fB]\fR -in Unicode, but -.QW \fB\e135\fR -does not terminate a bracket expression. Beware, however, that some +For example, \fB\e135\fR is \fB]\fR in Unicode, but \fB\e135\fR does +not terminate a bracket expression. Beware, however, that some applications (e.g., C compilers and the Tcl interpreter if the regular expression is not quoted with braces) interpret such sequences themselves before the regular-expression package gets to see them, -which may require doubling (quadrupling, etc.) the -.QW \fB\e\fR . +which may require doubling (quadrupling, etc.) the `\fB\e\fR'. .PP Class-shorthand escapes (AREs only) provide shorthands for certain commonly-used character classes: @@ -439,25 +349,11 @@ commonly-used character classes: \fB[^[:alnum:]_]\fR (note underscore) .RE .PP -Within bracket expressions, -.QW \fB\ed\fR , -.QW \fB\es\fR , -and -.QW \fB\ew\fR \& -lose their outer brackets, and -.QW \fB\eD\fR , -.QW \fB\eS\fR , -and -.QW \fB\eW\fR \& -are illegal. (So, for example, -.QW \fB[a-c\ed]\fR -is equivalent to -.QW \fB[a-c[:digit:]]\fR . -Also, -.QW \fB[a-c\eD]\fR , -which is equivalent to -.QW \fB[a-c^[:digit:]]\fR , -is illegal.) +Within bracket expressions, `\fB\ed\fR', `\fB\es\fR', and +`\fB\ew\fR'\& lose their outer brackets, and `\fB\eD\fR', `\fB\eS\fR', +and `\fB\eW\fR'\& are illegal. (So, for example, \fB[a-c\ed]\fR is +equivalent to \fB[a-c[:digit:]]\fR. Also, \fB[a-c\eD]\fR, which is +equivalent to \fB[a-c^[:digit:]]\fR, is illegal.) .PP A constraint escape (AREs only) is a constraint, matching the empty string if specific conditions are met, written as an escape: @@ -465,8 +361,7 @@ string if specific conditions are met, written as an escape: .TP 6 \fB\eA\fR matches only at the beginning of the string (see \fBMATCHING\fR, -below, for how this differs from -.QW \fB^\fR ) +below, for how this differs from `\fB^\fR') .TP \fB\em\fR matches only at the beginning of a word @@ -482,8 +377,7 @@ matches only at a point that is not the beginning or end of a word .TP \fB\eZ\fR matches only at the end of the string (see \fBMATCHING\fR, below, for -how this differs from -.QW \fB$\fR ) +how this differs from `\fB$\fR') .TP \fB\e\fIm\fR (where \fIm\fR is a nonzero digit) a \fIback reference\fR, see below @@ -495,22 +389,14 @@ closing capturing parentheses seen so far) a \fIback reference\fR, see below .RE .PP -A word is defined as in the specification of -.QW \fB[[:<:]]\fR -and -.QW \fB[[:>:]]\fR -above. Constraint escapes are illegal within bracket expressions. +A word is defined as in the specification of \fB[[:<:]]\fR and +\fB[[:>:]]\fR above. Constraint escapes are illegal within bracket +expressions. .PP A back reference (AREs only) matches the same string matched by the parenthesized subexpression specified by the number, so that (e.g.) -.QW \fB([bc])\e1\fR -matches -.QW \fBbb\fR -or -.QW \fBcc\fR -but not -.QW \fBbc\fR . -The subexpression must entirely precede the back reference in the RE. +\fB([bc])\e1\fR matches \fBbb\fR or \fBcc\fR but not `\fBbc\fR'. The +subexpression must entirely precede the back reference in the RE. Subexpressions are numbered in the order of their leading parentheses. Non-capturing parentheses do not define subexpressions. .PP @@ -528,19 +414,15 @@ forms and miscellaneous syntactic facilities available. .PP Normally the flavor of RE being used is specified by application-dependent means. However, this can be overridden by a -\fIdirector\fR. If an RE of any flavor begins with -.QW \fB***:\fR , -the rest of the RE is an ARE. If an RE of any flavor begins with -.QW \fB***=\fR , -the rest of the RE is taken to be a literal string, with +\fIdirector\fR. If an RE of any flavor begins with `\fB***:\fR', the +rest of the RE is an ARE. If an RE of any flavor begins with +`\fB***=\fR', the rest of the RE is taken to be a literal string, with all characters considered ordinary characters. .PP An ARE may begin with \fIembedded options\fR: a sequence -.QW \fB(?\fIxyz\fB)\fR -where -.QW \fIxyz\fR -is one or more alphabetic characters) specifies options affecting the rest of -the RE. These supplement, and can override, any options specified by the +\fB(?\fIxyz\fB)\fR (where \fIxyz\fR is one or more alphabetic +characters) specifies options affecting the rest of the RE. These +supplement, and can override, any options specified by the application. The available option letters are: .RS 2 .TP 3 @@ -566,9 +448,7 @@ newline-sensitive matching (see \fBMATCHING\fR, below) partial newline-sensitive matching (see \fBMATCHING\fR, below) .TP 3 \fBq\fR -rest of RE is a literal -.PQ quoted -string, all ordinary characters +rest of RE is a literal (``quoted'') string, all ordinary characters .TP 3 \fBs\fR non-newline-sensitive matching (usual default) @@ -577,18 +457,16 @@ non-newline-sensitive matching (usual default) tight syntax (usual default; see below) .TP 3 \fBw\fR -inverse partial newline-sensitive -.PQ weird -matching (see \fBMATCHING\fR, below) +inverse partial newline-sensitive (``weird'') matching (see +\fBMATCHING\fR, below) .TP 3 \fBx\fR expanded syntax (see below) .RE .PP -Embedded options take effect at the -.QW \fB)\fR -terminating the sequence. They are available only at the start of an ARE, and -may not be used later within it. +Embedded options take effect at the \fB)\fR terminating the sequence. +They are available only at the start of an ARE, and may not be used +later within it. .PP In addition to the usual (\fItight\fR) RE syntax, in which all characters are significant, there is an \fIexpanded\fR syntax, @@ -599,40 +477,27 @@ following newline (or the end of the RE) are ignored, permitting paragraphing and commenting a complex RE. There are three exceptions to that basic rule: .IP \(bu 3 -a white-space character or -.QW \fB#\fR -preceded by -.QW \fB\e\fR -is retained +a white-space character or `\fB#\fR' preceded by `\fB\e\fR' is +retained .IP \(bu 3 -white space or -.QW \fB#\fR -within a bracket expression is retained +white space or `\fB#\fR' within a bracket expression is retained .IP \(bu 3 white space and comments are illegal within multi-character symbols -like the ARE -.QW \fB(?:\fR -or the BRE -.QW \fB\e(\fR +like the ARE `\fB(?:\fR' or the BRE `\fB\e(\fR' .PP Expanded-syntax white-space characters are blank, tab, newline, and any character that belongs to the \fIspace\fR character class. .PP Finally, in an ARE, outside bracket expressions, the sequence -.QW \fB(?#\fIttt\fB)\fR -(where \fIttt\fR is any text not containing a -.QW \fB)\fR ) -is a comment, completely ignored. Again, this is not allowed between the -characters of multi-character symbols like -.QW \fB(?:\fR . -Such comments are more a historical artifact than a +`\fB(?#\fIttt\fB)\fR' (where \fIttt\fR is any text not containing a +`\fB)\fR') is a comment, completely ignored. Again, this is not +allowed between the characters of multi-character symbols like +`\fB(?:\fR'. Such comments are more a historical artifact than a useful facility, and their use is deprecated; use the expanded syntax instead. .PP \fINone\fR of these metasyntax extensions is available if the -application (or an initial -.QW \fB***=\fR -director) has specified that the +application (or an initial \fB***=\fR director) has specified that the user's input be treated as a literal string rather than as an RE. .SH MATCHING In the event that an RE could match more than one substring of a given @@ -643,22 +508,15 @@ substring, or the shortest. .PP Most atoms, and all constraints, have no preference. A parenthesized RE has the same preference (possibly none) as the RE. A quantified -atom with quantifier -.QW \fB{\fIm\fB}\fR -or -.QW \fB{\fIm\fB}?\fR -has the same +atom with quantifier \fB{\fIm\fB}\fR or \fB{\fIm\fB}?\fR has the same preference (possibly none) as the atom itself. A quantified atom with -other normal quantifiers (including -.QW \fB{\fIm\fB,\fIn\fB}\fR -with \fIm\fR equal to \fIn\fR) prefers longest match. A quantified atom -with other non-greedy quantifiers (including -.QW \fB{\fIm\fB,\fIn\fB}?\fR +other normal quantifiers (including \fB{\fIm\fB,\fIn\fB}\fR with +\fIm\fR equal to \fIn\fR) prefers longest match. A quantified atom +with other non-greedy quantifiers (including \fB{\fIm\fB,\fIn\fB}?\fR with \fIm\fR equal to \fIn\fR) prefers shortest match. A branch has the same preference as the first quantified atom in it which has a preference. An RE consisting of two or more branches connected by the -.QW \fB|\fR -operator prefers longest match. +\fB|\fR operator prefers longest match. .PP Subject to the constraints imposed by the rules for matching the whole RE, subexpressions also match the longest or shortest possible @@ -667,85 +525,44 @@ earlier in the RE taking priority over ones starting later. Note that outer subexpressions thus take priority over their component subexpressions. .PP -Note that the quantifiers -.QW \fB{1,1}\fR -and -.QW \fB{1,1}?\fR -can be used to force longest and shortest preference, respectively, on a +Note that the quantifiers \fB{1,1}\fR and \fB{1,1}?\fR can be used to +force longest and shortest preference, respectively, on a subexpression or a whole RE. .PP Match lengths are measured in characters, not collating elements. An empty string is considered longer than no match at all. For example, -.QW \fBbb*\fR -matches the three middle characters of -.QW \fBabbbc\fR , -.QW \fB(week|wee)(night|knights)\fR -matches all ten characters of -.QW \fBweeknights\fR , -when -.QW \fB(.*).*\fR -is matched against -.QW \fBabc\fR -the +\fBbb*\fR matches the three middle characters of `\fBabbbc\fR', +\fB(week|wee)(night|knights)\fR matches all ten characters of +`\fBweeknights\fR', when \fB(.*).*\fR is matched against \fBabc\fR the parenthesized subexpression matches all three characters, and when -.QW \fB(a*)*\fR -is matched against -.QW \fBbc\fR -both the whole RE and the +\fB(a*)*\fR is matched against \fBbc\fR both the whole RE and the parenthesized subexpression match an empty string. .PP If case-independent matching is specified, the effect is much as if all case distinctions had vanished from the alphabet. When an alphabetic that exists in multiple cases appears as an ordinary character outside a bracket expression, it is effectively transformed -into a bracket expression containing both cases, so that -.QW \fBx\fR -becomes -.QW \fB[xX]\fR . -When it appears inside a bracket expression, +into a bracket expression containing both cases, so that \fBx\fR +becomes `\fB[xX]\fR'. When it appears inside a bracket expression, all case counterparts of it are added to the bracket expression, so -that -.QW \fB[x]\fR -becomes -.QW \fB[xX]\fR -and -.QW \fB[^x]\fR -becomes -.QW \fB[^xX]\fR. -.PP -If newline-sensitive matching is specified, -.QW \fB.\fR -and bracket expressions using -.QW \fB^\fR -will never match the newline character (so +that \fB[x]\fR becomes \fB[xX]\fR and \fB[^x]\fR becomes +`\fB[^xX]\fR'. +.PP +If newline-sensitive matching is specified, \fB.\fR and bracket +expressions using \fB^\fR will never match the newline character (so that matches will never cross newlines unless the RE explicitly -arranges it) and -.QW \fB^\fR -and -.QW \fB$\fR -will match the empty string after +arranges it) and \fB^\fR and \fB$\fR will match the empty string after and before a newline respectively, in addition to matching at -beginning and end of string respectively. ARE -.QW \fB\eA\fR -and -.QW \fB\eZ\fR +beginning and end of string respectively. ARE \fB\eA\fR and \fB\eZ\fR continue to match beginning or end of string \fIonly\fR. .PP If partial newline-sensitive matching is specified, this affects -.QW \fB.\fR -and bracket expressions as with newline-sensitive matching, but not -.QW \fB^\fR -and -.QW \fB$\fR. +\fB.\fR and bracket expressions as with newline-sensitive matching, +but not \fB^\fR and `\fB$\fR'. .PP If inverse partial newline-sensitive matching is specified, this -affects -.QW \fB^\fR -and -.QW \fB$\fR -as with newline-sensitive matching, but not -.QW \fB.\fR -and bracket expressions. This isn't very useful but is +affects \fB^\fR and \fB$\fR as with newline-sensitive matching, but +not \fB.\fR and bracket expressions. This isn't very useful but is provided for symmetry. .SH "LIMITS AND COMPATIBILITY" No particular limit is imposed on the length of REs. Programs @@ -754,21 +571,16 @@ bytes, as a POSIX-compliant implementation can refuse to accept such REs. .PP The only feature of AREs that is actually incompatible with POSIX EREs -is that -.QW \fB\e\fR -does not lose its special significance inside bracket +is that \fB\e\fR does not lose its special significance inside bracket expressions. All other ARE features use syntax which is illegal or -has undefined or unspecified effects in POSIX EREs; the -.QW \fB***\fR +has undefined or unspecified effects in POSIX EREs; the \fB***\fR syntax of directors likewise is outside the POSIX syntax for both BREs and EREs. .PP Many of the ARE extensions are borrowed from Perl, but some have been changed to clean them up, and a few Perl extensions are not present. -Incompatibilities of note include -.QW \fB\eb\fR , -.QW \fB\eB\fR , -the lack of special treatment for a trailing newline, the addition of +Incompatibilities of note include `\fB\eb\fR', `\fB\eB\fR', the lack +of special treatment for a trailing newline, the addition of complemented bracket expressions to the things affected by newline-sensitive matching, the restrictions on parentheses and back references in lookahead constraints, and the longest/shortest-match @@ -782,41 +594,23 @@ as hard at guessing the user's real intentions.) Henry Spencer's original 1986 \fIregexp\fR package, still in widespread use (e.g., in pre-8.1 releases of Tcl), implemented an early version of today's EREs. There are four incompatibilities -between \fIregexp\fR's near-EREs -.PQ RRE "s for short" -and AREs. In roughly increasing order of significance: +between \fIregexp\fR's near-EREs (`RREs' for short) and AREs. In +roughly increasing order of significance: .IP \(bu 3 -In AREs, -.QW \fB\e\fR -followed by an alphanumeric character is either an +In AREs, \fB\e\fR followed by an alphanumeric character is either an escape or an error, while in RREs, it was just another way of writing the alphanumeric. This should not be a problem because there was no reason to write such a sequence in RREs. .IP \(bu 3 -.QW \fB{\fR -followed by a digit in an ARE is the beginning of a bound, -while in RREs, -.QW \fB{\fR -was always an ordinary character. Such +\fB{\fR followed by a digit in an ARE is the beginning of a bound, +while in RREs, \fB{\fR was always an ordinary character. Such sequences should be rare, and will often result in an error because following characters will not look like a valid bound. .IP \(bu 3 -In AREs, -.QW \fB\e\fR -remains a special character within -.QW \fB[\|]\fR , -so a literal -.QW \fB\e\fR -within -.QW \fB[\|]\fR -must be written -.QW \fB\e\e\fR . -.QW \fB\e\e\fR -also gives a literal -.QW \fB\e\fR -within -.QW \fB[\|]\fR -in RREs, but only truly paranoid programmers routinely doubled the backslash. +In AREs, \fB\e\fR remains a special character within `\fB[\|]\fR', so +a literal \fB\e\fR within \fB[\|]\fR must be written `\fB\e\e\fR'. +\fB\e\e\fR also gives a literal \fB\e\fR within \fB[\|]\fR in RREs, +but only truly paranoid programmers routinely doubled the backslash. .IP \(bu 3 AREs report the longest/shortest match for the RE, rather than the first found in a specified search order. This may affect some RREs @@ -828,54 +622,28 @@ complexity) but cases where the search order was exploited to deliberately find a match which was \fInot\fR the longest/shortest will need rewriting.) .SH "BASIC REGULAR EXPRESSIONS" -BREs differ from EREs in several respects. -.QW \fB|\fR , -.QW \fB+\fR , -and -.QW \fB?\fR -are ordinary characters and there is no equivalent for their -functionality. The delimiters for bounds are -.QW \fB\e{\fR -and -.QW \fB\e}\fR , -with -.QW \fB{\fR -and -.QW \fB}\fR -by themselves ordinary characters. The parentheses for nested subexpressions -are -.QW \fB\e(\fR -and -.QW \fB\e)\fR , -with -.QW \fB(\fR -and -.QW \fB)\fR -by themselves ordinary characters. -.QW \fB^\fR -is an ordinary character except at the beginning -of the RE or the beginning of a parenthesized subexpression, -.QW \fB$\fR +BREs differ from EREs in several respects. `\fB|\fR', `\fB+\fR', and +\fB?\fR are ordinary characters and there is no equivalent for their +functionality. The delimiters for bounds are \fB\e{\fR and +`\fB\e}\fR', with \fB{\fR and \fB}\fR by themselves ordinary +characters. The parentheses for nested subexpressions are \fB\e(\fR +and `\fB\e)\fR', with \fB(\fR and \fB)\fR by themselves ordinary +characters. \fB^\fR is an ordinary character except at the beginning +of the RE or the beginning of a parenthesized subexpression, \fB$\fR is an ordinary character except at the end of the RE or the end of a -parenthesized subexpression, and -.QW \fB*\fR -is an ordinary character if +parenthesized subexpression, and \fB*\fR is an ordinary character if it appears at the beginning of the RE or the beginning of a -parenthesized subexpression (after a possible leading -.QW \fB^\fR ). -Finally, single-digit back references are available, and -.QW \fB\e<\fR -and -.QW \fB\e>\fR -are synonyms for -.QW \fB[[:<:]]\fR -and -.QW \fB[[:>:]]\fR +parenthesized subexpression (after a possible leading `\fB^\fR'). +Finally, single-digit back references are available, and \fB\e<\fR and +\fB\e>\fR are synonyms for \fB[[:<:]]\fR and \fB[[:>:]]\fR respectively; no other escapes are available. + .SH "SEE ALSO" RegExp(3), regexp(n), regsub(n), lsearch(n), switch(n), text(n) + .SH KEYWORDS match, regular expression, string -.\" Local Variables: -.\" mode: nroff -.\" End: + +'\" Local Variables: +'\" mode: nroff +'\" End: diff --git a/doc/read.n b/doc/read.n index aca4c1d..59ad47b 100644 --- a/doc/read.n +++ b/doc/read.n @@ -5,7 +5,7 @@ '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. '\" -'\" RCS: @(#) $Id: read.n,v 1.12 2007/10/24 14:29:39 dkf Exp $ +'\" RCS: @(#) $Id: read.n,v 1.13 2007/10/26 20:11:53 dgp Exp $ '\" .so man.macros .TH read n 8.1 Tcl "Tcl Built-In Commands" @@ -53,8 +53,10 @@ newline characters according to the \fB\-translation\fR option for the channel. See the \fBfconfigure\fR manual entry for a discussion on ways in which \fBfconfigure\fR will alter input. + .SH "USE WITH SERIAL PORTS" -.\" Note: this advice actually applies to many versions of Tcl +'\" Note: this advice actually applies to many versions of Tcl + For most applications a channel connected to a serial port should be configured to be nonblocking: \fBfconfigure \fIchannelId \fB\-blocking \fI0\fR. Then \fBread\fR behaves much like described above. Care @@ -78,7 +80,9 @@ set data [\fBread\fR $fl] close $fl set lines [split $data \\n] .CE + .SH "SEE ALSO" file(n), eof(n), fblocked(n), fconfigure(n), Tcl_StandardChannels(3) + .SH KEYWORDS blocking, channel, end of line, end of file, nonblocking, read, translation, encoding diff --git a/doc/refchan.n b/doc/refchan.n index 89bef8f..a556555 100644 --- a/doc/refchan.n +++ b/doc/refchan.n @@ -4,7 +4,7 @@ '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. '\" -'\" RCS: @(#) $Id: refchan.n,v 1.6 2007/10/25 09:44:22 dkf Exp $ +'\" RCS: @(#) $Id: refchan.n,v 1.7 2007/10/26 20:11:53 dgp Exp $ .so man.macros .TH reflectedchan n 8.5 Tcl "Tcl Built-In Commands" .BS @@ -53,11 +53,8 @@ here, then the \fBfinalize\fR subcommand will not be called. .PP The \fImode\fR argument tells the handler whether the channel was opened for reading, writing, or both. It is a list containing any of -the strings -.QW "\fBread\fR" -or -.QW "\fBwrite\fR" . -The list will always contain at least one element. +the strings "\fBread\fR" or "\fBwrite\fR". The list will always +contain at least one element. .PP The subcommand must throw an error if the chosen mode is not supported by the \fIcmdPrefix\fR. @@ -89,11 +86,8 @@ aborted during \fBinitialize\fR (See above). . This subcommand notifies the \fIcmdPrefix\fR that the specified \fIchannelId\fR is interested in the events listed in the -\fIeventspec\fR. This argument is a list containing any of -.QW "\fBread\fR" -and -.QW "\fBwrite\fR" . -The list may be empty, which signals that the +\fIeventspec\fR. This argument is a list containing any of "\fBread\fR" +and "\fBwrite\fR". The list may be empty, which signals that the channel does not wish to be notified of any events. In that situation, the handler should disable event generation completely. .RS @@ -191,7 +185,7 @@ invocation (usually \fBseek\fR, or \fBtell\fR) will appear to have thrown this error. Any exception beyond \fIerror\fR (e.g. \fIbreak\fR, etc.) is treated as and converted to an error. .PP -The offset/base combination of 0/\fBcurrent\fR signals a \fBtell\fR +The offset/base combination of 0/"\fBcurrent\fR" signals a \fBtell\fR request, i.e. seek nothing relative to the current location, making the new location identical to the current one, which is then returned. .RE diff --git a/doc/regexp.n b/doc/regexp.n index a7243f4..bf0e0aa 100644 --- a/doc/regexp.n +++ b/doc/regexp.n @@ -4,7 +4,7 @@ '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. '\" -'\" RCS: @(#) $Id: regexp.n,v 1.22 2007/10/25 14:07:32 dkf Exp $ +'\" RCS: @(#) $Id: regexp.n,v 1.23 2007/10/26 20:11:53 dgp Exp $ '\" .so man.macros .TH regexp n 8.3 Tcl "Tcl Built-In Commands" @@ -12,6 +12,7 @@ '\" Note: do not modify the .SH NAME line immediately below! .SH NAME regexp \- Match a regular expression against a string + .SH SYNOPSIS \fBregexp \fR?\fIswitches\fR? \fIexp string \fR?\fImatchVar\fR? ?\fIsubMatchVar subMatchVar ...\fR? .BE @@ -61,37 +62,20 @@ range of characters. \fB\-line\fR Enables newline-sensitive matching. By default, newline is a completely ordinary character with no special meaning. With this -flag, -.QW [^ -bracket expressions and -.QW . -never match newline, -.QW ^ +flag, `[^' bracket expressions and `.' never match newline, `^' matches an empty string after any newline in addition to its normal -function, and -.QW $ -matches an empty string before any newline in +function, and `$' matches an empty string before any newline in addition to its normal function. This flag is equivalent to specifying both \fB\-linestop\fR and \fB\-lineanchor\fR, or the \fB(?n)\fR embedded option (see the \fBre_syntax\fR manual page). .TP 15 \fB\-linestop\fR -Changes the behavior of -.QW [^ -bracket expressions and -.QW . -so that they +Changes the behavior of `[^' bracket expressions and `.' so that they stop at newlines. This is the same as specifying the \fB(?p)\fR embedded option (see the \fBre_syntax\fR manual page). .TP 15 \fB\-lineanchor\fR -Changes the behavior of -.QW ^ -and -.QW $ -(the -.QW anchors ) -so they match the +Changes the behavior of `^' and `$' (the ``anchors'') so they match the beginning and end of a line respectively. This is the same as specifying the \fB(?w)\fR embedded option (see the \fBre_syntax\fR manual page). @@ -114,15 +98,12 @@ list will be concatenated at each iteration, such that a flat list is always returned. For each match iteration, the command will append the overall match data, plus one element for each subexpression in the regular expression. Examples are: -.RS .CS -.ta 2i -\fBregexp\fR -inline -- {\\w(\\w)} " inlined " - \fB\(->\fI in n\fR -\fBregexp\fR -all -inline -- {\\w(\\w)} " inlined " - \fB\(->\fI in n li i ne e\fR + regexp -inline -- {\\w(\\w)} " inlined " + => {in n} + regexp -all -inline -- {\\w(\\w)} " inlined " + => {in n li i ne e} .CE -.RE .TP 15 \fB\-start\fR \fIindex\fR Specifies a character index offset into the string to start @@ -131,8 +112,7 @@ matching the regular expression at. The \fIindex\fR value is interpreted in the same manner as the \fIindex\fR argument to \fBstring index\fR. .VE 8.5 -When using this switch, -.QW ^ +When using this switch, `^' will not match the beginning of the line, and \\A will still match the start of the string at \fIindex\fR. If \fB\-indices\fR is specified, the indices will be indexed starting from the @@ -143,13 +123,12 @@ absolute beginning of the input string. Marks the end of switches. The argument following this one will be treated as \fIexp\fR even if it starts with a \fB\-\fR. .PP -If there are more \fIsubMatchVar\fRs than parenthesized +If there are more \fIsubMatchVar\fR's than parenthesized subexpressions within \fIexp\fR, or if a particular subexpression in \fIexp\fR doesn't match the string (e.g. because it was in a portion of the expression that wasn't matched), then the corresponding -\fIsubMatchVar\fR will be set to -.QW "\fB\-1 \-1\fR" -if \fB\-indices\fR has been specified or to an empty string otherwise. +\fIsubMatchVar\fR will be set to ``\fB\-1 \-1\fR'' if \fB\-indices\fR +has been specified or to an empty string otherwise. .SH EXAMPLES Find the first occurrence of a word starting with \fBfoo\fR in a string that is not actually an instance of \fBfoobar\fR, and get the @@ -177,10 +156,13 @@ characters) in a string: .CS \fBregexp\fR \-all \-inline {\\S+} $string .CE + .SH "SEE ALSO" re_syntax(n), regsub(n), .VS 8.5 string(n) .VE + + .SH KEYWORDS match, regular expression, string diff --git a/doc/registry.n b/doc/registry.n index 1ea38f1..46c88b7 100644 --- a/doc/registry.n +++ b/doc/registry.n @@ -5,7 +5,7 @@ '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. '\" -'\" RCS: @(#) $Id: registry.n,v 1.16 2007/10/25 14:07:32 dkf Exp $ +'\" RCS: @(#) $Id: registry.n,v 1.17 2007/10/26 20:11:53 dgp Exp $ '\" .so man.macros .TH registry n 1.1 registry "Tcl Bundled Packages" @@ -152,9 +152,8 @@ represented in Tcl as a string. . The registry value contains a null-terminated string that contains unexpanded references to environment variables in the normal Windows -style (for example, -.QW "%PATH%" ). -The data is represented in Tcl as a string. +style (for example, "%PATH%"). The data is represented in Tcl as a +string. .TP \fBdword\fR . diff --git a/doc/regsub.n b/doc/regsub.n index 4cb8a7b..4dcf8a5 100644 --- a/doc/regsub.n +++ b/doc/regsub.n @@ -6,7 +6,7 @@ '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. '\" -'\" RCS: @(#) $Id: regsub.n,v 1.18 2007/10/24 14:29:39 dkf Exp $ +'\" RCS: @(#) $Id: regsub.n,v 1.19 2007/10/26 20:11:53 dgp Exp $ '\" .so man.macros .TH regsub n 8.3 Tcl "Tcl Built-In Commands" @@ -31,26 +31,16 @@ If there is a match, then while copying \fIstring\fR to \fIvarName\fR (or to the result of this command if \fIvarName\fR is not present) the portion of \fIstring\fR that matched \fIexp\fR is replaced with \fIsubSpec\fR. -If \fIsubSpec\fR contains a -.QW & -or -.QW \e0 , -then it is replaced in the substitution with the portion of \fIstring\fR that +If \fIsubSpec\fR contains a ``&'' or ``\e0'', then it is replaced +in the substitution with the portion of \fIstring\fR that matched \fIexp\fR. -If \fIsubSpec\fR contains a -.QW \e\fIn\fR , -where \fIn\fR is a digit +If \fIsubSpec\fR contains a ``\e\fIn\fR'', where \fIn\fR is a digit between 1 and 9, then it is replaced in the substitution with the portion of \fIstring\fR that matched the \fIn\fR-th parenthesized subexpression of \fIexp\fR. Additional backslashes may be used in \fIsubSpec\fR to prevent special -interpretation of -.QW & -or -.QW \e0 -or -.QW \e\fIn\fR -or backslash. +interpretation of ``&'' or ``\e0'' or ``\e\fIn\fR'' or +backslash. The use of backslashes in \fIsubSpec\fR tends to interact badly with the Tcl parser's use of backslashes, so it's generally safest to enclose \fIsubSpec\fR in braces if it includes @@ -65,10 +55,7 @@ All ranges in \fIstring\fR that match \fIexp\fR are found and substitution is performed for each of these ranges. Without this switch only the first matching range is found and substituted. -If \fB\-all\fR is specified, then -.QW & -and -.QW \e\fIn\fR +If \fB\-all\fR is specified, then ``&'' and ``\e\fIn\fR'' sequences are handled for each substitution using the information from the corresponding match. .TP 15 @@ -80,36 +67,20 @@ the \fB(?x)\fR embedded option (see the \fBre_syntax\fR manual page). \fB\-line\fR Enables newline-sensitive matching. By default, newline is a completely ordinary character with no special meaning. With this -flag, -.QW [^ -bracket expressions and -.QW . -never match newline, -.QW ^ +flag, `[^' bracket expressions and `.' never match newline, `^' matches an empty string after any newline in addition to its normal -function, and -.QW $ -matches an empty string before any newline in +function, and `$' matches an empty string before any newline in addition to its normal function. This flag is equivalent to specifying both \fB\-linestop\fR and \fB\-lineanchor\fR, or the \fB(?n)\fR embedded option (see the \fBre_syntax\fR manual page). .TP 15 \fB\-linestop\fR -Changes the behavior of -.QW [^ -bracket expressions and -.QW . -so that they stop at newlines. This is the same as specifying the \fB(?p)\fR +Changes the behavior of `[^' bracket expressions and `.' so that they +stop at newlines. This is the same as specifying the \fB(?p)\fR embedded option (see the \fBre_syntax\fR manual page). .TP 15 \fB\-lineanchor\fR -Changes the behavior of -.QW ^ -and -.QW $ -(the -.QW anchors ) -so they match the +Changes the behavior of `^' and `$' (the ``anchors'') so they match the beginning and end of a line respectively. This is the same as specifying the \fB(?w)\fR embedded option (see the \fBre_syntax\fR manual page). @@ -126,8 +97,7 @@ matching the regular expression at. The \fIindex\fR value is interpreted in the same manner as the \fIindex\fR argument to \fBstring index\fR. .VE 8.5 -When using this switch, -.QW ^ +When using this switch, `^' will not match the beginning of the line, and \\A will still match the start of the string at \fIindex\fR. \fIindex\fR will be constrained to the bounds of the input string. diff --git a/doc/return.n b/doc/return.n index 0137478..ea3f362 100644 --- a/doc/return.n +++ b/doc/return.n @@ -6,7 +6,7 @@ '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. '\" -'\" RCS: @(#) $Id: return.n,v 1.13 2007/10/25 09:49:18 dkf Exp $ +'\" RCS: @(#) $Id: return.n,v 1.14 2007/10/26 20:11:53 dgp Exp $ '\" .so man.macros .TH return n 8.5 Tcl "Tcl Built-In Commands" @@ -21,6 +21,7 @@ return \- Return from a procedure, or set return code of a script .sp \fBreturn \fR?\fIoption value \fR...? ?\fIresult\fR? .BE + .SH DESCRIPTION .PP In its simplest usage, the \fBreturn\fR command is used without options @@ -40,14 +41,14 @@ will be returned as the result of the \fBsource\fR command. .PP In addition to the result of a procedure, the return code of a procedure may also be set by \fBreturn\fR -through use of the \fB\-code\fR option. +through use of the \fB-code\fR option. In the usual case where the \fB\-code\fR option isn't specified the procedure will return normally. However, the \fB\-code\fR option may be used to generate an exceptional return from the procedure. \fICode\fR may have any of the following values: .TP 13 -\fBok (\fRor \fB0)\fR +\fBok (or 0)\fR Normal return: same as if the option is omitted. The return code of the procedure is 0 (\fBTCL_OK\fR). .TP 13 @@ -77,8 +78,7 @@ were the command \fBcontinue\fR. return code for the current procedure. .LP When a procedure wants to signal that it has received invalid -arguments from its caller, it may use -.QW "\fBreturn \-code error\fR" +arguments from its caller, it may use \fBreturn -code error\fR with \fIresult\fR set to a suitable error message. Otherwise usage of the \fBreturn -code\fR option is mostly limited to procedures that implement a new control structure. @@ -86,9 +86,8 @@ procedures that implement a new control structure. The \fBreturn -code\fR command acts similarly within script files that are evaluated by the \fBsource\fR command. During the evaluation of the contents of a file as a script by \fBsource\fR, -an invocation of the -.QW "\fBreturn -code \fIcode\fR" -command will cause the return code of \fBsource\fR to be \fIcode\fR. +an invocation of the \fBreturn -code \fIcode\fR command will cause +the return code of \fBsource\fR to be \fIcode\fR. .SH "RETURN OPTIONS" .PP .VS 8.5 @@ -97,56 +96,56 @@ in Tcl also produces a dictionary of return options. In general usage, all \fIoption value\fR pairs given as arguments to \fBreturn\fR become entries in the return options dictionary, and any values at all are acceptable except as noted below. The \fBcatch\fR command may be -used to capture all of this information \(em the return code, the result, -and the return options dictionary \(em that arise from evaluation of a script. +used to capture all of this information -- the return code, the result, +and the return options dictionary -- that arise from evaluation of a script. .VE 8.5 .PP -As documented above, the \fB\-code\fR entry in the return options dictionary +As documented above, the \fB-code\fR entry in the return options dictionary receives special treatment by Tcl. There are other return options also recognized and treated specially by Tcl. They are: .TP -\fB\-errorcode \fIlist\fR -The \fB\-errorcode\fR option receives special treatment only when the value -of the \fB\-code\fR option is \fBTCL_ERROR\fR. Then the \fIlist\fR value +\fB-errorcode \fIlist\fR +The \fB-errorcode\fR option receives special treatment only when the value +of the \fB-code\fR option is \fBTCL_ERROR\fR. Then the \fIlist\fR value is meant to be additional information about the error, presented as a Tcl list for further processing by programs. -If no \fB\-errorcode\fR option is provided to \fBreturn\fR when -the \fB\-code error\fR option is provided, Tcl will set the value -of the \fB\-errorcode\fR entry in the return options dictionary -to the default value of \fBNONE\fR. The \fB\-errorcode\fR return +If no \fB-errorcode\fR option is provided to \fBreturn\fR when +the \fB-code error\fR option is provided, Tcl will set the value +of the \fB-errorcode\fR entry in the return options dictionary +to the default value of \fBNONE\fR. The \fB-errorcode\fR return option will also be stored in the global variable \fBerrorCode\fR. .TP -\fB\-errorinfo \fIinfo\fR -The \fB\-errorinfo\fR option receives special treatment only when the value -of the \fB\-code\fR option is \fBTCL_ERROR\fR. Then \fIinfo\fR is the initial +\fB-errorinfo \fIinfo\fR +The \fB-errorinfo\fR option receives special treatment only when the value +of the \fB-code\fR option is \fBTCL_ERROR\fR. Then \fIinfo\fR is the initial stack trace, meant to provide to a human reader additional information about the context in which the error occurred. The stack trace will also be stored in the global variable \fBerrorInfo\fR. -If no \fB\-errorinfo\fR option is provided to \fBreturn\fR when -the \fB\-code error\fR option is provided, Tcl will provide its own -initial stack trace value in the entry for \fB\-errorinfo\fR. Tcl's +If no \fB-errorinfo\fR option is provided to \fBreturn\fR when +the \fB-code error\fR option is provided, Tcl will provide its own +initial stack trace value in the entry for \fB-errorinfo\fR. Tcl's initial stack trace will include only the call to the procedure, and stack unwinding will append information about higher stack levels, but there will be no information about the context of the error within the procedure. Typically the \fIinfo\fR value is supplied from -the value of \fB\-errorinfo\fR in a return options dictionary captured +the value of \fB-errorinfo\fR in a return options dictionary captured by the \fBcatch\fR command (or from the copy of that information stored in the global variable \fBerrorInfo\fR). .TP -\fB\-level \fIlevel\fR +\fB-level \fIlevel\fR .VS 8.5 -The \fB\-level\fR and \fB\-code\fR options work together to set the return +The \fB-level\fR and \fB-code\fR options work together to set the return code to be returned by one of the commands currently being evaluated. The \fIlevel\fR value must be a non-negative integer representing a number of levels on the call stack. It defines the number of levels up the stack at which the return code of a command currently being evaluated should -be \fIcode\fR. If no \fB\-level\fR option is provided, the default value +be \fIcode\fR. If no \fB-level\fR option is provided, the default value of \fIlevel\fR is 1, so that \fBreturn\fR sets the return code that the current procedure returns to its caller, 1 level up the call stack. The mechanism by which these options work is described in more detail below. .VE 8.5 .TP -\fB\-options \fIoptions\fR +\fB-options \fIoptions\fR .VS 8.5 The value \fIoptions\fR must be a valid dictionary. The entries of that dictionary are treated as additional \fIoption value\fR pairs for the @@ -170,8 +169,8 @@ evaluation to terminate without evaluating all commands in sequence. Some of Tcl's built-in commands evaluate scripts as part of their functioning. These commands can make use of exceptional return codes to enable special features. For example, the built-in -Tcl commands that provide loops \(em such as \fBwhile\fR, \fBfor\fR, -and \fBforeach\fR \(em evaluate a script that is the body of the +Tcl commands that provide loops -- such as \fBwhile\fR, \fBfor\fR, +and \fBforeach\fR -- evaluate a script that is the body of the loop. If evaluation of the loop body returns the return code of \fBTCL_BREAK\fR or \fBTCL_CONTINUE\fR, the loop command can react in such a way as to give the \fBbreak\fR and \fBcontinue\fR commands @@ -181,16 +180,16 @@ their documented interpretation in loops. Procedure invocation also involves evaluation of a script, the body of the procedure. Procedure invocation provides special treatment when evaluation of the procedure body returns the return code -\fBTCL_RETURN\fR. In that circumstance, the \fB\-level\fR entry in the +\fBTCL_RETURN\fR. In that circumstance, the \fB-level\fR entry in the return options dictionary is decremented. If after decrementing, -the value of the \fB\-level\fR entry is 0, then the value of -the \fB\-code\fR entry becomes the return code of the procedure. -If after decrementing, the value of the \fB\-level\fR entry is +the value of the \fB-level\fR entry is 0, then the value of +the \fB-code\fR entry becomes the return code of the procedure. +If after decrementing, the value of the \fB-level\fR entry is greater than zero, then the return code of the procedure is \fBTCL_RETURN\fR. If the procedure invocation occurred during the evaluation of the body of another procedure, the process will repeat itself up the call stack, decrementing the value of the -\fB\-level\fR entry at each level, so that the \fIcode\fR will +\fB-level\fR entry at each level, so that the \fIcode\fR will be the return code of the current command \fIlevel\fR levels up the call stack. The \fBsource\fR command performs the same handling of the \fBTCL_RETURN\fR return code, which explains @@ -199,10 +198,10 @@ to \fBreturn\fR invocation within a procedure. .PP The return code of the \fBreturn\fR command itself triggers this special handling by procedure invocation. If \fBreturn\fR -is provided the option \fB\-level 0\fR, then the return code +is provided the option \fB-level 0\fR, then the return code of the \fBreturn\fR command itself will be the value \fIcode\fR -of the \fB\-code\fR option (or \fBTCL_OK\fR by default). Any other value -for the \fB\-level\fR option (including the default value of 1) +of the \fB-code\fR option (or \fBTCL_OK\fR by default). Any other value +for the \fB-level\fR option (including the default value of 1) will cause the return code of the \fBreturn\fR command itself to be \fBTCL_RETURN\fR, triggering a return from the enclosing procedure. .VE 8.5 @@ -224,15 +223,14 @@ proc returnX {} {\fBreturn\fR X} puts [returnX] ;# prints "X" .CE .PP -Next, a more complete example, using -.QW "\fBreturn \-code error\fR" +Next, a more complete example, using \fBreturn -code error\fR to report invalid arguments. .CS proc factorial {n} { if {![string is integer $n] || ($n < 0)} { - \fBreturn\fR -code error \e - "expected non-negative integer,\e - but got \e"$n\e"" + \fBreturn\fR -code error \\ + "expected non-negative integer,\\ + but got \\"$n\\"" } if {$n < 2} { \fBreturn\fR 1 @@ -244,7 +242,7 @@ proc factorial {n} { } set product [expr {$n * $factor}] if {$product < 0} { - \fBreturn\fR -code error \e + \fBreturn\fR -code error \\ "overflow computing factorial of $n" } \fBreturn\fR $product @@ -259,13 +257,13 @@ proc myBreak {} { .CE .PP .VS 8.5 -With the \fB\-level 0\fR option, \fBreturn\fR itself can serve +With the \fB-level 0\fR option, \fBreturn\fR itself can serve as a replacement for \fBbreak\fR. .CS interp alias {} Break {} \fBreturn\fR -level 0 -code break .CE .PP -An example of using \fBcatch\fR and \fBreturn \-options\fR to +An example of using \fBcatch\fR and \fBreturn -options\fR to re-raise a caught error: .CS proc doSomething {} { @@ -294,8 +292,9 @@ proc myReturn {args} { } .CE .VE 8.5 + .SH "SEE ALSO" -break(n), catch(n), continue(n), dict(n), error(n), proc(n), source(n), -tclvars(n) +break(n), catch(n), continue(n), dict(n), error(n), proc(n), source(n), tclvars(n) + .SH KEYWORDS break, catch, continue, error, procedure, return diff --git a/doc/scan.n b/doc/scan.n index bd59e60..c504df3 100644 --- a/doc/scan.n +++ b/doc/scan.n @@ -6,7 +6,7 @@ '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. '\" -'\" RCS: @(#) $Id: scan.n,v 1.20 2007/10/24 14:29:39 dkf Exp $ +'\" RCS: @(#) $Id: scan.n,v 1.21 2007/10/26 20:11:53 dgp Exp $ '\" .so man.macros .TH scan n 8.4 Tcl "Tcl Built-In Commands" @@ -60,8 +60,7 @@ conversion specifier and stores the result in the variable given by the next argument to \fBscan\fR. .PP If the \fB%\fR is followed by a decimal number and a \fB$\fR, as in -.QW \fB%2$d\fR , -then the variable to use is not taken from the next +``\fB%2$d\fR'', then the variable to use is not taken from the next sequential argument. Instead, it is taken from the argument indicated by the number, where 1 corresponds to the first \fIvarName\fR. If there are any positional specifiers in \fIformat\fR then all of the diff --git a/doc/source.n b/doc/source.n index a5b6ebe..c12efff 100644 --- a/doc/source.n +++ b/doc/source.n @@ -6,7 +6,7 @@ '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. '\" -'\" RCS: @(#) $Id: source.n,v 1.13 2007/10/25 14:07:32 dkf Exp $ +'\" RCS: @(#) $Id: source.n,v 1.14 2007/10/26 20:11:53 dgp Exp $ '\" .so man.macros .TH source n "" Tcl "Tcl Built-In Commands" @@ -21,6 +21,7 @@ source \- Evaluate a file or resource as a Tcl script \fBsource\fR \fB\-encoding \fIencodingName fileName\fR .VE 8.5 .BE + .SH DESCRIPTION .PP This command takes the contents of the specified file or resource @@ -32,21 +33,13 @@ If a \fBreturn\fR command is invoked from within the script then the remainder of the file will be skipped and the \fBsource\fR command will return normally with the result from the \fBreturn\fR command. .PP -The end-of-file character for files is -.QW \e032 -(^Z) for all platforms. The source command will read files up to this -character. This +The end-of-file character for files is '\\32' (^Z) for all platforms. +The source command will read files up to this character. This restriction does not exist for the \fBread\fR or \fBgets\fR commands, allowing for files containing code and data segments (scripted documents). -If you require a -.QW ^Z -in code for string comparison, you can use -.QW \e032 -or -.QW \eu001a , -which will be safely substituted by the Tcl -interpreter into -.QW ^Z . +If you require a ``^Z'' in code for string comparison, you can use +``\\032'' or ``\\u001a'', which will be safely substituted by the Tcl +interpreter into ``^Z''. .PP .VS 8.5 The \fB-encoding\fR option is used to specify the encoding of @@ -60,14 +53,15 @@ file \fBbar.tcl\fR: \fBsource\fR foo.tcl \fBsource\fR bar.tcl .CE -.PP Alternatively: .CS foreach scriptFile {foo.tcl bar.tcl} { \fBsource\fR $scriptFile } .CE + .SH "SEE ALSO" file(n), cd(n), encoding(n), info(n) + .SH KEYWORDS file, script diff --git a/doc/split.n b/doc/split.n index c41aada..48a83cf 100644 --- a/doc/split.n +++ b/doc/split.n @@ -5,7 +5,7 @@ '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. '\" -'\" RCS: @(#) $Id: split.n,v 1.6 2007/10/25 09:25:27 dkf Exp $ +'\" RCS: @(#) $Id: split.n,v 1.7 2007/10/26 20:11:53 dgp Exp $ '\" .so man.macros .TH split n "" Tcl "Tcl Built-In Commands" @@ -16,6 +16,7 @@ split \- Split a string into a proper Tcl list .SH SYNOPSIS \fBsplit \fIstring \fR?\fIsplitChars\fR? .BE + .SH DESCRIPTION .PP Returns a list created by splitting \fIstring\fR at each character @@ -32,32 +33,28 @@ If \fIsplitChars\fR is an empty string then each character of .SH EXAMPLES Divide up a USENET group name into its hierarchical components: .CS -.ta 2i \fBsplit\fR "comp.lang.tcl.announce" . - \fB\(->\fI comp lang tcl announce\fR + \fI=> comp lang tcl announce\fR .CE .PP See how the \fBsplit\fR command splits on \fIevery\fR character in \fIsplitChars\fR, which can result in information loss if you are not careful: .CS -.ta 2i \fBsplit\fR "alpha beta gamma" "temp" - \fB\(->\fI al {ha b} {} {a ga} {} a\fR + \fI=> al {ha b} {} {a ga} {} a\fR .CE .PP Extract the list words from a string that is not a well-formed list: .CS -.ta 2i \fBsplit\fR "Example with {unbalanced brace character" - \fB\(->\fI Example with \\{unbalanced brace character\fR + \fI=> Example with \\{unbalanced brace character\fR .CE .PP Split a string into its constituent characters .CS -.ta 2i \fBsplit\fR "Hello world" {} - \fB\(->\fI H e l l o { } w o r l d\fR + \fI=> H e l l o { } w o r l d\fR .CE .SS "PARSING RECORD-ORIENTED FILES" Parse a Unix /etc/passwd file, which consists of one entry per line, @@ -83,7 +80,9 @@ foreach rec $records { puts "$longName uses [file tail $shell] for a login shell" } .CE + .SH "SEE ALSO" join(n), list(n), string(n) + .SH KEYWORDS list, split, string diff --git a/doc/string.n b/doc/string.n index 3860c96..9745caf 100644 --- a/doc/string.n +++ b/doc/string.n @@ -5,7 +5,7 @@ .\" See the file "license.terms" for information on usage and redistribution .\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. .\" -.\" RCS: @(#) $Id: string.n,v 1.37 2007/10/25 14:07:32 dkf Exp $ +.\" RCS: @(#) $Id: string.n,v 1.38 2007/10/26 20:11:53 dgp Exp $ .\" .so man.macros .TH string n 8.1 Tcl "Tcl Built-In Commands" @@ -16,13 +16,13 @@ string \- Manipulate strings .SH SYNOPSIS \fBstring \fIoption arg \fR?\fIarg ...?\fR .BE + .SH DESCRIPTION .PP Performs one of several string operations, depending on \fIoption\fR. The legal \fIoption\fRs (which may be abbreviated) are: .TP \fBstring bytelength \fIstring\fR -. Returns a decimal string giving the number of bytes used to represent \fIstring\fR in memory. Because UTF\-8 uses one to three bytes to represent Unicode characters, the byte length will not be the same as @@ -33,7 +33,6 @@ Tcl ByteArray object). Refer to the \fBTcl_NumUtfChars\fR manual entry for more details on the UTF\-8 representation. .TP \fBstring compare\fR ?\fB\-nocase\fR? ?\fB\-length int\fR? \fIstring1 string2\fR -. Perform a character-by-character comparison of strings \fIstring1\fR and \fIstring2\fR. Returns \-1, 0, or 1, depending on whether \fIstring1\fR is lexicographically less than, equal to, or greater @@ -43,7 +42,6 @@ first \fIlength\fR characters are used in the comparison. If specified, then the strings are compared in a case-insensitive manner. .TP \fBstring equal\fR ?\fB\-nocase\fR? ?\fB-length int\fR? \fIstring1 string2\fR -. Perform a character-by-character comparison of strings \fIstring1\fR and \fIstring2\fR. Returns 1 if \fIstring1\fR and \fIstring2\fR are identical, or 0 when not. If \fB\-length\fR is specified, then only @@ -52,7 +50,6 @@ the first \fIlength\fR characters are used in the comparison. If specified, then the strings are compared in a case-insensitive manner. .TP \fBstring first \fIneedleString haystackString\fR ?\fIstartIndex\fR? -. Search \fIhaystackString\fR for a sequence of characters that exactly match the characters in \fIneedleString\fR. If found, return the index of the first character in the first such match within \fIhaystackString\fR. If not @@ -72,7 +69,6 @@ will return \fB\-1\fR. .RE .TP \fBstring index \fIstring charIndex\fR -. Returns the \fIcharIndex\fR'th character of the \fIstring\fR argument. A \fIcharIndex\fR of 0 corresponds to the first character of the string. \fIcharIndex\fR may be specified as follows: @@ -81,42 +77,24 @@ string. \fIcharIndex\fR may be specified as follows: .IP \fIinteger\fR 10 For any index value that passes \fBstring is integer -strict\fR, the char specified at this integral index -(e.g. \fB2\fR would refer to the -.QW "c" -in -.QW "abcd" ). +(e.g. \fB2\fR would refer to the "c" in "abcd"). .IP \fBend\fR 10 The last char of the string -(e.g. \fBend\fR would refer to the -.QW "d" -in -.QW "abcd" ). +(e.g. \fBend\fR would refer to the "d" in "abcd"). .IP \fBend\fR\-\fIN\fR 10 The last char of the string minus the specified integer offset \fIN\fR -(e.g. \fBend\fR\-1 would refer to the -.QW "c" -in -.QW "abcd" ). +(e.g. \fBend\fR\-1 would refer to the "c" in "abcd"). .IP \fBend\fR+\fIN\fR 10 The last char of the string plus the specified integer offset \fIN\fR -(e.g. \fBend\fR+\-1 would refer to the -.QW "c" -in -"abcd" ). +(e.g. \fBend\fR+\-1 would refer to the "c" in "abcd"). .IP \fIM\fR+\fIN\fR 10 The char specified at the integral index that is the sum of integer values \fIM\fR and \fIN\fR -(e.g. \fB1+1\fR would refer to the -.QW "c" -in -.QW "abcd" ). +(e.g. \fB1+1\fR would refer to the "c" in "abcd"). .IP \fIM\fR\-\fIN\fR 10 The char specified at the integral index that is the difference of integer values \fIM\fR and \fIN\fR -(e.g. \fB2\-1\fR would refer to the -.QW "b" -in -.QW "abcd" ). +(e.g. \fB2\-1\fR would refer to the "b" in "abcd"). .PP In the specifications above, the integer value \fIM\fR contains no trailing whitespace and the integer value \fIN\fR contains no @@ -128,7 +106,6 @@ length of the string then this command returns an empty string. .VE .TP \fBstring is \fIclass\fR ?\fB\-strict\fR? ?\fB\-failindex \fIvarname\fR? \fIstring\fR -. Returns 1 if \fIstring\fR is a valid member of the specified character class, otherwise returns 0. If \fB\-strict\fR is specified, then an empty string returns 0, otherwise an empty string will return 1 on @@ -168,9 +145,8 @@ the value, 0 is returned and the \fIvarname\fR will contain \-1. .IP \fBlist\fR 12 Any proper list structure, with optional surrounding whitespace. In case of improper list structure, 0 is returned and the \fIvarname\fR -will contain the index of the -.QW element -where the list parsing fails, or \-1 if this cannot be determined. +will contain the index of the "element" where the list parsing fails, +or \-1 if this cannot be determined. .IP \fBlower\fR 12 Any Unicode lower case alphabet character. .IP \fBprint\fR 12 @@ -202,7 +178,6 @@ function will return 0, then the \fIvarname\fR will always be set to .RE .TP \fBstring last \fIneedleString haystackString\fR ?\fIlastIndex\fR? -. Search \fIhaystackString\fR for a sequence of characters that exactly match the characters in \fIneedleString\fR. If found, return the index of the first character in the last such match within \fIhaystackString\fR. If there @@ -222,7 +197,6 @@ will return \fB1\fR. .RE .TP \fBstring length \fIstring\fR -. Returns a decimal string giving the number of characters in \fIstring\fR. Note that this is not necessarily the same as the number of bytes used to store the string. If the object is a @@ -230,7 +204,6 @@ ByteArray object (such as those returned from reading a binary encoded channel), then this will return the actual byte length of the object. .TP \fBstring map\fR ?\fB\-nocase\fR? \fImapping string\fR -. Replaces substrings in \fIstring\fR based on the key-value pairs in \fImapping\fR. \fImapping\fR is a list of \fIkey value key value ...\fR as in the form returned by \fBarray get\fR. Each instance of a @@ -257,7 +230,6 @@ it will return the string \fB02c322c222c\fR. .RE .TP \fBstring match\fR ?\fB\-nocase\fR? \fIpattern\fR \fIstring\fR -. See if \fIpattern\fR matches \fIstring\fR; return 1 if it does, 0 if it doesn't. If \fB\-nocase\fR is specified, then the pattern attempts to match against the string in a case insensitive manner. For the two @@ -274,27 +246,17 @@ Matches any character in the set given by \fIchars\fR. If a sequence of the form \fIx\fB\-\fIy\fR appears in \fIchars\fR, then any character between \fIx\fR and \fIy\fR, inclusive, will match. When used with \fB\-nocase\fR, the end points of the range are converted to -lower case first. Whereas -.QW [A\-z] -matches -.QW _ -when matching case-sensitively (since -.QW _ -falls between the -.QW Z -and -.QW a ), -with \fB\-nocase\fR this is considered like -.QW [A\-Za\-z] -(and probably what was meant in the first place). +lower case first. Whereas {[A\-z]} matches '_' when matching +case-sensitively ('_' falls between the 'Z' and 'a'), with +\fB\-nocase\fR this is considered like {[A\-Za\-z]} (and probably what +was meant in the first place). .IP \fB\e\fIx\fR 10 -Matches the single character \fIx\fR. This provides a way of avoiding +Matches the single character \fIx\fR. This provides a way of avoiding the special interpretation of the characters \fB*?[]\e\fR in \fIpattern\fR. .RE .TP \fBstring range \fIstring first last\fR -. Returns a range of consecutive characters from \fIstring\fR, starting with the character whose index is \fIfirst\fR and ending with the character whose index is \fIlast\fR. An index of 0 refers to the first @@ -306,12 +268,9 @@ equal to the length of the string then it is treated as if it were string is returned. .TP \fBstring repeat \fIstring count\fR -. -Returns the concatenation of \fIstring\fR repeated \fIcount\fR number -of times. +Returns \fIstring\fR repeated \fIcount\fR number of times. .TP \fBstring replace \fIstring first last\fR ?\fInewstring\fR? -. Removes a range of consecutive characters from \fIstring\fR, starting with the character whose index is \fIfirst\fR and ending with the character whose index is \fIlast\fR. An index of 0 refers to the @@ -323,16 +282,14 @@ and if \fIlast\fR is greater than or equal to the length of the string then it is treated as if it were \fBend\fR. If \fIfirst\fR is greater than \fIlast\fR or the length of the initial string, or \fIlast\fR is less than 0, then the initial string is returned untouched. +.VS 8.5 .TP \fBstring reverse \fIstring\fR -. -.VS 8.5 Returns a string that is the same length as \fIstring\fR but with its characters in the reverse order. .VE 8.5 .TP \fBstring tolower \fIstring\fR ?\fIfirst\fR? ?\fIlast\fR? -. Returns a value equal to \fIstring\fR except that all upper (or title) case letters have been converted to lower case. If \fIfirst\fR is specified, it refers to the first char index in the string to start @@ -341,7 +298,6 @@ the string to stop at (inclusive). \fIfirst\fR and \fIlast\fR may be specified as for the \fBindex\fR method. .TP \fBstring totitle \fIstring\fR ?\fIfirst\fR? ?\fIlast\fR? -. Returns a value equal to \fIstring\fR except that the first character in \fIstring\fR is converted to its Unicode title case variant (or upper case if there is no title case variant) and the rest of the @@ -352,7 +308,6 @@ stop at (inclusive). \fIfirst\fR and \fIlast\fR may be specified as for the \fBindex\fR method. .TP \fBstring toupper \fIstring\fR ?\fIfirst\fR? ?\fIlast\fR? -. Returns a value equal to \fIstring\fR except that all lower (or title) case letters have been converted to upper case. If \fIfirst\fR is specified, it refers to the first char index in the string to start @@ -361,28 +316,24 @@ the string to stop at (inclusive). \fIfirst\fR and \fIlast\fR may be specified as for the \fBindex\fR method. .TP \fBstring trim \fIstring\fR ?\fIchars\fR? -. Returns a value equal to \fIstring\fR except that any leading or trailing characters present in the string given by \fIchars\fR are removed. If \fIchars\fR is not specified then white space is removed (spaces, tabs, newlines, and carriage returns). .TP \fBstring trimleft \fIstring\fR ?\fIchars\fR? -. Returns a value equal to \fIstring\fR except that any leading characters present in the string given by \fIchars\fR are removed. If \fIchars\fR is not specified then white space is removed (spaces, tabs, newlines, and carriage returns). .TP \fBstring trimright \fIstring\fR ?\fIchars\fR? -. Returns a value equal to \fIstring\fR except that any trailing characters present in the string given by \fIchars\fR are removed. If \fIchars\fR is not specified then white space is removed (spaces, tabs, newlines, and carriage returns). .TP \fBstring wordend \fIstring charIndex\fR -. Returns the index of the character just after the last one in the word containing character \fIcharIndex\fR of \fIstring\fR. \fIcharIndex\fR may be specified as for the \fBindex\fR method. A word is @@ -391,7 +342,6 @@ or decimal digits) or underscore (Unicode connector punctuation) characters, or any single character other than these. .TP \fBstring wordstart \fIstring charIndex\fR -. Returns the index of the first character in the word containing character \fIcharIndex\fR of \fIstring\fR. \fIcharIndex\fR may be specified as for the \fBindex\fR method. A word is considered to be any @@ -409,11 +359,14 @@ if {$length == 0} { set isPrefix [\fBstring equal\fR -length $length $string "foobar"] } .CE + .SH "SEE ALSO" expr(n), list(n) + .SH KEYWORDS case conversion, compare, index, match, pattern, string, word, equal, ctype, character, reverse + .\" Local Variables: .\" mode: nroff .\" End: diff --git a/doc/subst.n b/doc/subst.n index 676beeb..34c82a9 100644 --- a/doc/subst.n +++ b/doc/subst.n @@ -6,7 +6,7 @@ '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. '\" -'\" RCS: @(#) $Id: subst.n,v 1.11 2007/10/26 12:25:06 dkf Exp $ +'\" RCS: @(#) $Id: subst.n,v 1.12 2007/10/26 20:11:53 dgp Exp $ '\" .so man.macros .TH subst n 7.4 Tcl "Tcl Built-In Commands" @@ -56,9 +56,7 @@ will be substituted for that entire command or variable substitution or any other return code is returned during command or variable substitution, then the returned value is substituted for that substitution. See the EXAMPLES below. In this way, all exceptional -return codes are -.QW caught -by \fBsubst\fR. The \fBsubst\fR command +return codes are ``caught'' by \fBsubst\fR. The \fBsubst\fR command itself will either return an error, or will complete successfully. .SH EXAMPLES .PP @@ -69,19 +67,13 @@ command substitutions) so the script set a 44 \fBsubst\fR {xyz {$a}} .CE -returns -.QW "\fBxyz {44}\fR" , -not -.QW "\fBxyz {$a}\fR" +returns ``\fBxyz {44}\fR'', not ``\fBxyz {$a}\fR'' and the script .CS -set a "p\e} q \e{r" +set a "p\\} q \\{r" \fBsubst\fR {xyz {$a}} .CE -return -.QW "\fBxyz {p} q {r}\fR" , -not -.QW "\fBxyz {p\e} q \e{r}\fR" . +return ``\fBxyz {p} q {r}\fR'', not ``\fBxyz {p\\} q \\{r}\fR''. .PP When command substitution is performed, it includes any variable substitution necessary to evaluate the script. @@ -89,11 +81,7 @@ substitution necessary to evaluate the script. set a 44 \fBsubst\fR -novariables {$a [format $a]} .CE -returns -.QW "\fB$a 44\fR" , -not -.QW "\fB$a $a\fR" . -Similarly, when +returns ``\fB$a 44\fR'', not ``\fB$a $a\fR''. Similarly, when variable substitution is performed, it includes any command substitution necessary to retrieve the value of the variable. .CS @@ -101,10 +89,7 @@ proc b {} {return c} array set a {c c [b] tricky} \fBsubst\fR -nocommands {[b] $a([b])} .CE -returns -.QW "\fB[b] c\fR" , -not -.QW "\fB[b] tricky\fR". +returns ``\fB[b] c\fR'', not ``\fB[b] tricky\fR''. .PP The continue and break exceptions allow command substitutions to prevent substitution of the rest of the command substitution and the @@ -113,35 +98,22 @@ when processing text using \fIsubst\fR. For example, the script .CS \fBsubst\fR {abc,[break],def} .CE -returns -.QW \fBabc,\fR , -not -.QW \fBabc,,def\fR -and the script +returns ``\fBabc,\fR'', not ``\fBabc,,def\fR'' and the script .CS \fBsubst\fR {abc,[continue;expr {1+2}],def} .CE -returns -.QW \fBabc,,def\fR , -not -.QW \fBabc,3,def\fR . +returns ``\fBabc,,def\fR'', not ``\fBabc,3,def\fR''. .PP Other exceptional return codes substitute the returned value .CS \fBsubst\fR {abc,[return foo;expr {1+2}],def} .CE -returns -.QW \fBabc,foo,def\fR , -not -.QW \fBabc,3,def\fR -and +returns ``\fBabc,foo,def\fR'', not ``\fBabc,3,def\fR'' and .CS \fBsubst\fR {abc,[return -code 10 foo;expr {1+2}],def} .CE -also returns -.QW \fBabc,foo,def\fR , -not -.QW \fBabc,3,def\fR . +also returns ``\fBabc,foo,def\fR'', not ``\fBabc,3,def\fR''. + .SH "SEE ALSO" Tcl(n), eval(n), break(n), continue(n) diff --git a/doc/switch.n b/doc/switch.n index cdd15aa..40e5918 100644 --- a/doc/switch.n +++ b/doc/switch.n @@ -5,7 +5,7 @@ '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. '\" -'\" RCS: @(#) $Id: switch.n,v 1.11 2007/10/24 14:29:39 dkf Exp $ +'\" RCS: @(#) $Id: switch.n,v 1.12 2007/10/26 20:11:53 dgp Exp $ '\" .so man.macros .TH switch n 8.5 Tcl "Tcl Built-In Commands" @@ -102,12 +102,9 @@ no command or variable substitutions are performed on them; this makes the behavior of the second form different than the first form in some cases. .PP -If a \fIbody\fR is specified as -.QW \fB\-\fR -it means that the \fIbody\fR +If a \fIbody\fR is specified as ``\fB\-\fR'' it means that the \fIbody\fR for the next pattern should also be used as the body for this -pattern (if the next pattern also has a body of -.QW \fB\-\fR +pattern (if the next pattern also has a body of ``\fB\-\fR'' then the body after that is used, and so on). This feature makes it possible to share a single \fIbody\fR among several patterns. diff --git a/doc/tclsh.1 b/doc/tclsh.1 index cdb0ee3..c9b3cf8 100644 --- a/doc/tclsh.1 +++ b/doc/tclsh.1 @@ -5,7 +5,7 @@ '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. '\" -'\" RCS: @(#) $Id: tclsh.1,v 1.11 2007/10/24 14:29:39 dkf Exp $ +'\" RCS: @(#) $Id: tclsh.1,v 1.12 2007/10/26 20:11:53 dgp Exp $ '\" .so man.macros .TH tclsh 1 "" Tcl "Tcl Applications" @@ -48,11 +48,7 @@ the medium, or by the character, '\\032' ('\\u001a', control-Z). If this character is present in the file, the \fBtclsh\fR application will read text up to but not including the character. An application that requires this character in the file may safely encode it as -.QW \e032 , -.QW \ex1a , -or -.QW \eu001a ; -or may generate it by use of commands +``\\032'', ``\\x1a'', or ``\\u001a''; or may generate it by use of commands such as \fBformat\fR or \fBbinary\fR. There is no automatic evaluation of \fB.tclshrc\fR when the name of a script file is presented on the \fBtclsh\fR command @@ -127,9 +123,7 @@ device), 0 otherwise. .SH PROMPTS .PP When \fBtclsh\fR is invoked interactively it normally prompts for each -command with -.QW "\fB% \fR" . -You can change the prompt by setting the +command with ``\fB% \fR''. You can change the prompt by setting the variables \fBtcl_prompt1\fR and \fBtcl_prompt2\fR. If variable \fBtcl_prompt1\fR exists then it must consist of a Tcl script to output a prompt; instead of outputting a prompt \fBtclsh\fR diff --git a/doc/tcltest.n b/doc/tcltest.n index 4691229..91d145e 100644 --- a/doc/tcltest.n +++ b/doc/tcltest.n @@ -8,7 +8,7 @@ '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. '\" -'\" RCS: @(#) $Id: tcltest.n,v 1.50 2007/10/25 14:07:32 dkf Exp $ +'\" RCS: @(#) $Id: tcltest.n,v 1.51 2007/10/26 20:11:53 dgp Exp $ '\" .so man.macros .TH "tcltest" n 2.3 tcltest "Tcl Bundled Packages" @@ -79,12 +79,12 @@ in and exported from the \fB::tcltest\fR namespace, as indicated in the \fBSYNOPSIS\fR above. In the following sections, all commands will be described by their simple names, in the interest of brevity. .PP -The central command of \fBtcltest\fR is \fBtest\fR that defines -and runs a test. Testing with \fBtest\fR involves evaluation +The central command of \fBtcltest\fR is [\fBtest\fR] that defines +and runs a test. Testing with [\fBtest\fR] involves evaluation of a Tcl script and comparing the result to an expected result, as configured and controlled by a number of options. Several other commands provided by \fBtcltest\fR govern the configuration of -\fBtest\fR and the collection of many \fBtest\fR commands into +[\fBtest\fR] and the collection of many [\fBtest\fR] commands into test suites. .PP See \fBCREATING TEST SUITES WITH TCLTEST\fR below for an extended example @@ -95,31 +95,29 @@ for your Tcl-enabled code. \fBtest\fR \fIname description ?option value ...?\fR Defines and possibly runs a test with the name \fIname\fR and description \fIdescription\fR. The name and description of a test -are used in messages reported by \fBtest\fR during the +are used in messages reported by [\fBtest\fR] during the test, as configured by the options of \fBtcltest\fR. The -remaining \fIoption value\fR arguments to \fBtest\fR +remaining \fIoption value\fR arguments to [\fBtest\fR] define the test, including the scripts to run, the conditions under which to run them, the expected result, and the means by which the expected and actual results should be compared. See \fBTESTS\fR below for a complete description of the valid -options and how they define a test. The \fBtest\fR command +options and how they define a test. The [\fBtest\fR] command returns an empty string. .TP \fBtest\fR \fIname description ?constraints? body result\fR -. -This form of \fBtest\fR is provided to support test suites written +This form of [\fBtest\fR] is provided to support test suites written for version 1 of the \fBtcltest\fR package, and also a simpler interface for a common usage. It is the same as -.QW "\fBtest\fR \fIname description\fB \-constraints \fIconstraints\fB \-body \fIbody\fB \-result \fIresult\fR" . -All other options to \fBtest\fR +[\fBtest\fR \fIname description\fB -constraints \fIconstraints\fB -body +\fIbody\fB -result \fIresult\fR]. All other options to [\fBtest\fR] take their default values. When \fIconstraints\fR is omitted, this -form of \fBtest\fR can be distinguished from the first because -all \fIoption\fRs begin with -.QW \- . +form of [\fBtest\fR] can be distinguished from the first because +all \fIoption\fRs begin with ``-''. .TP \fBloadTestedCommands\fR Evaluates in the caller's context the script specified by -\fBconfigure \-load\fR or \fBconfigure \-loadfile\fR. +[\fBconfigure -load\fR] or [\fBconfigure -loadfile\fR]. Returns the result of that script evaluation, including any error raised by the script. Use this command and the related configuration options to provide the commands to be tested to @@ -128,31 +126,31 @@ the interpreter running the test suite. \fBmakeFile\fR \fIcontents name ?directory?\fR Creates a file named \fIname\fR relative to directory \fIdirectory\fR and write \fIcontents\fR -to that file using the encoding \fBencoding system\fR. +to that file using the encoding [\fBencoding system\fR]. If \fIcontents\fR does not end with a newline, a newline will be appended so that the file named \fIname\fR does end with a newline. Because the system encoding is used, this command is only suitable for making text files. The file will be removed by the next evaluation -of \fBcleanupTests\fR, unless it is removed by -\fBremoveFile\fR first. The default value of -\fIdirectory\fR is the directory \fBconfigure -tmpdir\fR. +of [\fBcleanupTests\fR], unless it is removed by +[\fBremoveFile\fR] first. The default value of +\fIdirectory\fR is the directory [\fBconfigure -tmpdir\fR]. Returns the full path of the file created. Use this command to create any text file required by a test with contents as needed. .TP \fBremoveFile\fR \fIname ?directory?\fR Forces the file referenced by \fIname\fR to be removed. This file name should be relative to \fIdirectory\fR. The default value of -\fIdirectory\fR is the directory \fBconfigure -tmpdir\fR. +\fIdirectory\fR is the directory [\fBconfigure -tmpdir\fR]. Returns an empty string. Use this command to delete files -created by \fBmakeFile\fR. +created by [\fBmakeFile\fR]. .TP \fBmakeDirectory\fR \fIname ?directory?\fR Creates a directory named \fIname\fR relative to directory \fIdirectory\fR. -The directory will be removed by the next evaluation of \fBcleanupTests\fR, -unless it is removed by \fBremoveDirectory\fR first. +The directory will be removed by the next evaluation of [\fBcleanupTests\fR], +unless it is removed by [\fBremoveDirectory\fR] first. The default value of \fIdirectory\fR is the directory -\fBconfigure -tmpdir\fR. +[\fBconfigure -tmpdir\fR]. Returns the full path of the directory created. Use this command to create any directories that are required to exist by a test. .TP @@ -160,16 +158,16 @@ to create any directories that are required to exist by a test. Forces the directory referenced by \fIname\fR to be removed. This directory should be relative to \fIdirectory\fR. The default value of \fIdirectory\fR is the directory -\fBconfigure -tmpdir\fR. +[\fBconfigure -tmpdir\fR]. Returns an empty string. Use this command to delete any directories -created by \fBmakeDirectory\fR. +created by [\fBmakeDirectory\fR]. .TP \fBviewFile\fR \fIfile ?directory?\fR Returns the contents of \fIfile\fR, except for any -final newline, just as \fBread -nonewline\fR would return. +final newline, just as [\fBread -nonewline\fR] would return. This file name should be relative to \fIdirectory\fR. The default value of \fIdirectory\fR is the directory -\fBconfigure -tmpdir\fR. Use this command +[\fBconfigure -tmpdir\fR]. Use this command as a convenient way to turn the contents of a file generated by a test into the result of that test for matching against an expected result. The contents of the file are read using @@ -180,16 +178,16 @@ files. Intended to clean up and summarize after several tests have been run. Typically called once per test file, at the end of the file after all tests have been completed. For best effectiveness, be -sure that the \fBcleanupTests\fR is evaluated even if an error +sure that the [\fBcleanupTests\fR] is evaluated even if an error occurs earlier in the test file evaluation. .sp Prints statistics about the tests run and removes files that were -created by \fBmakeDirectory\fR and \fBmakeFile\fR since the -last \fBcleanupTests\fR. Names of files and directories -in the directory \fBconfigure -tmpdir\fR created since -the last \fBcleanupTests\fR, but not created by -\fBmakeFile\fR or \fBmakeDirectory\fR are printed -to \fBoutputChannel\fR. This command also restores the original +created by [\fBmakeDirectory\fR] and [\fBmakeFile\fR] since the +last [\fBcleanupTests\fR]. Names of files and directories +in the directory [\fBconfigure -tmpdir\fR] created since +the last [\fBcleanupTests\fR], but not created by +[\fBmakeFile\fR] or [\fBmakeDirectory\fR] are printed +to [\fBoutputChannel\fR]. This command also restores the original shell environment, as described by the ::env array. Returns an empty string. .TP @@ -198,7 +196,7 @@ This is a master command meant to run an entire suite of tests, spanning multiple files and/or directories, as governed by the configurable options of \fBtcltest\fR. See \fBRUNNING ALL TESTS\fR below for a complete description of the many variations possible -with \fBrunAllTests\fR. +with [\fBrunAllTests\fR]. .SH "CONFIGURATION COMMANDS" .TP \fBconfigure\fR @@ -216,20 +214,19 @@ corresponding value \fIvalue\fR, in order. Raises an error if an \fIoption\fR is not a supported configurable option, or if \fIvalue\fR is not a valid value for the corresponding \fIoption\fR, or if a \fIvalue\fR is not provided. When an error is raised, the -operation of \fBconfigure\fR is halted, and subsequent \fIoption value\fR +operation of [\fBconfigure\fR] is halted, and subsequent \fIoption value\fR arguments are not processed. .sp If the environment variable \fB::env(TCLTEST_OPTIONS)\fR exists when -the \fBtcltest\fR package is loaded (by -.QW "\fBpackage require tcltest\fR" ) -then its value is taken as a list of arguments to pass to \fBconfigure\fR. +the \fBtcltest\fR package is loaded (by [\fBpackage require tcltest\fR]) +then its value is taken as a list of arguments to pass to [\fBconfigure\fR]. This allows the default values of the configuration options to be set by the environment. .TP \fBcustomMatch \fImode script\fR -Registers \fImode\fR as a new legal value of the \fB\-match\fR option -to \fBtest\fR. When the \fB\-match \fImode\fR option is -passed to \fBtest\fR, the script \fIscript\fR will be evaluated +Registers \fImode\fR as a new legal value of the \fB-match\fR option +to [\fBtest\fR]. When the \fB-match \fImode\fR option is +passed to [\fBtest\fR], the script \fIscript\fR will be evaluated to compare the actual result of evaluating the body of the test to the expected result. To perform the match, the \fIscript\fR is completed with two additional @@ -237,82 +234,82 @@ words, the expected result, and the actual result, and the completed script is evaluated in the global namespace. The completed script is expected to return a boolean value indicating whether or not the results match. The built-in matching modes of -\fBtest\fR are \fBexact\fR, \fBglob\fR, and \fBregexp\fR. +[\fBtest\fR] are \fBexact\fR, \fBglob\fR, and \fBregexp\fR. .TP \fBtestConstraint \fIconstraint ?boolean?\fR Sets or returns the boolean value associated with the named \fIconstraint\fR. See \fBTEST CONSTRAINTS\fR below for more information. .TP \fBinterpreter\fR \fI?executableName?\fR -Sets or returns the name of the executable to be \fBexec\fRed by -\fBrunAllTests\fR to run each test file when -\fBconfigure -singleproc\fR is false. -The default value for \fBinterpreter\fR is the name of the -currently running program as returned by \fBinfo nameofexecutable\fR. +Sets or returns the name of the executable to be [\fBexec\fR]ed by +[\fBrunAllTests\fR] to run each test file when +[\fBconfigure -singleproc\fR] is false. +The default value for [\fBinterpreter\fR] is the name of the +currently running program as returned by [\fBinfo nameofexecutable\fR]. .TP \fBoutputChannel\fR \fI?channelID?\fR Sets or returns the output channel ID. This defaults to stdout. Any test that prints test related output should send -that output to \fBoutputChannel\fR rather than letting +that output to [\fBoutputChannel\fR] rather than letting that output default to stdout. .TP \fBerrorChannel\fR \fI?channelID?\fR Sets or returns the error channel ID. This defaults to stderr. Any test that prints error messages should send -that output to \fBerrorChannel\fR rather than printing +that output to [\fBerrorChannel\fR] rather than printing directly to stderr. .SH "SHORTCUT COMMANDS" .TP \fBdebug \fI?level?\fR -Same as \fBconfigure -debug \fI?level?\fR. +Same as [\fBconfigure -debug \fI?level?\fR]. .TP \fBerrorFile \fI?filename?\fR -Same as \fBconfigure -errfile \fI?filename?\fR. +Same as [\fBconfigure -errfile \fI?filename?\fR]. .TP \fBlimitConstraints \fI?boolean?\fR -Same as \fBconfigure -limitconstraints \fI?boolean?\fR. +Same as [\fBconfigure -limitconstraints \fI?boolean?\fR]. .TP \fBloadFile \fI?filename?\fR -Same as \fBconfigure -loadfile \fI?filename?\fR. +Same as [\fBconfigure -loadfile \fI?filename?\fR]. .TP \fBloadScript \fI?script?\fR -Same as \fBconfigure -load \fI?script?\fR. +Same as [\fBconfigure -load \fI?script?\fR]. .TP \fBmatch \fI?patternList?\fR -Same as \fBconfigure -match \fI?patternList?\fR. +Same as [\fBconfigure -match \fI?patternList?\fR]. .TP \fBmatchDirectories \fI?patternList?\fR -Same as \fBconfigure -relateddir \fI?patternList?\fR. +Same as [\fBconfigure -relateddir \fI?patternList?\fR]. .TP \fBmatchFiles \fI?patternList?\fR -Same as \fBconfigure -file \fI?patternList?\fR. +Same as [\fBconfigure -file \fI?patternList?\fR]. .TP \fBoutputFile \fI?filename?\fR -Same as \fBconfigure -outfile \fI?filename?\fR. +Same as [\fBconfigure -outfile \fI?filename?\fR]. .TP \fBpreserveCore \fI?level?\fR -Same as \fBconfigure -preservecore \fI?level?\fR. +Same as [\fBconfigure -preservecore \fI?level?\fR]. .TP \fBsingleProcess \fI?boolean?\fR -Same as \fBconfigure -singleproc \fI?boolean?\fR. +Same as [\fBconfigure -singleproc \fI?boolean?\fR]. .TP \fBskip \fI?patternList?\fR -Same as \fBconfigure -skip \fI?patternList?\fR. +Same as [\fBconfigure -skip \fI?patternList?\fR]. .TP \fBskipDirectories \fI?patternList?\fR -Same as \fBconfigure -asidefromdir \fI?patternList?\fR. +Same as [\fBconfigure -asidefromdir \fI?patternList?\fR]. .TP \fBskipFiles \fI?patternList?\fR -Same as \fBconfigure -notfile \fI?patternList?\fR. +Same as [\fBconfigure -notfile \fI?patternList?\fR]. .TP \fBtemporaryDirectory \fI?directory?\fR -Same as \fBconfigure -tmpdir \fI?directory?\fR. +Same as [\fBconfigure -tmpdir \fI?directory?\fR]. .TP \fBtestsDirectory \fI?directory?\fR -Same as \fBconfigure -testdir \fI?directory?\fR. +Same as [\fBconfigure -testdir \fI?directory?\fR]. .TP \fBverbose \fI?level?\fR -Same as \fBconfigure -verbose \fI?level?\fR. +Same as [\fBconfigure -verbose \fI?level?\fR]. .SH "OTHER COMMANDS" .PP The remaining commands provided by \fBtcltest\fR have better @@ -321,49 +318,43 @@ are retained to support existing test suites, but should be avoided in new code. .TP \fBtest\fR \fIname description optionList\fR -This form of \fBtest\fR was provided to enable passing many -options spanning several lines to \fBtest\fR as a single +This form of [\fBtest\fR] was provided to enable passing many +options spanning several lines to [\fBtest\fR] as a single argument quoted by braces, rather than needing to backslash quote -the newlines between arguments to \fBtest\fR. The \fIoptionList\fR +the newlines between arguments to [\fBtest\fR]. The \fIoptionList\fR argument is expected to be a list with an even number of elements representing \fIoption\fR and \fIvalue\fR arguments to pass -to \fBtest\fR. However, these values are not passed directly, as -in the alternate forms of \fBswitch\fR. Instead, this form makes +to [\fBtest\fR]. However, these values are not passed directly, as +in the alternate forms of [\fBswitch\fR]. Instead, this form makes an unfortunate attempt to overthrow Tcl's substitution rules by performing substitutions on some of the list elements as an attempt to -implement a -.QW "do what I mean" -interpretation of a brace-enclosed -.QW block . -The result is nearly impossible to document clearly, and +implement a ``do what I mean'' interpretation of a brace-enclosed +``block''. The result is nearly impossible to document clearly, and for that reason this form is not recommended. See the examples in \fBCREATING TEST SUITES WITH TCLTEST\fR below to see that this form is really not necessary to avoid backslash-quoted newlines. If you insist on using this form, examine the source code of \fBtcltest\fR if you want to know the substitution details, or just enclose the third through last argument -to \fBtest\fR in braces and hope for the best. +to [\fBtest\fR] in braces and hope for the best. .TP \fBworkingDirectory\fR \fI?directoryName?\fR Sets or returns the current working directory when the test suite is running. The default value for workingDirectory is the directory in -which the test suite was launched. The Tcl commands \fBcd\fR and -\fBpwd\fR are sufficient replacements. +which the test suite was launched. The Tcl commands [\fBcd\fR] and +[\fBpwd\fR] are sufficient replacements. .TP \fBnormalizeMsg\fR \fImsg\fR -Returns the result of removing the -.QW extra -newlines from \fImsg\fR, where -.QW extra -is rather imprecise. Tcl offers plenty of string +Returns the result of removing the ``extra'' newlines from \fImsg\fR, +where ``extra'' is rather imprecise. Tcl offers plenty of string processing commands to modify strings as you wish, and -\fBcustomMatch\fR allows flexible matching of actual and expected +[\fBcustomMatch\fR] allows flexible matching of actual and expected results. .TP \fBnormalizePath\fR \fIpathVar\fR Resolves symlinks in a path, thus creating a path without internal redirection. It is assumed that \fIpathVar\fR is absolute. -\fIpathVar\fR is modified in place. The Tcl command \fBfile normalize\fR +\fIpathVar\fR is modified in place. The Tcl command [\fBfile normalize\fR] is a sufficient replacement. .TP \fBbytestring\fR \fIstring\fR @@ -373,18 +364,18 @@ value supplied in \fIstring\fR. This allows the tester to create denormalized or improperly formed strings to pass to C procedures that are supposed to accept strings with embedded NULL types and confirm that a string result has a certain pattern of bytes. This is -exactly equivalent to the Tcl command \fBencoding convertfrom identity\fR. +exactly equivalent to the Tcl command [\fBencoding convertfrom identity\fR]. .SH TESTS .PP -The \fBtest\fR command is the heart of the \fBtcltest\fR package. +The [\fBtest\fR] command is the heart of the \fBtcltest\fR package. Its essential function is to evaluate a Tcl script and compare -the result with an expected result. The options of \fBtest\fR +the result with an expected result. The options of [\fBtest\fR] define the test script, the environment in which to evaluate it, the expected result, and how the compare the actual result to the expected result. Some configuration options of \fBtcltest\fR -also influence how \fBtest\fR operates. +also influence how [\fBtest\fR] operates. .PP -The valid options for \fBtest\fR are summarized: +The valid options for [\fBtest\fR] are summarized: .PP .CS \fBtest\fR \fIname\fR \fIdescription\fR @@ -403,7 +394,7 @@ The \fIname\fR may be any string. It is conventional to choose a \fIname\fR according to the pattern: .PP .CS -\fItarget\fR\-\fImajorNum\fR.\fIminorNum\fR +\fItarget\fR-\fImajorNum\fR.\fIminorNum\fR .CE .PP For white-box (regression) tests, the target should be the name of the @@ -412,15 +403,16 @@ target should be the name of the feature being tested. Some conventions call for the names of black-box tests to have the suffix \fB_bb\fR. Related tests should share a major number. As a test suite evolves, it is best to have the same test name continue to correspond to the -same test, so that it remains meaningful to say things like -.QW "Test foo-1.3 passed in all releases up to 3.4, but began failing in release 3.5." +same test, so that it remains meaningful to say things like ``Test +foo-1.3 passed in all releases up to 3.4, but began failing in +release 3.5.'' .PP -During evaluation of \fBtest\fR, the \fIname\fR will be compared +During evaluation of [\fBtest\fR], the \fIname\fR will be compared to the lists of string matching patterns returned by -\fBconfigure -match\fR, and \fBconfigure -skip\fR. The test +[\fBconfigure -match\fR], and [\fBconfigure -skip\fR]. The test will be run only if \fIname\fR matches any of the patterns from -\fBconfigure -match\fR and matches none of the patterns -from \fBconfigure -skip\fR. +[\fBconfigure -match\fR] and matches none of the patterns +from [\fBconfigure -skip\fR]. .PP The \fIdescription\fR should be a short textual description of the test. The \fIdescription\fR is included in output produced by the @@ -432,124 +424,124 @@ a bug, include the bug ID in the description. .PP Valid attributes and associated values are: .TP -\fB\-constraints \fIkeywordList|expression\fR -The optional \fB\-constraints\fR attribute can be list of one or more -keywords or an expression. If the \fB\-constraints\fR value is a list of +\fB-constraints \fIkeywordList|expression\fR +The optional \fB-constraints\fR attribute can be list of one or more +keywords or an expression. If the \fB-constraints\fR value is a list of keywords, each of these keywords should be the name of a constraint -defined by a call to \fBtestConstraint\fR. If any of the listed +defined by a call to [\fBtestConstraint\fR]. If any of the listed constraints is false or does not exist, the test is skipped. If the -\fB\-constraints\fR value is an expression, that expression +\fB-constraints\fR value is an expression, that expression is evaluated. If the expression evaluates to true, then the test is run. -Note that the expression form of \fB\-constraints\fR may interfere with the -operation of \fBconfigure -constraints\fR and -\fBconfigure -limitconstraints\fR, and is not recommended. +Note that the expression form of \fB-constraints\fR may interfere with the +operation of [\fBconfigure -constraints\fR] and +[\fBconfigure -limitconstraints\fR], and is not recommended. Appropriate constraints should be added to any tests that should not always be run. That is, conditional evaluation of a test -should be accomplished by the \fB\-constraints\fR option, not by -conditional evaluation of \fBtest\fR. In that way, the same +should be accomplished by the \fB-constraints\fR option, not by +conditional evaluation of [\fBtest\fR]. In that way, the same number of tests are always reported by the test suite, though the number skipped may change based on the testing environment. The default value is an empty list. See \fBTEST CONSTRAINTS\fR below for a list of built-in constraints and information on how to add your own constraints. .TP -\fB\-setup \fIscript\fR -The optional \fB\-setup\fR attribute indicates a \fIscript\fR that will be run -before the script indicated by the \fB\-body\fR attribute. If evaluation +\fB-setup \fIscript\fR +The optional \fB-setup\fR attribute indicates a \fIscript\fR that will be run +before the script indicated by the \fB-body\fR attribute. If evaluation of \fIscript\fR raises an error, the test will fail. The default value is an empty script. .TP -\fB\-body \fIscript\fR -The \fB\-body\fR attribute indicates the \fIscript\fR to run to carry out the +\fB-body \fIscript\fR +The \fB-body\fR attribute indicates the \fIscript\fR to run to carry out the test. It must return a result that can be checked for correctness. If evaluation of \fIscript\fR raises an error, the test will fail. The default value is an empty script. .TP -\fB\-cleanup \fIscript\fR -The optional \fB\-cleanup\fR attribute indicates a \fIscript\fR that will be -run after the script indicated by the \fB\-body\fR attribute. +\fB-cleanup \fIscript\fR +The optional \fB-cleanup\fR attribute indicates a \fIscript\fR that will be +run after the script indicated by the \fB-body\fR attribute. If evaluation of \fIscript\fR raises an error, the test will fail. The default value is an empty script. .TP -\fB\-match \fImode\fR -The \fB\-match\fR attribute determines how expected answers supplied by -\fB\-result\fR, \fB\-output\fR, and \fB\-errorOutput\fR are compared. Valid +\fB-match \fImode\fR +The \fB-match\fR attribute determines how expected answers supplied by +\fB-result\fR, \fB-output\fR, and \fB-errorOutput\fR are compared. Valid values for \fImode\fR are \fBregexp\fR, \fBglob\fR, \fBexact\fR, and -any value registered by a prior call to \fBcustomMatch\fR. The default +any value registered by a prior call to [\fBcustomMatch\fR]. The default value is \fBexact\fR. .TP -\fB\-result \fIexpectedValue\fR -The \fB\-result\fR attribute supplies the \fIexpectedValue\fR against which +\fB-result \fIexpectedValue\fR +The \fB-result\fR attribute supplies the \fIexpectedValue\fR against which the return value from script will be compared. The default value is an empty string. .TP -\fB\-output \fIexpectedValue\fR -The \fB\-output\fR attribute supplies the \fIexpectedValue\fR against which -any output sent to \fBstdout\fR or \fBoutputChannel\fR during evaluation +\fB-output \fIexpectedValue\fR +The \fB-output\fR attribute supplies the \fIexpectedValue\fR against which +any output sent to \fBstdout\fR or [\fBoutputChannel\fR] during evaluation of the script(s) will be compared. Note that only output printed using -\fB::puts\fR is used for comparison. If \fB\-output\fR is not specified, -output sent to \fBstdout\fR and \fBoutputChannel\fR is not processed for +[\fB::puts\fR] is used for comparison. If \fB-output\fR is not specified, +output sent to \fBstdout\fR and [\fBoutputChannel\fR] is not processed for comparison. .TP -\fB\-errorOutput \fIexpectedValue\fR -The \fB\-errorOutput\fR attribute supplies the \fIexpectedValue\fR against -which any output sent to \fBstderr\fR or \fBerrorChannel\fR during +\fB-errorOutput \fIexpectedValue\fR +The \fB-errorOutput\fR attribute supplies the \fIexpectedValue\fR against +which any output sent to \fBstderr\fR or [\fBerrorChannel\fR] during evaluation of the script(s) will be compared. Note that only output -printed using \fB::puts\fR is used for comparison. If \fB\-errorOutput\fR -is not specified, output sent to \fBstderr\fR and \fBerrorChannel\fR is +printed using [\fB::puts\fR] is used for comparison. If \fB-errorOutput\fR +is not specified, output sent to \fBstderr\fR and [\fBerrorChannel\fR] is not processed for comparison. .TP -\fB\-returnCodes \fIexpectedCodeList\fR -The optional \fB\-returnCodes\fR attribute supplies \fIexpectedCodeList\fR, +\fB-returnCodes \fIexpectedCodeList\fR +The optional \fB-returnCodes\fR attribute supplies \fIexpectedCodeList\fR, a list of return codes that may be accepted from evaluation of the -\fB\-body\fR script. If evaluation of the \fB\-body\fR script returns +\fB-body\fR script. If evaluation of the \fB-body\fR script returns a code not in the \fIexpectedCodeList\fR, the test fails. All -return codes known to \fBreturn\fR, in both numeric and symbolic +return codes known to [\fBreturn\fR], in both numeric and symbolic form, including extended return codes, are acceptable elements in the \fIexpectedCodeList\fR. Default value is \fB{ok return}\fR. .PP -To pass, a test must successfully evaluate its \fB\-setup\fR, \fB\-body\fR, -and \fB\-cleanup\fR scripts. The return code of the \fB\-body\fR script and +To pass, a test must successfully evaluate its \fB-setup\fR, \fB-body\fR, +and \fB-cleanup\fR scripts. The return code of the \fB-body\fR script and its result must match expected values, and if specified, output and error -data from the test must match expected \fB\-output\fR and \fB\-errorOutput\fR +data from the test must match expected \fB-output\fR and \fB-errorOutput\fR values. If any of these conditions are not met, then the test fails. Note that all scripts are evaluated in the context of the caller -of \fBtest\fR. +of [\fBtest\fR]. .PP -As long as \fBtest\fR is called with valid syntax and legal +As long as [\fBtest\fR] is called with valid syntax and legal values for all attributes, it will not raise an error. Test -failures are instead reported as output written to \fBoutputChannel\fR. +failures are instead reported as output written to [\fBoutputChannel\fR]. In default operation, a successful test produces no output. The output -messages produced by \fBtest\fR are controlled by the -\fBconfigure \-verbose\fR option as described in \fBCONFIGURABLE OPTIONS\fR +messages produced by [\fBtest\fR] are controlled by the +[\fBconfigure -verbose\fR] option as described in \fBCONFIGURABLE OPTIONS\fR below. Any output produced by the test scripts themselves should be -produced using \fB::puts\fR to \fBoutputChannel\fR or -\fBerrorChannel\fR, so that users of the test suite may -easily capture output with the \fBconfigure \-outfile\fR and -\fBconfigure \-errfile\fR options, and so that the \fB\-output\fR -and \fB\-errorOutput\fR attributes work properly. +produced using [\fB::puts\fR] to [\fBoutputChannel\fR] or +[\fBerrorChannel\fR], so that users of the test suite may +easily capture output with the [\fBconfigure -outfile\fR] and +[\fBconfigure -errfile\fR] options, and so that the \fB-output\fR +and \fB-errorOutput\fR attributes work properly. .SH "TEST CONSTRAINTS" .PP Constraints are used to determine whether or not a test should be skipped. Each constraint has a name, which may be any string, and a boolean -value. Each \fBtest\fR has a \fB\-constraints\fR value which is a +value. Each [\fBtest\fR] has a \fB-constraints\fR value which is a list of constraint names. There are two modes of constraint control. Most frequently, the default mode is used, indicated by a setting -of \fBconfigure \-limitconstraints\fR to false. The test will run +of [\fBconfigure -limitconstraints\fR] to false. The test will run only if all constraints in the list are true-valued. Thus, -the \fB\-constraints\fR option of \fBtest\fR is a convenient, symbolic +the \fB-constraints\fR option of [\fBtest\fR] is a convenient, symbolic way to define any conditions required for the test to be possible or -meaningful. For example, a \fBtest\fR with \fB\-constraints unix\fR +meaningful. For example, a [\fBtest\fR] with \fB-constraints unix\fR will only be run if the constraint \fBunix\fR is true, which indicates the test suite is being run on a Unix platform. .PP -Each \fBtest\fR should include whatever \fB\-constraints\fR are +Each [\fBtest\fR] should include whatever \fB-constraints\fR are required to constrain it to run only where appropriate. Several constraints are pre-defined in the \fBtcltest\fR package, listed below. The registration of user-defined constraints is performed -by the \fBtestConstraint\fR command. User-defined constraints +by the [\fBtestConstraint\fR] command. User-defined constraints may appear within a test file, or within the script specified -by the \fBconfigure \-load\fR or \fBconfigure \-loadfile\fR +by the [\fBconfigure -load\fR] or [\fBconfigure -loadfile\fR] options. .PP The following is a list of constraints pre-defined by the @@ -655,23 +647,22 @@ test can only run if Unix user is root test can only run if Unix user is not root .TP \fIeformat\fR -test can only run if app has a working version of sprintf with respect to the -.QW "e" -format of floating-point numbers. +test can only run if app has a working version of sprintf with respect +to the "e" format of floating-point numbers. .TP \fIstdio\fR -test can only be run if \fBinterpreter\fR can be \fBopen\fRed +test can only be run if [\fBinterpreter\fR] can be [\fBopen\fR]ed as a pipe. .PP The alternative mode of constraint control is enabled by setting -\fBconfigure \-limitconstraints\fR to true. With that configuration +[\fBconfigure -limitconstraints\fR] to true. With that configuration setting, all existing constraints other than those in the constraint -list returned by \fBconfigure \-constraints\fR are set to false. -When the value of \fBconfigure \-constraints\fR +list returned by [\fBconfigure -constraints\fR] are set to false. +When the value of [\fBconfigure -constraints\fR] is set, all those constraints are set to true. The effect is that -when both options \fBconfigure \-constraints\fR and -\fBconfigure \-limitconstraints\fR are in use, only those tests including -only constraints from the \fBconfigure \-constraints\fR list +when both options [\fBconfigure -constraints\fR] and +[\fBconfigure -limitconstraints\fR] are in use, only those tests including +only constraints from the [\fBconfigure -constraints\fR] list are run; all others are skipped. For example, one might set up a configuration with .PP @@ -685,20 +676,20 @@ to run exactly those tests that exercise known bugs, and discover whether any of them pass, indicating the bug had been fixed. .SH "RUNNING ALL TESTS" .PP -The single command \fBrunAllTests\fR is evaluated to run an entire +The single command [\fBrunAllTests\fR] is evaluated to run an entire test suite, spanning many files and directories. The configuration options of \fBtcltest\fR control the precise operations. The -\fBrunAllTests\fR command begins by printing a summary of its -configuration to \fBoutputChannel\fR. +[\fBrunAllTests\fR] command begins by printing a summary of its +configuration to [\fBoutputChannel\fR]. .PP Test files to be evaluated are sought in the directory -\fBconfigure \-testdir\fR. The list of files in that directory -that match any of the patterns in \fBconfigure \-file\fR and -match none of the patterns in \fBconfigure \-notfile\fR is generated +[\fBconfigure -testdir\fR]. The list of files in that directory +that match any of the patterns in [\fBconfigure -file\fR] and +match none of the patterns in [\fBconfigure -notfile\fR] is generated and sorted. Then each file will be evaluated in turn. If -\fBconfigure \-singleproc\fR is true, then each file will -be \fBsource\fRd in the caller's context. If it is false, -then a copy of \fBinterpreter\fR will be \fBexec\fRd to +[\fBconfigure -singleproc\fR] is true, then each file will +be [\fBsource\fR]d in the caller's context. If it is false, +then a copy of [\fBinterpreter\fR] will be [\fBexec\fR]d to evaluate each file. The multi-process operation is useful when testing can cause errors so severe that a process terminates. Although such an error may terminate a child @@ -706,17 +697,17 @@ process evaluating one file, the master process can continue with the rest of the test suite. In multi-process operation, the configuration of \fBtcltest\fR in the master process is passed to the child processes as command line arguments, -with the exception of \fBconfigure \-outfile\fR. The -\fBrunAllTests\fR command in the +with the exception of [\fBconfigure -outfile\fR]. The +[\fBrunAllTests\fR] command in the master process collects all output from the child processes and collates their results into one master report. Any reports of individual test failures, or messages requested -by a \fBconfigure \-verbose\fR setting are passed directly -on to \fBoutputChannel\fR by the master process. +by a [\fBconfigure -verbose\fR] setting are passed directly +on to [\fBoutputChannel\fR] by the master process. .PP After evaluating all selected test files, a summary of the -results is printed to \fBoutputChannel\fR. The summary -includes the total number of \fBtest\fRs evaluated, broken +results is printed to [\fBoutputChannel\fR]. The summary +includes the total number of [\fBtest\fR]s evaluated, broken down into those skipped, those passed, and those failed. The summary also notes the number of files evaluated, and the names of any files with failing tests or errors. A list of @@ -724,45 +715,45 @@ the constraints that caused tests to be skipped, and the number of tests skipped for each is also printed. Also, messages are printed if it appears that evaluation of a test file has caused any temporary files to be left -behind in \fBconfigure \-tmpdir\fR. +behind in [\fBconfigure -tmpdir\fR]. .PP Having completed and summarized all selected test files, -\fBrunAllTests\fR then recursively acts on subdirectories -of \fBconfigure \-testdir\fR. All subdirectories that -match any of the patterns in \fBconfigure \-relateddir\fR +[\fBrunAllTests\fR] then recursively acts on subdirectories +of [\fBconfigure -testdir\fR]. All subdirectories that +match any of the patterns in [\fBconfigure -relateddir\fR] and do not match any of the patterns in -\fBconfigure \-asidefromdir\fR are examined. If +[\fBconfigure -asidefromdir\fR] are examined. If a file named \fBall.tcl\fR is found in such a directory, -it will be \fBsource\fRd in the caller's context. +it will be [\fBsource\fR]d in the caller's context. Whether or not an examined directory contains an \fBall.tcl\fR file, its subdirectories are also scanned -against the \fBconfigure \-relateddir\fR and -\fBconfigure \-asidefromdir\fR patterns. In this way, +against the [\fBconfigure -relateddir\fR] and +[\fBconfigure -asidefromdir\fR] patterns. In this way, many directories in a directory tree can have all their -test files evaluated by a single \fBrunAllTests\fR +test files evaluated by a single [\fBrunAllTests\fR] command. .SH "CONFIGURABLE OPTIONS" -The \fBconfigure\fR command is used to set and query the configurable +The [\fBconfigure\fR] command is used to set and query the configurable options of \fBtcltest\fR. The valid options are: .TP -\fB\-singleproc \fIboolean\fR -Controls whether or not \fBrunAllTests\fR spawns a child process for +\fB-singleproc \fIboolean\fR +Controls whether or not [\fBrunAllTests\fR] spawns a child process for each test file. No spawning when \fIboolean\fR is true. Default value is false. .TP -\fB\-debug \fIlevel\fR +\fB-debug \fIlevel\fR Sets the debug level to \fIlevel\fR, an integer value indicating how much debugging information should be printed to stdout. Note that debug messages always go to stdout, independent of the value of -\fBconfigure \-outfile\fR. Default value is 0. Levels are defined as: +[\fBconfigure -outfile\fR]. Default value is 0. Levels are defined as: .RS .IP 0 Do not display any debug information. .IP 1 Display information regarding whether a test is skipped because it doesn't match any of the tests that were specified using by -\fBconfigure \-match\fR (userSpecifiedNonMatch) or matches any of -the tests specified by \fBconfigure \-skip\fR (userSpecifiedSkip). Also +[\fBconfigure -match\fR] (userSpecifiedNonMatch) or matches any of +the tests specified by [\fBconfigure -skip\fR] (userSpecifiedSkip). Also print warnings about possible lack of cleanup or balance in test files. Also print warnings about any re-use of test names. .IP 2 @@ -774,7 +765,7 @@ Display information regarding what individual procs in the test harness are doing. .RE .TP -\fB\-verbose \fIlevel\fR +\fB-verbose \fIlevel\fR Sets the type of output verbosity desired to \fIlevel\fR, a list of zero or more of the elements \fBbody\fR, \fBpass\fR, \fBskip\fR, \fBstart\fR, \fBerror\fR and \fBline\fR. Default value @@ -796,102 +787,95 @@ does not match its expected return code Print source file line information of failed tests .RE The single letter abbreviations noted above are also recognized -so that -.QW "\fBconfigure \-verbose pt\fR" -is the same as -.QW "\fBconfigure \-verbose {pass start}\fR" . +so that [\fBconfigure -verbose pt\fR] is the same as +[\fBconfigure -verbose {pass start}\fR]. .TP -\fB\-preservecore \fIlevel\fR +\fB-preservecore \fIlevel\fR Sets the core preservation level to \fIlevel\fR. This level determines how stringent checks for core files are. Default value is 0. Levels are defined as: .RS .IP 0 -No checking \(em do not check for core files at the end of each test -command, but do check for them in \fBrunAllTests\fR after all +No checking - do not check for core files at the end of each test +command, but do check for them in [\fBrunAllTests\fR] after all test files have been evaluated. .IP 1 -Also check for core files at the end of each \fBtest\fR command. +Also check for core files at the end of each [\fBtest\fR] command. .IP 2 Check for core files at all times described above, and save a -copy of each core file produced in \fBconfigure \-tmpdir\fR. +copy of each core file produced in [\fBconfigure -tmpdir\fR]. .RE .TP -\fB\-limitconstraints \fIboolean\fR -Sets the mode by which \fBtest\fR honors constraints as described +\fB-limitconstraints \fIboolean\fR +Sets the mode by which [\fBtest\fR] honors constraints as described in \fBTESTS\fR above. Default value is false. .TP -\fB\-constraints \fIlist\fR +\fB-constraints \fIlist\fR Sets all the constraints in \fIlist\fR to true. Also used in -combination with -.QW "\fBconfigure \-limitconstraints true\fR" -to control an +combination with [\fBconfigure -limitconstraints true\fR] to control an alternative constraint mode as described in \fBTESTS\fR above. Default value is an empty list. .TP -\fB\-tmpdir \fIdirectory\fR -Sets the temporary directory to be used by \fBmakeFile\fR, -\fBmakeDirectory\fR, \fBviewFile\fR, \fBremoveFile\fR, -and \fBremoveDirectory\fR as the default directory where +\fB-tmpdir \fIdirectory\fR +Sets the temporary directory to be used by [\fBmakeFile\fR], +[\fBmakeDirectory\fR], [\fBviewFile\fR], [\fBremoveFile\fR], +and [\fBremoveDirectory\fR] as the default directory where temporary files and directories created by test files should -be created. Default value is \fBworkingDirectory\fR. +be created. Default value is [\fBworkingDirectory\fR]. .TP -\fB\-testdir \fIdirectory\fR -Sets the directory searched by \fBrunAllTests\fR for test files -and subdirectories. Default value is \fBworkingDirectory\fR. +\fB-testdir \fIdirectory\fR +Sets the directory searched by [\fBrunAllTests\fR] for test files +and subdirectories. Default value is [\fBworkingDirectory\fR]. .TP -\fB\-file \fIpatternList\fR -Sets the list of patterns used by \fBrunAllTests\fR to determine +\fB-file \fIpatternList\fR +Sets the list of patterns used by [\fBrunAllTests\fR] to determine what test files to evaluate. Default value is \fB*.test\fR. .TP -\fB\-notfile \fIpatternList\fR -Sets the list of patterns used by \fBrunAllTests\fR to determine -what test files to skip. Default value is -.QW \fBl.*.test\fR , -so that any SCCS lock files are skipped. +\fB-notfile \fIpatternList\fR +Sets the list of patterns used by [\fBrunAllTests\fR] to determine +what test files to skip. Default value is \fBl.*.test\fR, so +that any SCCS lock files are skipped. .TP -\fB\-relateddir \fIpatternList\fR -Sets the list of patterns used by \fBrunAllTests\fR to determine +\fB-relateddir \fIpatternList\fR +Sets the list of patterns used by [\fBrunAllTests\fR] to determine what subdirectories to search for an \fBall.tcl\fR file. Default -value is -.QW \fB*\fR . +value is \fB*\fR. .TP -\fB\-asidefromdir \fIpatternList\fR -Sets the list of patterns used by \fBrunAllTests\fR to determine +\fB-asidefromdir \fIpatternList\fR +Sets the list of patterns used by [\fBrunAllTests\fR] to determine what subdirectories to skip when searching for an \fBall.tcl\fR file. Default value is an empty list. .TP -\fB\-match \fIpatternList\fR -Set the list of patterns used by \fBtest\fR to determine whether -a test should be run. Default value is -.QW \fB*\fR . +\fB-match \fIpatternList\fR +Set the list of patterns used by [\fBtest\fR] to determine whether +a test should be run. Default value is \fB*\fR. .TP -\fB\-skip \fIpatternList\fR -Set the list of patterns used by \fBtest\fR to determine whether +\fB-skip \fIpatternList\fR +Set the list of patterns used by [\fBtest\fR] to determine whether a test should be skipped. Default value is an empty list. .TP -\fB\-load \fIscript\fR -Sets a script to be evaluated by \fBloadTestedCommands\fR. +\fB-load \fIscript\fR +Sets a script to be evaluated by [\fBloadTestedCommands\fR]. Default value is an empty script. .TP -\fB\-loadfile \fIfilename\fR +\fB-loadfile \fIfilename\fR Sets the filename from which to read a script to be evaluated -by \fBloadTestedCommands\fR. This is an alternative to -\fB\-load\fR. They cannot be used together. +by [\fBloadTestedCommands\fR]. This is an alternative to +\fB-load\fR. They cannot be used together. .TP -\fB\-outfile \fIfilename\fR +\fB-outfile \fIfilename\fR Sets the file to which all output produced by tcltest should be -written. A file named \fIfilename\fR will be \fBopen\fRed for writing, -and the resulting channel will be set as the value of \fBoutputChannel\fR. +written. A file named \fIfilename\fR will be [\fBopen\fR]ed for writing, +and the resulting channel will be set as the value of [\fBoutputChannel\fR]. .TP -\fB\-errfile \fIfilename\fR +\fB-errfile \fIfilename\fR Sets the file to which all error output produced by tcltest -should be written. A file named \fIfilename\fR will be \fBopen\fRed +should be written. A file named \fIfilename\fR will be [\fBopen\fR]ed for writing, and the resulting channel will be set as the value -of \fBerrorChannel\fR. +of [\fBerrorChannel\fR]. .SH "CREATING TEST SUITES WITH TCLTEST" .PP -The fundamental element of a test suite is the individual \fBtest\fR +The fundamental element of a test suite is the individual [\fBtest\fR] command. We begin with several examples. .IP [1] Test of a script that returns normally. @@ -945,17 +929,17 @@ Test with a constraint. .CE .RE .PP -At the next higher layer of organization, several \fBtest\fR commands +At the next higher layer of organization, several [\fBtest\fR] commands are gathered together into a single test file. Test files should have names with the \fB.test\fR extension, because that is the default pattern -used by \fBrunAllTests\fR to find test files. It is a good rule of +used by [\fBrunAllTests\fR] to find test files. It is a good rule of thumb to have one test file for each source code file of your project. It is good practice to edit the test file and the source code file together, keeping tests synchronized with code changes. .PP -Most of the code in the test file should be the \fBtest\fR commands. +Most of the code in the test file should be the [\fBtest\fR] commands. Use constraints to skip tests, rather than conditional evaluation -of \fBtest\fR. +of [\fBtest\fR]. .IP [5] Recommended system for writing conditional tests, using constraints to guard: @@ -982,31 +966,30 @@ if $myRequirement { .CE .RE .PP -Use the \fB\-setup\fR and \fB\-cleanup\fR options to establish and release +Use the \fB-setup\fR and \fB-cleanup\fR options to establish and release all context requirements of the test body. Do not make tests depend on prior tests in the file. Those prior tests might be skipped. If several consecutive tests require the same context, the appropriate setup and cleanup scripts may be stored in variable for passing to each tests -\fB\-setup\fR and \fB\-cleanup\fR options. This is a better solution than -performing setup outside of \fBtest\fR commands, because the setup will +\fB-setup\fR and \fB-cleanup\fR options. This is a better solution than +performing setup outside of [\fBtest\fR] commands, because the setup will only be done if necessary, and any errors during setup will be reported, and not cause the test file to abort. .PP A test file should be able to be combined with other test files and not -interfere with them, even when -.QW "\fBconfigure -singleproc 1\fR" -causes all files to be evaluated in a common interpreter. A simple way to +interfere with them, even when [\fBconfigure -singleproc 1\fR] causes +all files to be evaluated in a common interpreter. A simple way to achieve this is to have your tests define all their commands and variables in a namespace that is deleted when the test file evaluation is complete. A good namespace to use is a child namespace \fBtest\fR of the namespace of the module you are testing. .PP A test file should also be able to be evaluated directly as a script, -not depending on being called by a master \fBrunAllTests\fR. This +not depending on being called by a master [\fBrunAllTests\fR]. This means that each test file should process command line arguments to give the tester all the configuration control that \fBtcltest\fR provides. .PP -After all \fBtest\fRs in a test file, the command \fBcleanupTests\fR +After all [\fBtest\fR]s in a test file, the command [\fBcleanupTests\fR] should be called. .IP [7] Here is a sketch of a sample test file illustrating those points: @@ -1038,9 +1021,9 @@ namespace delete ::example::test .PP The next level of organization is a full test suite, made up of several test files. One script is used to control the entire suite. The -basic function of this script is to call \fBrunAllTests\fR after +basic function of this script is to call [\fBrunAllTests\fR] after doing any necessary setup. This script is usually named \fBall.tcl\fR -because that's the default name used by \fBrunAllTests\fR when combining +because that's the default name used by [\fBrunAllTests\fR] when combining multiple test suites into one testing run. .IP [8] Here is a sketch of a sample test suite master script: @@ -1050,7 +1033,7 @@ Here is a sketch of a sample test suite master script: package require Tcl 8.4 package require tcltest 2.2 package require example -\fB::tcltest::configure\fR -testdir \e +\fB::tcltest::configure\fR -testdir \\ [file dirname [file normalize [info script]]] eval \fB::tcltest::configure\fR $argv \fB::tcltest::runAllTests\fR @@ -1065,9 +1048,8 @@ here. They are no longer part of the supported public interface of to continue to support existing test suites written to the older interface specifications, many of those deprecated commands and variables still work as before. For example, in many circumstances, -\fBconfigure\fR will be automatically called shortly after -.QW "\fBpackage require tcltest 2.1\fR" -succeeds with arguments +[\fBconfigure\fR] will be automatically called shortly after +[\fBpackage require tcltest 2.1\fR] succeeds with arguments from the variable \fB::argv\fR. This is to support test suites that depend on the old behavior that \fBtcltest\fR was automatically configured from command line arguments. New test files should not @@ -1079,7 +1061,7 @@ eval \fB::tcltest::configure\fR $::argv .PP to establish a configuration from command line arguments. .SH "KNOWN ISSUES" -There are two known issues related to nested evaluations of \fBtest\fR. +There are two known issues related to nested evaluations of [\fBtest\fR]. The first issue relates to the stack level in which test scripts are executed. Tests nested within other tests may be executed at the same stack level as the outermost test. For example, in the following code: @@ -1096,34 +1078,23 @@ stack level as the outermost test. For example, in the following code: any script executed in level-2.1 may be executed at the same stack level as the script defined for level-1.1. .PP -In addition, while two \fBtest\fRs have been run, results will only -be reported by \fBcleanupTests\fR for tests at the same level as +In addition, while two [\fBtest\fR]s have been run, results will only +be reported by [\fBcleanupTests\fR] for tests at the same level as test level-1.1. However, test results for all tests run prior to level-1.1 will be available when test level-2.1 runs. What this means is that if you try to access the test results for test level-2.1, -it will may say that -.QW m -tests have run, -.QW n -tests have been skipped, -.QW o -tests have passed and -.QW p -tests have failed, where -.QW m , -.QW n , -.QW o , -and -.QW p -refer to tests that were run at the same test level as test level-1.1. +it will may say that 'm' tests have run, 'n' tests have +been skipped, 'o' tests have passed and 'p' tests have failed, +where 'm', 'n', 'o', and 'p' refer to tests that were run at the +same test level as test level-1.1. .PP Implementation of output and error comparison in the test command depends on usage of ::puts in your application code. Output is intercepted by redefining the ::puts command while the defined test script is being run. Errors thrown by C procedures or printed directly from C applications will not be caught by the test command. -Therefore, usage of the \fB\-output\fR and \fB\-errorOutput\fR -options to \fBtest\fR is useful only for pure Tcl applications -that use \fB::puts\fR to produce output. +Therefore, usage of the \fB-output\fR and \fB-errorOutput\fR +options to [\fBtest\fR] is useful only for pure Tcl applications +that use [\fB::puts\fR] to produce output. .SH KEYWORDS test, test harness, test suite diff --git a/doc/tclvars.n b/doc/tclvars.n index 16f684e..4a4a16e 100644 --- a/doc/tclvars.n +++ b/doc/tclvars.n @@ -5,7 +5,7 @@ '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. '\" -'\" RCS: @(#) $Id: tclvars.n,v 1.28 2007/10/24 14:29:39 dkf Exp $ +'\" RCS: @(#) $Id: tclvars.n,v 1.29 2007/10/26 20:11:53 dgp Exp $ '\" .so man.macros .TH tclvars n 8.0 Tcl "Tcl Built-In Commands" @@ -39,11 +39,8 @@ variables. .RS Under Windows, the environment variables PATH and COMSPEC in any capitalization are converted automatically to upper case. For instance, the -PATH variable could be exported by the operating system as -.QW path , -.QW Path , -.QW PaTh , -etc., causing otherwise simple Tcl code to have to +PATH variable could be exported by the operating system as ``path'', +``Path'', ``PaTh'', etc., causing otherwise simple Tcl code to have to support many special cases. All other environment variables inherited by Tcl are left unmodified. Setting an env array variable to blank is the same as unsetting it as this is the behavior of the underlying Windows OS. @@ -81,8 +78,7 @@ The \fIsigName\fR element will be the symbolic name of the signal that caused the process to terminate; it will be one of the names from the include file signal.h, such as \fBSIGPIPE\fR. The \fImsg\fR element will be a short human-readable message -describing the signal, such as -.QW "write on pipe with no readers" +describing the signal, such as ``write on pipe with no readers'' for \fBSIGPIPE\fR. .TP \fBCHILDSTATUS\fI pid code\fR @@ -99,8 +95,7 @@ The \fIsigName\fR element will be the symbolic name of the signal that caused the process to suspend; this will be one of the names from the include file signal.h, such as \fBSIGTTIN\fR. The \fImsg\fR element will be a short human-readable message -describing the signal, such as -.QW "background tty read" +describing the signal, such as ``background tty read'' for \fBSIGTTIN\fR. .TP \fBNONE\fR @@ -118,8 +113,7 @@ of the error that occurred, such as \fBENOENT\fR; this will be one of the values defined in the include file errno.h. The \fImsg\fR element will be a human-readable message corresponding to \fIerrName\fR, such as -.QW "no such file or directory" -for the \fBENOENT\fR case. +``no such file or directory'' for the \fBENOENT\fR case. .PP To set the \fB-errorcode\fR return option, applications should use library procedures such as \fBTcl_SetObjErrorCode\fR, \fBTcl_SetReturnOptions\fR, @@ -269,9 +263,7 @@ binary number. .VE 8.5 .PP .RS -17 digits is -.QW perfect -for IEEE floating-point in that it allows +17 digits is ``perfect'' for IEEE floating-point in that it allows double-precision values to be converted to strings and back to binary with no loss of information. However, using 17 digits prevents any rounding, which produces longer, less intuitive results. For example, @@ -342,9 +334,7 @@ This variable and functionality only exist if .TP \fBtcl_wordchars\fR The value of this variable is a regular expression that can be set to -control what are considered -.QW word -characters, for instances like +control what are considered ``word'' characters, for instances like selecting a word by double-clicking in text in Tk. It is platform dependent. On Windows, it defaults to \fB\\S\fR, meaning anything but a Unicode space character. Otherwise it defaults to \fB\\w\fR, @@ -352,9 +342,7 @@ which is any Unicode word character (number, letter, or underscore). .TP \fBtcl_nonwordchars\fR The value of this variable is a regular expression that can be set to -control what are considered -.QW non-word -characters, for instances like +control what are considered ``non-word'' characters, for instances like selecting a word by double-clicking in text in Tk. It is platform dependent. On Windows, it defaults to \fB\\s\fR, meaning any Unicode space character. Otherwise it defaults to \fB\\W\fR, which is anything but a diff --git a/doc/time.n b/doc/time.n index c23f86e..d980fec 100644 --- a/doc/time.n +++ b/doc/time.n @@ -5,7 +5,7 @@ '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. '\" -'\" RCS: @(#) $Id: time.n,v 1.6 2007/10/25 10:03:33 dkf Exp $ +'\" RCS: @(#) $Id: time.n,v 1.7 2007/10/26 20:11:53 dgp Exp $ '\" .so man.macros .TH time n "" Tcl "Tcl Built-In Commands" @@ -16,13 +16,14 @@ time \- Time the execution of a script .SH SYNOPSIS \fBtime \fIscript\fR ?\fIcount\fR? .BE + .SH DESCRIPTION .PP This command will call the Tcl interpreter \fIcount\fR times to evaluate \fIscript\fR (or once if \fIcount\fR isn't specified). It will then return a string of the form .CS -\fB503.2 microseconds per iteration\fR +\fB503 microseconds per iteration\fR .CE which indicates the average amount of time required per iteration, in microseconds. @@ -37,7 +38,9 @@ time { } } .CE + .SH "SEE ALSO" clock(n) + .SH KEYWORDS script, time diff --git a/doc/tm.n b/doc/tm.n index cc5bdd0..0c97541 100644 --- a/doc/tm.n +++ b/doc/tm.n @@ -4,7 +4,7 @@ '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. '\" -'\" RCS: @(#) $Id: tm.n,v 1.8 2007/10/25 14:07:32 dkf Exp $ +'\" RCS: @(#) $Id: tm.n,v 1.9 2007/10/26 20:11:53 dgp Exp $ '\" .so man.macros .TH tm n 8.5 Tcl "Tcl Built-In Commands" @@ -56,11 +56,8 @@ that they are searched for modules. .TP \fB::tcl::tm::roots\fR \fIpath\fR... Similar to \fBpath add\fR, and layered on top of it. This command -takes a list of paths, extends each with -.QW "\fBtcl\fIX\fB/site-tcl\fR" , -and -.QW "\fBtcl\fIX\fB/\fIX\fB.\fIy\fR" , -for major version \fIX\fR of the +takes a list of paths, extends each with "\fBtcl\fIX\fB/site-tcl\fR", +and "\fBtcl\fIX\fB/\fIX\fB.\fIy\fR", for major version \fIX\fR of the Tcl interpreter and minor version \fIy\fR less than or equal to the minor version of the interpreter, and adds the resulting set of paths to the list of paths to search. @@ -115,37 +112,22 @@ For any two directories, neither is an ancestor directory of the other. .PP This is required to avoid ambiguities in package naming. If for -example the two directories -.QW \fIfoo/\fR -and -.QW \fIfoo/cool\fR -were on -the path a package named -.QW \fBcool::ice\fR -could be found via the names -.QW \fBcool::ice\fR -or -.QW \fBice\fR , -the latter potentially obscuring a package named -.QW \fBice\fR , -unqualified. +example the two directories "\fIfoo/\fR" and "\fIfoo/cool\fR" were on +the path a package named \fBcool::ice\fR could be found via the +names \fBcool::ice\fR or \fBice\fR, the latter potentially +obscuring a package named \fBice\fR, unqualified. .PP Before the search is started, the name of the requested package is translated into a partial path, using the following algorithm: .IP -All occurrences of -.QW \fB::\fR -in the package name are replaced by the appropriate directory -separator character for the platform we are on. On Unix, for example, -this is -.QW \fB/\fR . +All occurrences of "\fB::\fR" in the package name are replaced by +the appropriate directory separator character for the platform we are +on. On Unix, for example, this is "\fB/\fR". .PP Example: .IP -The requested package is -.QW \fBencoding::base64\fR . -The generated partial path is -.QW \fIencoding/base64\fR +The requested package is \fBencoding::base64\fR. The generated +partial path is "\fIencoding/base64\fR" .PP After this translation the package is looked for in all module paths, by combining them one-by-one, first to last with the partial path to @@ -175,13 +157,12 @@ Both package name \fBPNAME\fR and package version \fBPVERSION\fR are extracted from the filename \fBMF\fR according to the definition below: .CS -\fBMF\fR = /module_path/\fBPNAME\(fm\fR-\fBPVERSION\fR.tm +\fBMF\fR = /module_path/\fBPNAME'\fR-\fBPVERSION\fR.tm .CE .PP -Where \fBPNAME\(fm\fR is the partial path of the module as defined in -section \fBFINDING MODULES\fR, and translated into \fBPNAME\fR by -changing all directory separators to -.QW \fB::\fR , +Where \fBPNAME'\fR is the partial path of the module as defined in +section \fBFINDING MODULES\fR, and translated into \fB\fRPNAME by +changing all directory separators to "\fB::\fR", and \fBmodule_path\fR is the path (from the list of paths to search) that we found the module file under. .PP @@ -272,11 +253,13 @@ environment variables: \fB$::env(TCL8.0_TM_PATH)\fR .CE .RE + .SH "SEE ALSO" -package(n), Tcl Improvement Proposal #189 -.QW "\fITcl Modules\fR" -(online at http://tip.tcl.tk/189.html), Tcl Improvement Proposal #190 -.QW "\fIImplementation Choices for Tcl Modules\fR" -(online at http://tip.tcl.tk/190.html) +package(n), Tcl Improvement Proposal #189 "\fITcl Modules\fR" (online +at http://tip.tcl.tk/189.html), Tcl Improvement Proposal #190 +"\fIImplementation Choices for Tcl Modules\fR" (online at +http://tip.tcl.tk/190.html) + + .SH "KEYWORDS" modules, package diff --git a/doc/trace.n b/doc/trace.n index 7ab4f07..e929a53 100644 --- a/doc/trace.n +++ b/doc/trace.n @@ -6,7 +6,7 @@ '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. '\" -'\" RCS: @(#) $Id: trace.n,v 1.20 2007/10/25 14:07:32 dkf Exp $ +'\" RCS: @(#) $Id: trace.n,v 1.21 2007/10/26 20:11:53 dgp Exp $ '\" .so man.macros .TH trace n "8.4" Tcl "Tcl Built-In Commands" @@ -21,7 +21,7 @@ trace \- Monitor variable accesses, command usages and command executions .SH DESCRIPTION .PP This command causes Tcl commands to be executed whenever certain operations are -invoked. The legal \fIoption\fRs (which may be abbreviated) are: +invoked. The legal \fIoption\fR's (which may be abbreviated) are: .TP \fBtrace add \fItype name ops ?args?\fR Where \fItype\fR is \fBcommand\fR, \fBexecution\fR, or \fBvariable\fR. @@ -40,8 +40,7 @@ one or more of the following items: \fBrename\fR Invoke \fIcommand\fR whenever the command is renamed. Note that renaming to the empty string is considered deletion, and will not -be traced with -.QW rename . +be traced with '\fBrename\fR'. .TP \fBdelete\fR Invoke \fIcommand\fR when the command is deleted. Commands can be @@ -58,9 +57,7 @@ command is as follows: .CE \fIOldName\fR and \fInewName\fR give the traced command's current (old) name, and the name to which it is being renamed (the empty -string if this is a -.QW delete -operation). +string if this is a 'delete' operation). \fIOp\fR indicates what operation is being performed on the command, and is one of \fBrename\fR or \fBdelete\fR as defined above. The trace operation cannot be used to stop a command @@ -95,11 +92,9 @@ just after the actual execution takes place. \fBenterstep\fR Invoke \fIcommand\fR for every Tcl command which is executed inside the procedure \fIname\fR, just before the actual execution -takes place. For example if we have -.QW "proc foo {} { puts {hello world} }" , -then an \fIenterstep\fR trace would be invoked just before -.QW "puts {hello world}" -is executed. +takes place. For example if we have 'proc foo {} { puts "hello" }', +then an \fIenterstep\fR trace would be +invoked just before \fIputs "hello"\fR is executed. Setting an \fIenterstep\fR trace on a \fIcommand\fR will not result in an error and is simply ignored. .TP @@ -126,8 +121,7 @@ all arguments in their fully expanded form. command execution, and is one of \fBenter\fR or \fBenterstep\fR as defined above. The trace operation can be used to stop the command from executing, by deleting the command in question. Of -course when the command is subsequently executed, an -.QW "invalid command" +course when the command is subsequently executed, an 'invalid command' error will occur. .PP For \fBleave\fR and \fBleavestep\fR operations: diff --git a/doc/update.n b/doc/update.n index 76f3188..e0e5a5f 100644 --- a/doc/update.n +++ b/doc/update.n @@ -5,7 +5,7 @@ '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. '\" -'\" RCS: @(#) $Id: update.n,v 1.7 2007/10/24 14:29:39 dkf Exp $ +'\" RCS: @(#) $Id: update.n,v 1.8 2007/10/26 20:11:53 dgp Exp $ '\" .so man.macros .TH update n 7.5 Tcl "Tcl Built-In Commands" @@ -19,8 +19,7 @@ update \- Process pending events and idle callbacks .SH DESCRIPTION .PP -This command is used to bring the application -.QW "up to date" +This command is used to bring the application ``up to date'' by entering the event loop repeatedly until all pending events (including idle callbacks) have been processed. .PP diff --git a/doc/uplevel.n b/doc/uplevel.n index 3de309a..cb760ae 100644 --- a/doc/uplevel.n +++ b/doc/uplevel.n @@ -5,7 +5,7 @@ '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. '\" -'\" RCS: @(#) $Id: uplevel.n,v 1.7 2007/10/24 14:29:39 dkf Exp $ +'\" RCS: @(#) $Id: uplevel.n,v 1.8 2007/10/26 20:11:53 dgp Exp $ '\" .so man.macros .TH uplevel n "" Tcl "Tcl Built-In Commands" @@ -55,9 +55,8 @@ the command .CE then the \fBset\fR command will modify the same variable \fBx\fR in \fBb\fR's context: the procedure \fBc\fR does not appear to be on the call stack -when \fBd\fR is executing. The command -.QW "\fBinfo level\fR" -may be used to obtain the level of the current procedure. +when \fBd\fR is executing. The command ``\fBinfo level\fR'' may +be used to obtain the level of the current procedure. .PP \fBUplevel\fR makes it possible to implement new control constructs as Tcl procedures (for example, \fBuplevel\fR could @@ -93,7 +92,9 @@ proc do {body while condition} { } } .CE + .SH "SEE ALSO" apply(n), namespace(n), upvar(n) + .SH KEYWORDS context, level, namespace, stack frame, variables diff --git a/doc/upvar.n b/doc/upvar.n index de29c99..c99f73d 100644 --- a/doc/upvar.n +++ b/doc/upvar.n @@ -5,7 +5,7 @@ '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. '\" -'\" RCS: @(#) $Id: upvar.n,v 1.13 2007/10/25 09:58:53 dkf Exp $ +'\" RCS: @(#) $Id: upvar.n,v 1.14 2007/10/26 20:11:53 dgp Exp $ '\" .so man.macros .TH upvar n "" Tcl "Tcl Built-In Commands" @@ -16,6 +16,7 @@ upvar \- Create link to variable in a different stack frame .SH SYNOPSIS \fBupvar \fR?\fIlevel\fR? \fIotherVar myVar \fR?\fIotherVar myVar \fR...? .BE + .SH DESCRIPTION .PP This command arranges for one or more local variables in the current @@ -80,10 +81,7 @@ unexpected manner. If a variable trace is defined on \fIotherVar\fR, that trace will be triggered by actions involving \fImyVar\fR. However, the trace procedure will be passed the name of \fImyVar\fR, rather than the name of \fIotherVar\fR. Thus, the output of the following code -will be -.QW "\fIlocalVar\fR" -rather than -.QW "\fIoriginalVar\fR" : +will be "\fIlocalVar\fR" rather than "\fIoriginalVar\fR": .CS proc \fItraceproc\fR { name index op } { puts $name @@ -111,7 +109,9 @@ proc decr {varName {decrement 1}} { incr var [expr {-$decrement}] } .CE + .SH "SEE ALSO" global(n), namespace(n), uplevel(n), variable(n) + .SH KEYWORDS context, frame, global, level, namespace, procedure, variable -- cgit v0.12