Tcl Source Code

Hex Artifact Content
Login

Artifact 87517dd291be5d4cae3dedfd6101842686eb911c:

Attachment "mod-doc" to ticket [3011289fff] added by coldstore 2010-06-04 07:22:02.
0000: 41 20 63 6f 6d 6d 61 6e 64 20 69 73 20 65 76 61  A command is eva
0010: 6c 75 61 74 65 64 20 69 6e 20 74 77 6f 20 73 74  luated in two st
0020: 65 70 73 3a 0a 0a 20 28 61 29 20 54 68 65 20 54  eps:.. (a) The T
0030: 63 6c 20 69 6e 74 65 72 70 72 65 74 65 72 20 62  cl interpreter b
0040: 72 65 61 6b 73 20 74 68 65 20 63 6f 6d 6d 61 6e  reaks the comman
0050: 64 20 69 6e 74 6f 20 77 6f 72 64 73 20 61 6e 64  d into words and
0060: 20 70 65 72 66 6f 72 6d 73 20 73 75 62 73 74 69   performs substi
0070: 74 75 74 69 6f 6e 73 20 61 73 20 64 65 73 63 72  tutions as descr
0080: 69 62 65 64 20 62 65 6c 6f 77 2e 20 20 28 4e 6f  ibed below.  (No
0090: 74 65 3a 20 54 68 65 73 65 20 73 75 62 73 74 69  te: These substi
00a0: 74 75 74 69 6f 6e 73 20 61 72 65 20 70 65 72 66  tutions are perf
00b0: 6f 72 6d 65 64 20 69 6e 20 74 68 65 20 73 61 6d  ormed in the sam
00c0: 65 20 77 61 79 20 66 6f 72 20 61 6c 6c 20 63 6f  e way for all co
00d0: 6d 6d 61 6e 64 73 2e 29 0a 0a 20 28 62 29 20 54  mmands.).. (b) T
00e0: 68 65 20 66 69 72 73 74 20 77 6f 72 64 20 72 65  he first word re
00f0: 73 75 6c 74 69 6e 67 20 66 72 6f 6d 20 28 61 29  sulting from (a)
0100: 20 69 73 20 75 73 65 64 20 74 6f 20 6c 6f 63 61   is used to loca
0110: 74 65 20 61 20 63 6f 6d 6d 61 6e 64 20 70 72 6f  te a command pro
0120: 63 65 64 75 72 65 20 74 6f 20 63 61 72 72 79 20  cedure to carry 
0130: 6f 75 74 20 74 68 65 20 63 6f 6d 6d 61 6e 64 2c  out the command,
0140: 20 74 68 65 6e 20 61 6c 6c 20 6f 66 20 74 68 65   then all of the
0150: 20 77 6f 72 64 73 20 6f 66 20 74 68 65 20 63 6f   words of the co
0160: 6d 6d 61 6e 64 20 61 72 65 20 70 61 73 73 65 64  mmand are passed
0170: 20 74 6f 20 74 68 65 20 63 6f 6d 6d 61 6e 64 20   to the command 
0180: 70 72 6f 63 65 64 75 72 65 2e 20 28 4e 6f 74 65  procedure. (Note
0190: 3a 20 54 68 65 20 63 6f 6d 6d 61 6e 64 20 70 72  : The command pr
01a0: 6f 63 65 64 75 72 65 20 6f 66 20 28 62 29 20 69  ocedure of (b) i
01b0: 73 20 66 72 65 65 20 74 6f 20 69 6e 74 65 72 70  s free to interp
01c0: 72 65 74 20 65 61 63 68 20 6f 66 20 69 74 73 20  ret each of its 
01d0: 77 6f 72 64 73 20 69 6e 20 61 6e 79 20 77 61 79  words in any way
01e0: 20 69 74 20 6c 69 6b 65 73 2c 20 73 75 63 68 20   it likes, such 
01f0: 61 73 20 61 6e 20 69 6e 74 65 67 65 72 2c 20 76  as an integer, v
0200: 61 72 69 61 62 6c 65 20 6e 61 6d 65 2c 20 6c 69  ariable name, li
0210: 73 74 2c 20 6f 72 20 54 63 6c 20 73 63 72 69 70  st, or Tcl scrip
0220: 74 2e 20 44 69 66 66 65 72 65 6e 74 20 63 6f 6d  t. Different com
0230: 6d 61 6e 64 73 20 69 6e 74 65 72 70 72 65 74 20  mands interpret 
0240: 74 68 65 69 72 20 77 6f 72 64 73 20 64 69 66 66  their words diff
0250: 65 72 65 6e 74 6c 79 2e 29 0a                    erently.).