From c09f838395bcc33cae854be44a2be5020fb45f87 Mon Sep 17 00:00:00 2001 From: Steve Bennett Date: Sat, 23 Apr 2011 15:57:08 +1000 Subject: Document recent features jimsh --version tcl_platform() proc &var proc rename args expr sugar $(...) Also add documentation for jimsh, including interactive mode Signed-off-by: Steve Bennett --- Tcl_shipped.html | 163 +++++++++++++++++++++++++++++++++++++++++++++++++------ 1 file changed, 146 insertions(+), 17 deletions(-) (limited to 'Tcl_shipped.html') diff --git a/Tcl_shipped.html b/Tcl_shipped.html index 864aa0a..bb3bd90 100644 --- a/Tcl_shipped.html +++ b/Tcl_shipped.html @@ -554,7 +554,7 @@ Jim Tcl(n) Manual Page

NAME

-

Jim Tcl v0.70 - +

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

@@ -570,7 +570,9 @@ Jim Tcl(n) Manual Page

or

-
jimsh <script>
+
jimsh [<scriptfile>]
+jimsh -e '<immediate-script>'
+jimsh --version
Quick Index
  • @@ -666,19 +668,61 @@ Variable traces are not supported
  • -The history command is not supported +Direct command line editing rather than the history command +

    +
  • +
  • +

    +Expression shorthand syntax: $(…) +

    +
  • +
  • +

    +The binary command is not supported

-

CHANGES IN THIS RELEASE

+

RECENT CHANGES

+
+

Changes between 0.70 and 0.71

+
    +
  1. +

    +Allow args to be renamed in procs +

    +
  2. +
  3. +

    +Add $(…) shorthand syntax for expressions +

    +
  4. +
  5. +

    +Add automatic reference variables in procs with &var syntax +

    +
  6. +
  7. +

    +Support jimsh --version +

    +
  8. +
  9. +

    +Additional variables in tcl_platform() +

    +
  10. +
+
+
+

Changes between 0.63 and 0.70

  1. -$::platform_tcl() settings are now automatically determined +platform_tcl() settings are now automatically determined

  2. @@ -734,6 +778,7 @@ Command line editing in interactive mode, e.g. jimsh
+

TCL INTRODUCTION

@@ -773,6 +818,8 @@ Tcl core described here, but various add-on libraries, such as the Tk toolkit, allow applications to issue commands to each other. This makes it possible for applications to work together in much more powerful ways than was previously possible.

+

Fourth, Jim Tcl includes a command processor, jimsh, which can be +used to run standalone Tcl scripts, or to run Tcl commands interactively.

This manual page focuses primarily on the Tcl language. It describes the language syntax and the built-in commands that will be available in any application based on Tcl. The individual library procedures are @@ -780,6 +827,58 @@ described in more detail in separate manual pages, one per procedure.

+

JIMSH COMMAND INTERPRETER

+
+

A simple, but powerful command processor, jimsh, is part of Jim Tcl. +It may be invoked in interactive mode as:

+
+
+
jimsh
+
+

or to process the Tcl script in a file with:

+
+
+
jimsh filename
+
+

It may also be invoked to execute an immediate script with:

+
+
+
jimsh -e "script"
+
+
+

Interactive Mode

+

Interactive mode reads Tcl commands from standard input, evaluates +those commands and prints the results.

+
+
+
$ jimsh
+Welcome to Jim version 0.71, Copyright (c) 2005-8 Salvatore Sanfilippo
+. info version
+0.71
+. lsort [info commands p*]
+package parray pid popen proc puts pwd
+. foreach i {a b c} {
+{> puts $i
+{> }
+a
+b
+c
+. bad
+invalid command name "bad"
+[error] . exit
+$
+
+

If jimsh is configured with line editing (it is by default) and a VT-100-compatible +terminal is detected, Emacs-style line editing commands are available, including: +arrow keys, ^W to erase a word, ^U to erase the line, ^R for reverse incremental search +in history. Additionally, the h command may be used to display the command history.

+

Command line history is automatically saved and loaded from ~/.jim_history

+

In interactive mode, jimsh automatically runs the script ~/.jimrc at startup +if it exists.

+
+
+
+

INTERPRETERS

The central data structure in Tcl is an interpreter (C type Jim_Interp). @@ -1218,7 +1317,7 @@ sequence is replaced by the given character:

The hex digits nnnn (between one and four of them) give a unicode codepoint. - The UTF-8 encoding of the codepoint is inserted. + The UTF-8 encoding of the codepoint is inserted.

@@ -2010,13 +2109,26 @@ argument specifiers:

+&name +
+
+

+ Reference Argument - The caller is expected to pass the name of + an existing variable. An implicit upvar 1 origname name is done + to make the variable available in the proc scope. +

+
+
args

- Variable Argument - The special name args, which is + Variable Argument - The special name args, which is assigned all remaining arguments (including none). The - variable argument may only be specified once. + 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, + the variable is named newname rather than args.

@@ -3351,6 +3463,13 @@ to 0.

expr arg

Calls the expression processor to evaluate arg, and returns the result as a string. See the section EXPRESSIONS above.

+

Note that Jim supports a shorthand syntax for expr as $(…) +The following two are identical.

+
+
+
set x [expr {3 * 2 + 1}]
+set x $(3 * 2 + 1)
+

file

@@ -5152,9 +5271,9 @@ The legal options (which may be abbreviated) are:

Returns the length of the string in bytes. This will return - the same value as string length if UTF-8 support is not enabled, - or if the string is composed entirely of ASCII characters. - See UTF-8 AND UNICODE. + the same value as string length if UTF-8 support is not enabled, + or if the string is composed entirely of ASCII characters. + See UTF-8 AND UNICODE.

@@ -5380,8 +5499,8 @@ Any hexadecimal digit character ([0-9A-Fa-f]).

Returns a decimal string giving the number of characters in string. - If UTF-8 support is enabled, this may be different than the number of bytes. - See UTF-8 AND UNICODE + If UTF-8 support is enabled, this may be different than the number of bytes. + See UTF-8 AND UNICODE

@@ -6085,8 +6204,8 @@ uid 1000 euid 1000 gid 100 egid 100

Returns the original filename used when opening the file. - If the handle was returned from socket, the type of the - handle is returned instead. + If the handle was returned from socket, the type of the + handle is returned instead.

@@ -6518,8 +6637,18 @@ by the Tcl library.

This variable is set by Jim as an array containing information - about the platform upon which Jim was built. + about the platform upon which Jim was built. The following is an + example of the contents of this array.

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