From 6233a6c5d39928f1bfafa8f41cb1ddf0c5a83de0 Mon Sep 17 00:00:00 2001 From: Steve Bennett Date: Mon, 18 Jul 2011 14:25:44 +1000 Subject: Update documentation for recent features Signed-off-by: Steve Bennett --- Tcl_shipped.html | 205 ++++++++++++++++++++++++++++++++++++++----------------- 1 file changed, 141 insertions(+), 64 deletions(-) (limited to 'Tcl_shipped.html') diff --git a/Tcl_shipped.html b/Tcl_shipped.html index 9168e7c..da333b4 100644 --- a/Tcl_shipped.html +++ b/Tcl_shipped.html @@ -554,7 +554,7 @@ Jim Tcl(n) Manual Page

NAME

-

Jim Tcl v0.71 - +

Jim Tcl v0.72 - overview of the Jim tool command language facilities

@@ -683,6 +683,36 @@ Expression shorthand syntax: $(…)

RECENT CHANGES

+

Changes between 0.71 and 0.72

+
    +
  1. +

    +procs now allow args and optional parameters in any position +

    +
  2. +
  3. +

    +Add Tcl-compatible expr functions, rand() and srand() +

    +
  4. +
  5. +

    +Add support for the -force option to file delete +

    +
  6. +
  7. +

    +Better diagnostics when source fails to load a script with a missing quote or bracket +

    +
  8. +
  9. +

    +New tcl_platform(pathSeparator) +

    +
  10. +
+
+

Changes between 0.70 and 0.71

  1. @@ -1606,15 +1636,18 @@ on the right side of the line:

of precedence:

-int() double() round() abs() +int() double() round() abs(), rand(), srand()

- Unary functions. + Unary functions (except rand() which takes no arguments) int() converts the numeric argument to an integer by truncating down. double() converts the numeric argument to floating point. round() converts the numeric argument to the closest integer value. abs() takes the absolute value of the numeric argument. + rand() takes the absolute value of the numeric argument. + rand() returns a pseudo-random floating-point value in the range (0,1). + srand() takes an integer argument to (re)seed the random number generator. Returns the first random number from that seed.

@@ -2111,12 +2144,12 @@ The only difference is that its body isn’t a piece of C code linked into the program; it is a string containing one or more other Tcl commands.

The proc command is used to create a new Tcl command procedure:

-

proc name args ?statics? body

+

proc name arglist ?statics? body

The new command is name name, and it replaces any existing command there may have been by that name. Whenever the new command is invoked, the contents of body will be executed by the Tcl interpreter.

-

args specifies the formal arguments to the procedure. +

arglist specifies the formal arguments to the procedure. It consists of a list, possibly empty, of the following argument specifiers:

@@ -2154,7 +2187,7 @@ argument specifiers:

Variable Argument - The special name args, which is - assigned all remaining arguments (including none). The + assigned all remaining arguments (including none) as a list. The variable argument may only be specified once. Note that the syntax args newname may be used to retain the special behaviour of args with a different local name. In this case, @@ -2162,30 +2195,6 @@ argument specifiers:

-

Arguments must be provided in the following order, any of which -may be omitted:

-
    -
  1. -

    -Required Arguments (Left) -

    -
  2. -
  3. -

    -Optional Arguments -

    -
  4. -
  5. -

    -Variable Argument -

    -
  6. -
  7. -

    -Required Arguments (Right) -

    -
  8. -

When the command is invoked, a local variable will be created for each of the formal arguments to the procedure; its value will be the value of corresponding argument in the invoking command or the argument’s @@ -2194,31 +2203,98 @@ default value.

invocation. However, there must be enough actual arguments for all required arguments, and there must not be any extra actual arguments (unless the Variable Argument is specified).

-

Actual arguments are assigned to formal arguments as follows:

+

Actual arguments are assigned to formal arguments as in left-to-right +order with the following precedence.

  1. -Left Required Arguments are assigned from the left +Required Arguments (including Reference Arguments)

  2. -Right Required Arguments are assigned from the right -

    -
  3. -
  4. -

    -Default Arguments are assigned from the left, following the Left Required Arguments. +Optional Arguments

  5. -A list is formed from any remaining arguments, which are then - are assigned to the args Variable Argument (if specified). The list will be empty - if there are no remaining arguments. +Variable Argument

+

The following example illustrates precedence. Assume a procedure declaration:

+
+
+
proc p {{a A} args b {c C} d} {...}
+
+

This procedure requires at least two arguments, but can accept an unlimited number. +The following table shows how various numbers of arguments are assigned. +Values marked as - are assigned the default value.

+
+ +++++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Number of argumentsaargsbcd

2

-

-

1

-

2

3

1

-

2

-

3

4

1

-

2

3

4

5

1

2

3

4

5

6

1

2,3

4

5

6

+

When body is being executed, variable names normally refer to local variables, which are created automatically when referenced and deleted when the procedure returns. One local variable is automatically created @@ -3111,7 +3187,7 @@ if {[$e var]} { command. The legal options are:

-dict create ?key value …?+ +dict create ?key value …?

@@ -3122,7 +3198,7 @@ command. The legal options are:

-dict exists dictionary key ?key …?+ +dict exists dictionary key ?key …?

@@ -3133,7 +3209,7 @@ command. The legal options are:

-dict get dictionary ?key …?+ +dict get dictionary ?key …?

@@ -3151,7 +3227,7 @@ command. The legal options are:

-dict keys dictionary ?pattern?+ +dict keys dictionary ?pattern?

@@ -3162,7 +3238,7 @@ command. The legal options are:

-dict keys dictionary ?pattern?+ +dict keys dictionary ?pattern?

@@ -3173,7 +3249,7 @@ command. The legal options are:

-dict set dictionaryName key ?key …? value+ +dict set dictionaryName key ?key …? value

@@ -3185,7 +3261,7 @@ command. The legal options are:

-dict unset dictionaryName key ?key …? value+ +dict unset dictionaryName key ?key …? value

@@ -3530,12 +3606,14 @@ abbreviation for option is acceptable. The valid options are:<

-file delete name … +file delete ?-force? name …

Deletes file or directory name. If the file or directory doesn’t exist, nothing happens. - If it can’t be deleted, an error is generated. Non-empty directories will not be deleted. + If it can’t be deleted, an error is generated. Non-empty directories will not be deleted + unless the -force options is given. In this case no errors will be generated, even + if the file/directory can’t be deleted.

@@ -4095,10 +4173,8 @@ The legal option's (which may be abbreviated) are:

Returns the name of the binary file from which the application - was invoked, either - as a path relative to the current directory or as a full - path. If the path can’t be determined, returns the empty - string. + was invoked. A full path will be returned, unless the path + can’t be determined, in which case the empty string will be returned.

@@ -5306,7 +5382,7 @@ same form as produced by catch and info stacktrace

The legal options (which may be abbreviated) are:

-*string bytelength string +string bytelength string

@@ -6471,11 +6547,11 @@ to prevent infinite errors. (A time event handler is always removed after execut

-*socket ?-ipv6? stream.server ?addr:?port +socket ?-ipv6? stream.server ?addr:?port

- A TCP socket server (addr defaults to 0.0.0.0 for IPv4 or [::] for IPv6). + A TCP socket server (addr defaults to 0.0.0.0 for IPv4 or [::] for IPv6).

@@ -6706,12 +6782,13 @@ by the Tcl library.

-
tcl_platform(byteOrder)   = littleEndian
-tcl_platform(os)          = Darwin
-tcl_platform(platform)    = unix
-tcl_platform(pointerSize) = 8
-tcl_platform(threaded)    = 0
-tcl_platform(wordSize)    = 8
+
tcl_platform(byteOrder)     = littleEndian
+tcl_platform(os)            = Darwin
+tcl_platform(platform)      = unix
+tcl_platform(pointerSize)   = 8
+tcl_platform(threaded)      = 0
+tcl_platform(wordSize)      = 8
+tcl_platform(pathSeparator) = :
@@ -7025,7 +7102,7 @@ official policies, either expressed or implied, of the Jim Tcl Project.
-- cgit v1.1