Tcl Source Code

Hex Artifact Content
Login

Artifact e6e5aeb81080f5b1c19a3d643a59e54a9190130cef858005070eacc3d05ed709:


0000: 27 5c 22 0a 27 5c 22 20 43 6f 70 79 72 69 67 68  '\".'\" Copyrigh
0010: 74 20 28 63 29 20 31 39 39 36 20 53 75 6e 20 4d  t (c) 1996 Sun M
0020: 69 63 72 6f 73 79 73 74 65 6d 73 2c 20 49 6e 63  icrosystems, Inc
0030: 2e 0a 27 5c 22 0a 27 5c 22 20 53 65 65 20 74 68  ..'\".'\" See th
0040: 65 20 66 69 6c 65 20 22 6c 69 63 65 6e 73 65 2e  e file "license.
0050: 74 65 72 6d 73 22 20 66 6f 72 20 69 6e 66 6f 72  terms" for infor
0060: 6d 61 74 69 6f 6e 20 6f 6e 20 75 73 61 67 65 20  mation on usage 
0070: 61 6e 64 20 72 65 64 69 73 74 72 69 62 75 74 69  and redistributi
0080: 6f 6e 0a 27 5c 22 20 6f 66 20 74 68 69 73 20 66  on.'\" of this f
0090: 69 6c 65 2c 20 61 6e 64 20 66 6f 72 20 61 20 44  ile, and for a D
00a0: 49 53 43 4c 41 49 4d 45 52 20 4f 46 20 41 4c 4c  ISCLAIMER OF ALL
00b0: 20 57 41 52 52 41 4e 54 49 45 53 2e 0a 27 5c 22   WARRANTIES..'\"
00c0: 0a 2e 54 48 20 70 61 63 6b 61 67 65 20 6e 20 37  ..TH package n 7
00d0: 2e 35 20 54 63 6c 20 22 54 63 6c 20 42 75 69 6c  .5 Tcl "Tcl Buil
00e0: 74 2d 49 6e 20 43 6f 6d 6d 61 6e 64 73 22 0a 2e  t-In Commands"..
00f0: 73 6f 20 6d 61 6e 2e 6d 61 63 72 6f 73 0a 2e 42  so man.macros..B
0100: 53 0a 27 5c 22 20 4e 6f 74 65 3a 20 20 64 6f 20  S.'\" Note:  do 
0110: 6e 6f 74 20 6d 6f 64 69 66 79 20 74 68 65 20 2e  not modify the .
0120: 53 48 20 4e 41 4d 45 20 6c 69 6e 65 20 69 6d 6d  SH NAME line imm
0130: 65 64 69 61 74 65 6c 79 20 62 65 6c 6f 77 21 0a  ediately below!.
0140: 2e 53 48 20 4e 41 4d 45 0a 70 61 63 6b 61 67 65  .SH NAME.package
0150: 20 5c 2d 20 46 61 63 69 6c 69 74 69 65 73 20 66   \- Facilities f
0160: 6f 72 20 70 61 63 6b 61 67 65 20 6c 6f 61 64 69  or package loadi
0170: 6e 67 20 61 6e 64 20 76 65 72 73 69 6f 6e 20 63  ng and version c
0180: 6f 6e 74 72 6f 6c 0a 2e 53 48 20 53 59 4e 4f 50  ontrol..SH SYNOP
0190: 53 49 53 0a 2e 6e 66 0a 5c 66 42 70 61 63 6b 61  SIS..nf.\fBpacka
01a0: 67 65 20 66 69 6c 65 73 5c 66 49 20 70 61 63 6b  ge files\fI pack
01b0: 61 67 65 5c 66 52 0a 5c 66 42 70 61 63 6b 61 67  age\fR.\fBpackag
01c0: 65 20 66 6f 72 67 65 74 5c 66 52 20 3f 5c 66 49  e forget\fR ?\fI
01d0: 70 61 63 6b 61 67 65 20 70 61 63 6b 61 67 65 20  package package 
01e0: 2e 2e 2e 5c 66 52 3f 0a 5c 66 42 70 61 63 6b 61  ...\fR?.\fBpacka
01f0: 67 65 20 69 66 6e 65 65 64 65 64 20 5c 66 49 70  ge ifneeded \fIp
0200: 61 63 6b 61 67 65 20 76 65 72 73 69 6f 6e 5c 66  ackage version\f
0210: 52 20 3f 5c 66 49 73 63 72 69 70 74 5c 66 52 3f  R ?\fIscript\fR?
0220: 0a 5c 66 42 70 61 63 6b 61 67 65 20 6e 61 6d 65  .\fBpackage name
0230: 73 5c 66 52 0a 5c 66 42 70 61 63 6b 61 67 65 20  s\fR.\fBpackage 
0240: 70 72 65 73 65 6e 74 20 5c 66 49 70 61 63 6b 61  present \fIpacka
0250: 67 65 20 5c 66 52 3f 5c 66 49 72 65 71 75 69 72  ge \fR?\fIrequir
0260: 65 6d 65 6e 74 2e 2e 2e 5c 66 52 3f 0a 5c 66 42  ement...\fR?.\fB
0270: 70 61 63 6b 61 67 65 20 70 72 65 73 65 6e 74 20  package present 
0280: 5c 2d 65 78 61 63 74 20 5c 66 49 70 61 63 6b 61  \-exact \fIpacka
0290: 67 65 20 76 65 72 73 69 6f 6e 5c 66 52 0a 5c 66  ge version\fR.\f
02a0: 42 70 61 63 6b 61 67 65 20 70 72 6f 76 69 64 65  Bpackage provide
02b0: 20 5c 66 49 70 61 63 6b 61 67 65 20 5c 66 52 3f   \fIpackage \fR?
02c0: 5c 66 49 76 65 72 73 69 6f 6e 5c 66 52 3f 0a 5c  \fIversion\fR?.\
02d0: 66 42 70 61 63 6b 61 67 65 20 72 65 71 75 69 72  fBpackage requir
02e0: 65 20 5c 66 49 70 61 63 6b 61 67 65 20 5c 66 52  e \fIpackage \fR
02f0: 3f 5c 66 49 72 65 71 75 69 72 65 6d 65 6e 74 2e  ?\fIrequirement.
0300: 2e 2e 5c 66 52 3f 0a 5c 66 42 70 61 63 6b 61 67  ..\fR?.\fBpackag
0310: 65 20 72 65 71 75 69 72 65 20 5c 2d 65 78 61 63  e require \-exac
0320: 74 20 5c 66 49 70 61 63 6b 61 67 65 20 76 65 72  t \fIpackage ver
0330: 73 69 6f 6e 5c 66 52 0a 5c 66 42 70 61 63 6b 61  sion\fR.\fBpacka
0340: 67 65 20 75 6e 6b 6e 6f 77 6e 20 5c 66 52 3f 5c  ge unknown \fR?\
0350: 66 49 63 6f 6d 6d 61 6e 64 5c 66 52 3f 0a 5c 66  fIcommand\fR?.\f
0360: 42 70 61 63 6b 61 67 65 20 76 63 6f 6d 70 61 72  Bpackage vcompar
0370: 65 20 5c 66 49 76 65 72 73 69 6f 6e 31 20 76 65  e \fIversion1 ve
0380: 72 73 69 6f 6e 32 5c 66 52 0a 5c 66 42 70 61 63  rsion2\fR.\fBpac
0390: 6b 61 67 65 20 76 65 72 73 69 6f 6e 73 20 5c 66  kage versions \f
03a0: 49 70 61 63 6b 61 67 65 5c 66 52 0a 5c 66 42 70  Ipackage\fR.\fBp
03b0: 61 63 6b 61 67 65 20 76 73 61 74 69 73 66 69 65  ackage vsatisfie
03c0: 73 20 5c 66 49 76 65 72 73 69 6f 6e 20 72 65 71  s \fIversion req
03d0: 75 69 72 65 6d 65 6e 74 2e 2e 2e 5c 66 52 0a 5c  uirement...\fR.\
03e0: 66 42 70 61 63 6b 61 67 65 20 70 72 65 66 65 72  fBpackage prefer
03f0: 20 5c 66 52 3f 5c 66 42 6c 61 74 65 73 74 5c 66   \fR?\fBlatest\f
0400: 52 7c 5c 66 42 73 74 61 62 6c 65 5c 66 52 3f 0a  R|\fBstable\fR?.
0410: 2e 66 69 0a 2e 42 45 0a 2e 53 48 20 44 45 53 43  .fi..BE..SH DESC
0420: 52 49 50 54 49 4f 4e 0a 2e 50 50 0a 54 68 69 73  RIPTION..PP.This
0430: 20 63 6f 6d 6d 61 6e 64 20 6b 65 65 70 73 20 61   command keeps a
0440: 20 73 69 6d 70 6c 65 20 64 61 74 61 62 61 73 65   simple database
0450: 20 6f 66 20 74 68 65 20 70 61 63 6b 61 67 65 73   of the packages
0460: 20 61 76 61 69 6c 61 62 6c 65 20 66 6f 72 0a 75   available for.u
0470: 73 65 20 62 79 20 74 68 65 20 63 75 72 72 65 6e  se by the curren
0480: 74 20 69 6e 74 65 72 70 72 65 74 65 72 20 61 6e  t interpreter an
0490: 64 20 68 6f 77 20 74 6f 20 6c 6f 61 64 20 74 68  d how to load th
04a0: 65 6d 20 69 6e 74 6f 20 74 68 65 0a 69 6e 74 65  em into the.inte
04b0: 72 70 72 65 74 65 72 2e 0a 49 74 20 73 75 70 70  rpreter..It supp
04c0: 6f 72 74 73 20 6d 75 6c 74 69 70 6c 65 20 76 65  orts multiple ve
04d0: 72 73 69 6f 6e 73 20 6f 66 20 65 61 63 68 20 70  rsions of each p
04e0: 61 63 6b 61 67 65 20 61 6e 64 20 61 72 72 61 6e  ackage and arran
04f0: 67 65 73 0a 66 6f 72 20 74 68 65 20 63 6f 72 72  ges.for the corr
0500: 65 63 74 20 76 65 72 73 69 6f 6e 20 6f 66 20 61  ect version of a
0510: 20 70 61 63 6b 61 67 65 20 74 6f 20 62 65 20 6c   package to be l
0520: 6f 61 64 65 64 20 62 61 73 65 64 20 6f 6e 20 77  oaded based on w
0530: 68 61 74 0a 69 73 20 6e 65 65 64 65 64 20 62 79  hat.is needed by
0540: 20 74 68 65 20 61 70 70 6c 69 63 61 74 69 6f 6e   the application
0550: 2e 0a 54 68 69 73 20 63 6f 6d 6d 61 6e 64 20 61  ..This command a
0560: 6c 73 6f 20 64 65 74 65 63 74 73 20 61 6e 64 20  lso detects and 
0570: 72 65 70 6f 72 74 73 20 76 65 72 73 69 6f 6e 20  reports version 
0580: 63 6c 61 73 68 65 73 2e 0a 54 79 70 69 63 61 6c  clashes..Typical
0590: 6c 79 2c 20 6f 6e 6c 79 20 74 68 65 20 5c 66 42  ly, only the \fB
05a0: 70 61 63 6b 61 67 65 20 72 65 71 75 69 72 65 5c  package require\
05b0: 66 52 20 61 6e 64 20 5c 66 42 70 61 63 6b 61 67  fR and \fBpackag
05c0: 65 20 70 72 6f 76 69 64 65 5c 66 52 0a 63 6f 6d  e provide\fR.com
05d0: 6d 61 6e 64 73 20 61 72 65 20 69 6e 76 6f 6b 65  mands are invoke
05e0: 64 20 69 6e 20 6e 6f 72 6d 61 6c 20 54 63 6c 20  d in normal Tcl 
05f0: 73 63 72 69 70 74 73 3b 20 20 74 68 65 20 6f 74  scripts;  the ot
0600: 68 65 72 20 63 6f 6d 6d 61 6e 64 73 20 61 72 65  her commands are
0610: 20 75 73 65 64 0a 70 72 69 6d 61 72 69 6c 79 20   used.primarily 
0620: 62 79 20 73 79 73 74 65 6d 20 73 63 72 69 70 74  by system script
0630: 73 20 74 68 61 74 20 6d 61 69 6e 74 61 69 6e 20  s that maintain 
0640: 74 68 65 20 70 61 63 6b 61 67 65 20 64 61 74 61  the package data
0650: 62 61 73 65 2e 0a 2e 50 50 0a 54 68 65 20 62 65  base...PP.The be
0660: 68 61 76 69 6f 72 20 6f 66 20 74 68 65 20 5c 66  havior of the \f
0670: 42 70 61 63 6b 61 67 65 5c 66 52 20 63 6f 6d 6d  Bpackage\fR comm
0680: 61 6e 64 20 69 73 20 64 65 74 65 72 6d 69 6e 65  and is determine
0690: 64 20 62 79 20 69 74 73 20 66 69 72 73 74 20 61  d by its first a
06a0: 72 67 75 6d 65 6e 74 2e 0a 54 68 65 20 66 6f 6c  rgument..The fol
06b0: 6c 6f 77 69 6e 67 20 66 6f 72 6d 73 20 61 72 65  lowing forms are
06c0: 20 70 65 72 6d 69 74 74 65 64 3a 0a 2e 5c 22 20   permitted:..\" 
06d0: 4d 45 54 48 4f 44 3a 20 66 69 6c 65 73 0a 2e 54  METHOD: files..T
06e0: 50 0a 5c 66 42 70 61 63 6b 61 67 65 20 66 69 6c  P.\fBpackage fil
06f0: 65 73 20 5c 66 49 70 61 63 6b 61 67 65 5c 66 52  es \fIpackage\fR
0700: 0a 2e 0a 4c 69 73 74 73 20 61 6c 6c 20 66 69 6c  ...Lists all fil
0710: 65 73 20 66 6f 72 6d 69 6e 67 20 70 61 72 74 20  es forming part 
0720: 6f 66 20 5c 66 49 70 61 63 6b 61 67 65 5c 66 52  of \fIpackage\fR
0730: 2e 20 41 75 74 6f 2d 6c 6f 61 64 65 64 20 66 69  . Auto-loaded fi
0740: 6c 65 73 20 61 72 65 20 6e 6f 74 0a 69 6e 63 6c  les are not.incl
0750: 75 64 65 64 20 69 6e 20 74 68 69 73 20 6c 69 73  uded in this lis
0760: 74 2c 20 6f 6e 6c 79 20 66 69 6c 65 73 20 77 68  t, only files wh
0770: 69 63 68 20 77 65 72 65 20 64 69 72 65 63 74 6c  ich were directl
0780: 79 20 73 6f 75 72 63 65 64 20 64 75 72 69 6e 67  y sourced during
0790: 20 70 61 63 6b 61 67 65 0a 69 6e 69 74 69 61 6c   package.initial
07a0: 69 7a 61 74 69 6f 6e 2e 20 54 68 65 20 6c 69 73  ization. The lis
07b0: 74 20 6f 72 64 65 72 20 63 6f 72 72 65 73 70 6f  t order correspo
07c0: 6e 64 73 20 77 69 74 68 20 74 68 65 20 6f 72 64  nds with the ord
07d0: 65 72 20 69 6e 20 77 68 69 63 68 20 74 68 65 0a  er in which the.
07e0: 66 69 6c 65 73 20 77 65 72 65 20 73 6f 75 72 63  files were sourc
07f0: 65 64 2e 0a 2e 5c 22 20 4d 45 54 48 4f 44 3a 20  ed...\" METHOD: 
0800: 66 6f 72 67 65 74 0a 2e 54 50 0a 5c 66 42 70 61  forget..TP.\fBpa
0810: 63 6b 61 67 65 20 66 6f 72 67 65 74 5c 66 52 20  ckage forget\fR 
0820: 3f 5c 66 49 70 61 63 6b 61 67 65 20 70 61 63 6b  ?\fIpackage pack
0830: 61 67 65 20 2e 2e 2e 5c 66 52 3f 0a 2e 0a 52 65  age ...\fR?...Re
0840: 6d 6f 76 65 73 20 61 6c 6c 20 69 6e 66 6f 72 6d  moves all inform
0850: 61 74 69 6f 6e 20 61 62 6f 75 74 20 65 61 63 68  ation about each
0860: 20 73 70 65 63 69 66 69 65 64 20 70 61 63 6b 61   specified packa
0870: 67 65 20 66 72 6f 6d 20 74 68 69 73 20 69 6e 74  ge from this int
0880: 65 72 70 72 65 74 65 72 2c 0a 69 6e 63 6c 75 64  erpreter,.includ
0890: 69 6e 67 20 69 6e 66 6f 72 6d 61 74 69 6f 6e 20  ing information 
08a0: 70 72 6f 76 69 64 65 64 20 62 79 20 62 6f 74 68  provided by both
08b0: 20 5c 66 42 70 61 63 6b 61 67 65 20 69 66 6e 65   \fBpackage ifne
08c0: 65 64 65 64 5c 66 52 20 61 6e 64 0a 5c 66 42 70  eded\fR and.\fBp
08d0: 61 63 6b 61 67 65 20 70 72 6f 76 69 64 65 5c 66  ackage provide\f
08e0: 52 2e 0a 2e 5c 22 20 4d 45 54 48 4f 44 3a 20 69  R...\" METHOD: i
08f0: 66 6e 65 65 64 65 64 0a 2e 54 50 0a 5c 66 42 70  fneeded..TP.\fBp
0900: 61 63 6b 61 67 65 20 69 66 6e 65 65 64 65 64 20  ackage ifneeded 
0910: 5c 66 49 70 61 63 6b 61 67 65 20 76 65 72 73 69  \fIpackage versi
0920: 6f 6e 5c 66 52 20 3f 5c 66 49 73 63 72 69 70 74  on\fR ?\fIscript
0930: 5c 66 52 3f 0a 2e 0a 54 68 69 73 20 63 6f 6d 6d  \fR?...This comm
0940: 61 6e 64 20 74 79 70 69 63 61 6c 6c 79 20 61 70  and typically ap
0950: 70 65 61 72 73 20 6f 6e 6c 79 20 69 6e 20 73 79  pears only in sy
0960: 73 74 65 6d 20 63 6f 6e 66 69 67 75 72 61 74 69  stem configurati
0970: 6f 6e 0a 73 63 72 69 70 74 73 20 74 6f 20 73 65  on.scripts to se
0980: 74 20 75 70 20 74 68 65 20 70 61 63 6b 61 67 65  t up the package
0990: 20 64 61 74 61 62 61 73 65 2e 0a 49 74 20 69 6e   database..It in
09a0: 64 69 63 61 74 65 73 20 74 68 61 74 20 61 20 70  dicates that a p
09b0: 61 72 74 69 63 75 6c 61 72 20 76 65 72 73 69 6f  articular versio
09c0: 6e 20 6f 66 0a 61 20 70 61 72 74 69 63 75 6c 61  n of.a particula
09d0: 72 20 70 61 63 6b 61 67 65 20 69 73 20 61 76 61  r package is ava
09e0: 69 6c 61 62 6c 65 20 69 66 20 6e 65 65 64 65 64  ilable if needed
09f0: 2c 20 61 6e 64 20 74 68 61 74 20 74 68 65 20 70  , and that the p
0a00: 61 63 6b 61 67 65 0a 63 61 6e 20 62 65 20 61 64  ackage.can be ad
0a10: 64 65 64 20 74 6f 20 74 68 65 20 69 6e 74 65 72  ded to the inter
0a20: 70 72 65 74 65 72 20 62 79 20 65 78 65 63 75 74  preter by execut
0a30: 69 6e 67 20 5c 66 49 73 63 72 69 70 74 5c 66 52  ing \fIscript\fR
0a40: 2e 0a 54 68 65 20 73 63 72 69 70 74 20 69 73 20  ..The script is 
0a50: 73 61 76 65 64 20 69 6e 20 61 20 64 61 74 61 62  saved in a datab
0a60: 61 73 65 20 66 6f 72 20 75 73 65 20 62 79 20 73  ase for use by s
0a70: 75 62 73 65 71 75 65 6e 74 0a 5c 66 42 70 61 63  ubsequent.\fBpac
0a80: 6b 61 67 65 20 72 65 71 75 69 72 65 5c 66 52 20  kage require\fR 
0a90: 63 6f 6d 6d 61 6e 64 73 3b 20 20 74 79 70 69 63  commands;  typic
0aa0: 61 6c 6c 79 2c 20 5c 66 49 73 63 72 69 70 74 5c  ally, \fIscript\
0ab0: 66 52 0a 73 65 74 73 20 75 70 20 61 75 74 6f 2d  fR.sets up auto-
0ac0: 6c 6f 61 64 69 6e 67 20 66 6f 72 20 74 68 65 20  loading for the 
0ad0: 63 6f 6d 6d 61 6e 64 73 20 69 6e 20 74 68 65 20  commands in the 
0ae0: 70 61 63 6b 61 67 65 20 28 6f 72 20 63 61 6c 6c  package (or call
0af0: 73 0a 5c 66 42 6c 6f 61 64 5c 66 52 20 61 6e 64  s.\fBload\fR and
0b00: 2f 6f 72 20 5c 66 42 73 6f 75 72 63 65 5c 66 52  /or \fBsource\fR
0b10: 20 64 69 72 65 63 74 6c 79 29 2c 20 74 68 65 6e   directly), then
0b20: 20 69 6e 76 6f 6b 65 73 0a 5c 66 42 70 61 63 6b   invokes.\fBpack
0b30: 61 67 65 20 70 72 6f 76 69 64 65 5c 66 52 20 74  age provide\fR t
0b40: 6f 20 69 6e 64 69 63 61 74 65 20 74 68 61 74 20  o indicate that 
0b50: 74 68 65 20 70 61 63 6b 61 67 65 20 69 73 20 70  the package is p
0b60: 72 65 73 65 6e 74 2e 0a 54 68 65 72 65 20 6d 61  resent..There ma
0b70: 79 20 62 65 20 69 6e 66 6f 72 6d 61 74 69 6f 6e  y be information
0b80: 20 69 6e 20 74 68 65 20 64 61 74 61 62 61 73 65   in the database
0b90: 20 66 6f 72 20 73 65 76 65 72 61 6c 20 64 69 66   for several dif
0ba0: 66 65 72 65 6e 74 0a 76 65 72 73 69 6f 6e 73 20  ferent.versions 
0bb0: 6f 66 20 61 20 73 69 6e 67 6c 65 20 70 61 63 6b  of a single pack
0bc0: 61 67 65 2e 0a 49 66 20 74 68 65 20 64 61 74 61  age..If the data
0bd0: 62 61 73 65 20 61 6c 72 65 61 64 79 20 63 6f 6e  base already con
0be0: 74 61 69 6e 73 20 69 6e 66 6f 72 6d 61 74 69 6f  tains informatio
0bf0: 6e 20 66 6f 72 20 5c 66 49 70 61 63 6b 61 67 65  n for \fIpackage
0c00: 5c 66 52 0a 61 6e 64 20 5c 66 49 76 65 72 73 69  \fR.and \fIversi
0c10: 6f 6e 5c 66 52 2c 20 74 68 65 20 6e 65 77 20 5c  on\fR, the new \
0c20: 66 49 73 63 72 69 70 74 5c 66 52 20 72 65 70 6c  fIscript\fR repl
0c30: 61 63 65 73 20 74 68 65 20 65 78 69 73 74 69 6e  aces the existin
0c40: 67 0a 6f 6e 65 2e 0a 49 66 20 74 68 65 20 5c 66  g.one..If the \f
0c50: 49 73 63 72 69 70 74 5c 66 52 20 61 72 67 75 6d  Iscript\fR argum
0c60: 65 6e 74 20 69 73 20 6f 6d 69 74 74 65 64 2c 20  ent is omitted, 
0c70: 74 68 65 20 63 75 72 72 65 6e 74 20 73 63 72 69  the current scri
0c80: 70 74 20 66 6f 72 0a 76 65 72 73 69 6f 6e 20 5c  pt for.version \
0c90: 66 49 76 65 72 73 69 6f 6e 5c 66 52 20 6f 66 20  fIversion\fR of 
0ca0: 70 61 63 6b 61 67 65 20 5c 66 49 70 61 63 6b 61  package \fIpacka
0cb0: 67 65 5c 66 52 20 69 73 20 72 65 74 75 72 6e 65  ge\fR is returne
0cc0: 64 2c 0a 6f 72 20 61 6e 20 65 6d 70 74 79 20 73  d,.or an empty s
0cd0: 74 72 69 6e 67 20 69 66 20 6e 6f 20 5c 66 42 70  tring if no \fBp
0ce0: 61 63 6b 61 67 65 20 69 66 6e 65 65 64 65 64 5c  ackage ifneeded\
0cf0: 66 52 20 63 6f 6d 6d 61 6e 64 20 68 61 73 0a 62  fR command has.b
0d00: 65 65 6e 20 69 6e 76 6f 6b 65 64 20 66 6f 72 20  een invoked for 
0d10: 74 68 69 73 20 5c 66 49 70 61 63 6b 61 67 65 5c  this \fIpackage\
0d20: 66 52 20 61 6e 64 20 5c 66 49 76 65 72 73 69 6f  fR and \fIversio
0d30: 6e 5c 66 52 2e 0a 2e 5c 22 20 4d 45 54 48 4f 44  n\fR...\" METHOD
0d40: 3a 20 6e 61 6d 65 73 0a 2e 54 50 0a 5c 66 42 70  : names..TP.\fBp
0d50: 61 63 6b 61 67 65 20 6e 61 6d 65 73 5c 66 52 0a  ackage names\fR.
0d60: 2e 0a 52 65 74 75 72 6e 73 20 61 20 6c 69 73 74  ..Returns a list
0d70: 20 6f 66 20 74 68 65 20 6e 61 6d 65 73 20 6f 66   of the names of
0d80: 20 61 6c 6c 20 70 61 63 6b 61 67 65 73 20 69 6e   all packages in
0d90: 20 74 68 65 0a 69 6e 74 65 72 70 72 65 74 65 72   the.interpreter
0da0: 20 66 6f 72 20 77 68 69 63 68 20 61 20 76 65 72   for which a ver
0db0: 73 69 6f 6e 20 68 61 73 20 62 65 65 6e 20 70 72  sion has been pr
0dc0: 6f 76 69 64 65 64 20 28 76 69 61 0a 5c 66 42 70  ovided (via.\fBp
0dd0: 61 63 6b 61 67 65 20 70 72 6f 76 69 64 65 5c 66  ackage provide\f
0de0: 52 29 20 6f 72 20 66 6f 72 20 77 68 69 63 68 20  R) or for which 
0df0: 61 20 5c 66 42 70 61 63 6b 61 67 65 20 69 66 6e  a \fBpackage ifn
0e00: 65 65 64 65 64 5c 66 52 0a 73 63 72 69 70 74 20  eeded\fR.script 
0e10: 69 73 20 61 76 61 69 6c 61 62 6c 65 2e 0a 54 68  is available..Th
0e20: 65 20 6f 72 64 65 72 20 6f 66 20 65 6c 65 6d 65  e order of eleme
0e30: 6e 74 73 20 69 6e 20 74 68 65 20 6c 69 73 74 20  nts in the list 
0e40: 69 73 20 61 72 62 69 74 72 61 72 79 2e 0a 2e 5c  is arbitrary...\
0e50: 22 20 4d 45 54 48 4f 44 3a 20 70 72 65 73 65 6e  " METHOD: presen
0e60: 74 0a 2e 54 50 0a 5c 66 42 70 61 63 6b 61 67 65  t..TP.\fBpackage
0e70: 20 70 72 65 73 65 6e 74 5c 66 52 20 3f 5c 66 42   present\fR ?\fB
0e80: 5c 2d 65 78 61 63 74 5c 66 52 3f 20 5c 66 49 70  \-exact\fR? \fIp
0e90: 61 63 6b 61 67 65 5c 66 52 20 3f 5c 66 49 72 65  ackage\fR ?\fIre
0ea0: 71 75 69 72 65 6d 65 6e 74 2e 2e 2e 5c 66 52 3f  quirement...\fR?
0eb0: 0a 2e 0a 54 68 69 73 20 63 6f 6d 6d 61 6e 64 20  ...This command 
0ec0: 69 73 20 65 71 75 69 76 61 6c 65 6e 74 20 74 6f  is equivalent to
0ed0: 20 5c 66 42 70 61 63 6b 61 67 65 20 72 65 71 75   \fBpackage requ
0ee0: 69 72 65 5c 66 52 20 65 78 63 65 70 74 20 74 68  ire\fR except th
0ef0: 61 74 20 69 74 0a 64 6f 65 73 20 6e 6f 74 20 74  at it.does not t
0f00: 72 79 20 61 6e 64 20 6c 6f 61 64 20 74 68 65 20  ry and load the 
0f10: 70 61 63 6b 61 67 65 20 69 66 20 69 74 20 69 73  package if it is
0f20: 20 6e 6f 74 20 61 6c 72 65 61 64 79 20 6c 6f 61   not already loa
0f30: 64 65 64 2e 0a 2e 5c 22 20 4d 45 54 48 4f 44 3a  ded...\" METHOD:
0f40: 20 70 72 6f 76 69 64 65 0a 2e 54 50 0a 5c 66 42   provide..TP.\fB
0f50: 70 61 63 6b 61 67 65 20 70 72 6f 76 69 64 65 20  package provide 
0f60: 5c 66 49 70 61 63 6b 61 67 65 20 5c 66 52 3f 5c  \fIpackage \fR?\
0f70: 66 49 76 65 72 73 69 6f 6e 5c 66 52 3f 0a 2e 0a  fIversion\fR?...
0f80: 54 68 69 73 20 63 6f 6d 6d 61 6e 64 20 69 73 20  This command is 
0f90: 69 6e 76 6f 6b 65 64 20 74 6f 20 69 6e 64 69 63  invoked to indic
0fa0: 61 74 65 20 74 68 61 74 20 76 65 72 73 69 6f 6e  ate that version
0fb0: 20 5c 66 49 76 65 72 73 69 6f 6e 5c 66 52 0a 6f   \fIversion\fR.o
0fc0: 66 20 70 61 63 6b 61 67 65 20 5c 66 49 70 61 63  f package \fIpac
0fd0: 6b 61 67 65 5c 66 52 20 69 73 20 6e 6f 77 20 70  kage\fR is now p
0fe0: 72 65 73 65 6e 74 20 69 6e 20 74 68 65 20 69 6e  resent in the in
0ff0: 74 65 72 70 72 65 74 65 72 2e 0a 49 74 20 69 73  terpreter..It is
1000: 20 74 79 70 69 63 61 6c 6c 79 20 69 6e 76 6f 6b   typically invok
1010: 65 64 20 6f 6e 63 65 20 61 73 20 70 61 72 74 20  ed once as part 
1020: 6f 66 20 61 6e 20 5c 66 42 69 66 6e 65 65 64 65  of an \fBifneede
1030: 64 5c 66 52 20 73 63 72 69 70 74 2c 0a 61 6e 64  d\fR script,.and
1040: 20 61 67 61 69 6e 20 62 79 20 74 68 65 20 70 61   again by the pa
1050: 63 6b 61 67 65 20 69 74 73 65 6c 66 20 77 68 65  ckage itself whe
1060: 6e 20 69 74 20 69 73 20 66 69 6e 61 6c 6c 79 20  n it is finally 
1070: 6c 6f 61 64 65 64 2e 0a 41 6e 20 65 72 72 6f 72  loaded..An error
1080: 20 6f 63 63 75 72 73 20 69 66 20 61 20 64 69 66   occurs if a dif
1090: 66 65 72 65 6e 74 20 76 65 72 73 69 6f 6e 20 6f  ferent version o
10a0: 66 20 5c 66 49 70 61 63 6b 61 67 65 5c 66 52 20  f \fIpackage\fR 
10b0: 68 61 73 20 62 65 65 6e 0a 70 72 6f 76 69 64 65  has been.provide
10c0: 64 20 62 79 20 61 20 70 72 65 76 69 6f 75 73 20  d by a previous 
10d0: 5c 66 42 70 61 63 6b 61 67 65 20 70 72 6f 76 69  \fBpackage provi
10e0: 64 65 5c 66 52 20 63 6f 6d 6d 61 6e 64 2e 0a 49  de\fR command..I
10f0: 66 20 74 68 65 20 5c 66 49 76 65 72 73 69 6f 6e  f the \fIversion
1100: 5c 66 52 20 61 72 67 75 6d 65 6e 74 20 69 73 20  \fR argument is 
1110: 6f 6d 69 74 74 65 64 2c 20 74 68 65 6e 20 74 68  omitted, then th
1120: 65 20 63 6f 6d 6d 61 6e 64 0a 72 65 74 75 72 6e  e command.return
1130: 73 20 74 68 65 20 76 65 72 73 69 6f 6e 20 6e 75  s the version nu
1140: 6d 62 65 72 20 74 68 61 74 20 69 73 20 63 75 72  mber that is cur
1150: 72 65 6e 74 6c 79 20 70 72 6f 76 69 64 65 64 2c  rently provided,
1160: 20 6f 72 20 61 6e 0a 65 6d 70 74 79 20 73 74 72   or an.empty str
1170: 69 6e 67 20 69 66 20 6e 6f 20 5c 66 42 70 61 63  ing if no \fBpac
1180: 6b 61 67 65 20 70 72 6f 76 69 64 65 5c 66 52 20  kage provide\fR 
1190: 63 6f 6d 6d 61 6e 64 20 68 61 73 20 62 65 65 6e  command has been
11a0: 0a 69 6e 76 6f 6b 65 64 20 66 6f 72 20 5c 66 49  .invoked for \fI
11b0: 70 61 63 6b 61 67 65 5c 66 52 20 69 6e 20 74 68  package\fR in th
11c0: 69 73 20 69 6e 74 65 72 70 72 65 74 65 72 2e 0a  is interpreter..
11d0: 2e 5c 22 20 4d 45 54 48 4f 44 3a 20 72 65 71 75  .\" METHOD: requ
11e0: 69 72 65 0a 2e 54 50 0a 5c 66 42 70 61 63 6b 61  ire..TP.\fBpacka
11f0: 67 65 20 72 65 71 75 69 72 65 20 5c 66 52 5c 66  ge require \fR\f
1200: 49 70 61 63 6b 61 67 65 20 5c 66 52 3f 5c 66 49  Ipackage \fR?\fI
1210: 72 65 71 75 69 72 65 6d 65 6e 74 2e 2e 2e 5c 66  requirement...\f
1220: 52 3f 0a 2e 0a 54 68 69 73 20 63 6f 6d 6d 61 6e  R?...This comman
1230: 64 20 69 73 20 74 79 70 69 63 61 6c 6c 79 20 69  d is typically i
1240: 6e 76 6f 6b 65 64 20 62 79 20 54 63 6c 20 63 6f  nvoked by Tcl co
1250: 64 65 20 74 68 61 74 20 77 69 73 68 65 73 20 74  de that wishes t
1260: 6f 20 75 73 65 0a 61 20 70 61 72 74 69 63 75 6c  o use.a particul
1270: 61 72 20 76 65 72 73 69 6f 6e 20 6f 66 20 61 20  ar version of a 
1280: 70 61 72 74 69 63 75 6c 61 72 20 70 61 63 6b 61  particular packa
1290: 67 65 2e 20 20 54 68 65 20 61 72 67 75 6d 65 6e  ge.  The argumen
12a0: 74 73 0a 69 6e 64 69 63 61 74 65 20 77 68 69 63  ts.indicate whic
12b0: 68 20 70 61 63 6b 61 67 65 20 69 73 20 77 61 6e  h package is wan
12c0: 74 65 64 2c 20 61 6e 64 20 74 68 65 20 63 6f 6d  ted, and the com
12d0: 6d 61 6e 64 20 65 6e 73 75 72 65 73 20 74 68 61  mand ensures tha
12e0: 74 0a 61 20 73 75 69 74 61 62 6c 65 20 76 65 72  t.a suitable ver
12f0: 73 69 6f 6e 20 6f 66 20 74 68 65 20 70 61 63 6b  sion of the pack
1300: 61 67 65 20 69 73 20 6c 6f 61 64 65 64 20 69 6e  age is loaded in
1310: 74 6f 20 74 68 65 20 69 6e 74 65 72 70 72 65 74  to the interpret
1320: 65 72 2e 0a 49 66 20 74 68 65 20 63 6f 6d 6d 61  er..If the comma
1330: 6e 64 20 73 75 63 63 65 65 64 73 2c 20 69 74 20  nd succeeds, it 
1340: 72 65 74 75 72 6e 73 20 74 68 65 20 76 65 72 73  returns the vers
1350: 69 6f 6e 20 6e 75 6d 62 65 72 20 74 68 61 74 20  ion number that 
1360: 69 73 0a 6c 6f 61 64 65 64 3b 20 20 6f 74 68 65  is.loaded;  othe
1370: 72 77 69 73 65 20 69 74 20 67 65 6e 65 72 61 74  rwise it generat
1380: 65 73 20 61 6e 20 65 72 72 6f 72 2e 0a 2e 52 53  es an error...RS
1390: 0a 2e 50 50 0a 41 20 73 75 69 74 61 62 6c 65 20  ..PP.A suitable 
13a0: 76 65 72 73 69 6f 6e 20 6f 66 20 74 68 65 20 70  version of the p
13b0: 61 63 6b 61 67 65 20 69 73 20 61 6e 79 20 76 65  ackage is any ve
13c0: 72 73 69 6f 6e 20 77 68 69 63 68 20 73 61 74 69  rsion which sati
13d0: 73 66 69 65 73 20 61 74 0a 6c 65 61 73 74 20 6f  sfies at.least o
13e0: 6e 65 20 6f 66 20 74 68 65 20 72 65 71 75 69 72  ne of the requir
13f0: 65 6d 65 6e 74 73 2c 20 70 65 72 20 74 68 65 20  ements, per the 
1400: 72 75 6c 65 73 20 6f 66 20 5c 66 42 70 61 63 6b  rules of \fBpack
1410: 61 67 65 0a 76 73 61 74 69 73 66 69 65 73 5c 66  age.vsatisfies\f
1420: 52 2e 20 49 66 20 6d 75 6c 74 69 70 6c 65 20 76  R. If multiple v
1430: 65 72 73 69 6f 6e 73 20 61 72 65 20 73 75 69 74  ersions are suit
1440: 61 62 6c 65 20 74 68 65 20 69 6d 70 6c 65 6d 65  able the impleme
1450: 6e 74 61 74 69 6f 6e 0a 77 69 74 68 20 74 68 65  ntation.with the
1460: 20 68 69 67 68 65 73 74 20 76 65 72 73 69 6f 6e   highest version
1470: 20 69 73 20 63 68 6f 73 65 6e 2e 20 54 68 69 73   is chosen. This
1480: 20 6c 61 73 74 20 70 61 72 74 20 69 73 20 61 64   last part is ad
1490: 64 69 74 69 6f 6e 61 6c 6c 79 0a 69 6e 66 6c 75  ditionally.influ
14a0: 65 6e 63 65 64 20 62 79 20 74 68 65 20 73 65 6c  enced by the sel
14b0: 65 63 74 69 6f 6e 20 6d 6f 64 65 20 73 65 74 20  ection mode set 
14c0: 77 69 74 68 20 5c 66 42 70 61 63 6b 61 67 65 20  with \fBpackage 
14d0: 70 72 65 66 65 72 5c 66 52 2e 0a 2e 50 50 0a 49  prefer\fR...PP.I
14e0: 6e 20 74 68 65 0a 2e 51 57 20 73 74 61 62 6c 65  n the..QW stable
14f0: 0a 73 65 6c 65 63 74 69 6f 6e 20 6d 6f 64 65 20  .selection mode 
1500: 74 68 65 20 63 6f 6d 6d 61 6e 64 20 77 69 6c 6c  the command will
1510: 20 73 65 6c 65 63 74 20 74 68 65 20 68 69 67 68   select the high
1520: 65 73 74 0a 73 74 61 62 6c 65 20 76 65 72 73 69  est.stable versi
1530: 6f 6e 20 73 61 74 69 73 66 79 69 6e 67 20 74 68  on satisfying th
1540: 65 20 72 65 71 75 69 72 65 6d 65 6e 74 73 2c 20  e requirements, 
1550: 69 66 20 61 6e 79 2e 20 49 66 20 6e 6f 20 73 74  if any. If no st
1560: 61 62 6c 65 0a 76 65 72 73 69 6f 6e 20 73 61 74  able.version sat
1570: 69 73 66 69 65 73 20 74 68 65 20 72 65 71 75 69  isfies the requi
1580: 72 65 6d 65 6e 74 73 2c 20 74 68 65 20 68 69 67  rements, the hig
1590: 68 65 73 74 20 75 6e 73 74 61 62 6c 65 20 76 65  hest unstable ve
15a0: 72 73 69 6f 6e 0a 73 61 74 69 73 66 79 69 6e 67  rsion.satisfying
15b0: 20 74 68 65 20 72 65 71 75 69 72 65 6d 65 6e 74   the requirement
15c0: 73 20 77 69 6c 6c 20 62 65 20 73 65 6c 65 63 74  s will be select
15d0: 65 64 2e 20 20 49 6e 20 74 68 65 0a 2e 51 57 20  ed.  In the..QW 
15e0: 6c 61 74 65 73 74 0a 73 65 6c 65 63 74 69 6f 6e  latest.selection
15f0: 20 6d 6f 64 65 20 74 68 65 20 63 6f 6d 6d 61 6e   mode the comman
1600: 64 20 77 69 6c 6c 20 61 63 63 65 70 74 20 74 68  d will accept th
1610: 65 20 68 69 67 68 65 73 74 20 76 65 72 73 69 6f  e highest versio
1620: 6e 20 73 61 74 69 73 66 79 69 6e 67 0a 61 6c 6c  n satisfying.all
1630: 20 74 68 65 20 72 65 71 75 69 72 65 6d 65 6e 74   the requirement
1640: 73 2c 20 72 65 67 61 72 64 6c 65 73 73 20 6f 66  s, regardless of
1650: 20 69 74 73 20 73 74 61 62 6c 65 6e 65 73 73 2e   its stableness.
1660: 0a 2e 50 50 0a 49 66 20 61 20 76 65 72 73 69 6f  ..PP.If a versio
1670: 6e 20 6f 66 20 5c 66 49 70 61 63 6b 61 67 65 5c  n of \fIpackage\
1680: 66 52 20 68 61 73 20 61 6c 72 65 61 64 79 20 62  fR has already b
1690: 65 65 6e 20 70 72 6f 76 69 64 65 64 20 28 62 79  een provided (by
16a0: 20 69 6e 76 6f 6b 69 6e 67 0a 74 68 65 20 5c 66   invoking.the \f
16b0: 42 70 61 63 6b 61 67 65 20 70 72 6f 76 69 64 65  Bpackage provide
16c0: 5c 66 52 20 63 6f 6d 6d 61 6e 64 29 2c 20 74 68  \fR command), th
16d0: 65 6e 20 69 74 73 20 76 65 72 73 69 6f 6e 20 6e  en its version n
16e0: 75 6d 62 65 72 20 6d 75 73 74 0a 73 61 74 69 73  umber must.satis
16f0: 66 79 20 74 68 65 20 5c 66 49 72 65 71 75 69 72  fy the \fIrequir
1700: 65 6d 65 6e 74 5c 66 52 73 20 61 6e 64 20 74 68  ement\fRs and th
1710: 65 20 63 6f 6d 6d 61 6e 64 20 72 65 74 75 72 6e  e command return
1720: 73 20 69 6d 6d 65 64 69 61 74 65 6c 79 2e 0a 4f  s immediately..O
1730: 74 68 65 72 77 69 73 65 2c 20 74 68 65 20 63 6f  therwise, the co
1740: 6d 6d 61 6e 64 20 73 65 61 72 63 68 65 73 20 74  mmand searches t
1750: 68 65 20 64 61 74 61 62 61 73 65 20 6f 66 20 69  he database of i
1760: 6e 66 6f 72 6d 61 74 69 6f 6e 20 70 72 6f 76 69  nformation provi
1770: 64 65 64 20 62 79 0a 70 72 65 76 69 6f 75 73 20  ded by.previous 
1780: 5c 66 42 70 61 63 6b 61 67 65 20 69 66 6e 65 65  \fBpackage ifnee
1790: 64 65 64 5c 66 52 20 63 6f 6d 6d 61 6e 64 73 20  ded\fR commands 
17a0: 74 6f 20 73 65 65 20 69 66 20 61 6e 20 61 63 63  to see if an acc
17b0: 65 70 74 61 62 6c 65 0a 76 65 72 73 69 6f 6e 20  eptable.version 
17c0: 6f 66 20 74 68 65 20 70 61 63 6b 61 67 65 20 69  of the package i
17d0: 73 20 61 76 61 69 6c 61 62 6c 65 2e 0a 49 66 20  s available..If 
17e0: 73 6f 2c 20 74 68 65 20 73 63 72 69 70 74 20 66  so, the script f
17f0: 6f 72 20 74 68 65 20 68 69 67 68 65 73 74 20 61  or the highest a
1800: 63 63 65 70 74 61 62 6c 65 20 76 65 72 73 69 6f  cceptable versio
1810: 6e 20 6e 75 6d 62 65 72 20 69 73 20 65 76 61 6c  n number is eval
1820: 75 61 74 65 64 0a 69 6e 20 74 68 65 20 67 6c 6f  uated.in the glo
1830: 62 61 6c 20 6e 61 6d 65 73 70 61 63 65 3b 0a 69  bal namespace;.i
1840: 74 20 6d 75 73 74 20 64 6f 20 77 68 61 74 65 76  t must do whatev
1850: 65 72 20 69 73 20 6e 65 63 65 73 73 61 72 79 20  er is necessary 
1860: 74 6f 20 6c 6f 61 64 20 74 68 65 20 70 61 63 6b  to load the pack
1870: 61 67 65 2c 0a 69 6e 63 6c 75 64 69 6e 67 20 63  age,.including c
1880: 61 6c 6c 69 6e 67 20 5c 66 42 70 61 63 6b 61 67  alling \fBpackag
1890: 65 20 70 72 6f 76 69 64 65 5c 66 52 20 66 6f 72  e provide\fR for
18a0: 20 74 68 65 20 70 61 63 6b 61 67 65 2e 0a 49 66   the package..If
18b0: 20 74 68 65 20 5c 66 42 70 61 63 6b 61 67 65 20   the \fBpackage 
18c0: 69 66 6e 65 65 64 65 64 5c 66 52 20 64 61 74 61  ifneeded\fR data
18d0: 62 61 73 65 20 64 6f 65 73 20 6e 6f 74 20 63 6f  base does not co
18e0: 6e 74 61 69 6e 20 61 6e 20 61 63 63 65 70 74 61  ntain an accepta
18f0: 62 6c 65 0a 76 65 72 73 69 6f 6e 20 6f 66 20 74  ble.version of t
1900: 68 65 20 70 61 63 6b 61 67 65 20 61 6e 64 20 61  he package and a
1910: 20 5c 66 42 70 61 63 6b 61 67 65 20 75 6e 6b 6e   \fBpackage unkn
1920: 6f 77 6e 5c 66 52 20 63 6f 6d 6d 61 6e 64 20 68  own\fR command h
1930: 61 73 20 62 65 65 6e 0a 73 70 65 63 69 66 69 65  as been.specifie
1940: 64 20 66 6f 72 20 74 68 65 20 69 6e 74 65 72 70  d for the interp
1950: 72 65 74 65 72 20 74 68 65 6e 20 74 68 61 74 20  reter then that 
1960: 63 6f 6d 6d 61 6e 64 20 69 73 20 65 76 61 6c 75  command is evalu
1970: 61 74 65 64 20 69 6e 20 74 68 65 0a 67 6c 6f 62  ated in the.glob
1980: 61 6c 20 6e 61 6d 65 73 70 61 63 65 3b 20 20 77  al namespace;  w
1990: 68 65 6e 0a 69 74 20 63 6f 6d 70 6c 65 74 65 73  hen.it completes
19a0: 2c 20 54 63 6c 20 63 68 65 63 6b 73 20 61 67 61  , Tcl checks aga
19b0: 69 6e 20 74 6f 20 73 65 65 20 69 66 20 74 68 65  in to see if the
19c0: 20 70 61 63 6b 61 67 65 20 69 73 20 6e 6f 77 20   package is now 
19d0: 70 72 6f 76 69 64 65 64 0a 6f 72 20 69 66 20 74  provided.or if t
19e0: 68 65 72 65 20 69 73 20 61 20 5c 66 42 70 61 63  here is a \fBpac
19f0: 6b 61 67 65 20 69 66 6e 65 65 64 65 64 5c 66 52  kage ifneeded\fR
1a00: 20 73 63 72 69 70 74 20 66 6f 72 20 69 74 2e 0a   script for it..
1a10: 49 66 20 61 6c 6c 20 6f 66 20 74 68 65 73 65 20  If all of these 
1a20: 73 74 65 70 73 20 66 61 69 6c 20 74 6f 20 70 72  steps fail to pr
1a30: 6f 76 69 64 65 20 61 6e 20 61 63 63 65 70 74 61  ovide an accepta
1a40: 62 6c 65 20 76 65 72 73 69 6f 6e 20 6f 66 20 74  ble version of t
1a50: 68 65 0a 70 61 63 6b 61 67 65 2c 20 74 68 65 6e  he.package, then
1a60: 20 74 68 65 20 63 6f 6d 6d 61 6e 64 20 72 65 74   the command ret
1a70: 75 72 6e 73 20 61 6e 20 65 72 72 6f 72 2e 0a 2e  urns an error...
1a80: 52 45 0a 2e 54 50 0a 5c 66 42 70 61 63 6b 61 67  RE..TP.\fBpackag
1a90: 65 20 72 65 71 75 69 72 65 20 5c 2d 65 78 61 63  e require \-exac
1aa0: 74 20 5c 66 49 70 61 63 6b 61 67 65 20 76 65 72  t \fIpackage ver
1ab0: 73 69 6f 6e 5c 66 52 0a 2e 0a 54 68 69 73 20 66  sion\fR...This f
1ac0: 6f 72 6d 20 6f 66 20 74 68 65 20 63 6f 6d 6d 61  orm of the comma
1ad0: 6e 64 20 69 73 20 75 73 65 64 20 77 68 65 6e 20  nd is used when 
1ae0: 6f 6e 6c 79 20 74 68 65 20 67 69 76 65 6e 20 5c  only the given \
1af0: 66 49 76 65 72 73 69 6f 6e 5c 66 52 0a 6f 66 20  fIversion\fR.of 
1b00: 5c 66 49 70 61 63 6b 61 67 65 5c 66 52 20 69 73  \fIpackage\fR is
1b10: 20 61 63 63 65 70 74 61 62 6c 65 20 74 6f 20 74   acceptable to t
1b20: 68 65 20 63 61 6c 6c 65 72 2e 20 20 54 68 69 73  he caller.  This
1b30: 20 63 6f 6d 6d 61 6e 64 20 69 73 0a 65 71 75 69   command is.equi
1b40: 76 61 6c 65 6e 74 20 74 6f 20 5c 66 42 70 61 63  valent to \fBpac
1b50: 6b 61 67 65 20 72 65 71 75 69 72 65 20 5c 66 49  kage require \fI
1b60: 70 61 63 6b 61 67 65 20 76 65 72 73 69 6f 6e 5c  package version\
1b70: 66 52 2d 5c 66 49 76 65 72 73 69 6f 6e 5c 66 52  fR-\fIversion\fR
1b80: 2e 0a 2e 5c 22 20 4d 45 54 48 4f 44 3a 20 75 6e  ...\" METHOD: un
1b90: 6b 6e 6f 77 6e 0a 2e 54 50 0a 5c 66 42 70 61 63  known..TP.\fBpac
1ba0: 6b 61 67 65 20 75 6e 6b 6e 6f 77 6e 20 5c 66 52  kage unknown \fR
1bb0: 3f 5c 66 49 63 6f 6d 6d 61 6e 64 5c 66 52 3f 0a  ?\fIcommand\fR?.
1bc0: 2e 0a 54 68 69 73 20 63 6f 6d 6d 61 6e 64 20 73  ..This command s
1bd0: 75 70 70 6c 69 65 73 20 61 0a 2e 51 57 20 22 6c  upplies a..QW "l
1be0: 61 73 74 20 72 65 73 6f 72 74 22 0a 63 6f 6d 6d  ast resort".comm
1bf0: 61 6e 64 20 74 6f 20 69 6e 76 6f 6b 65 20 64 75  and to invoke du
1c00: 72 69 6e 67 0a 5c 66 42 70 61 63 6b 61 67 65 20  ring.\fBpackage 
1c10: 72 65 71 75 69 72 65 5c 66 52 20 69 66 20 6e 6f  require\fR if no
1c20: 20 73 75 69 74 61 62 6c 65 20 76 65 72 73 69 6f   suitable versio
1c30: 6e 20 6f 66 20 61 20 70 61 63 6b 61 67 65 20 63  n of a package c
1c40: 61 6e 20 62 65 20 66 6f 75 6e 64 0a 69 6e 20 74  an be found.in t
1c50: 68 65 20 5c 66 42 70 61 63 6b 61 67 65 20 69 66  he \fBpackage if
1c60: 6e 65 65 64 65 64 5c 66 52 20 64 61 74 61 62 61  needed\fR databa
1c70: 73 65 2e 0a 49 66 20 74 68 65 20 5c 66 49 63 6f  se..If the \fIco
1c80: 6d 6d 61 6e 64 5c 66 52 20 61 72 67 75 6d 65 6e  mmand\fR argumen
1c90: 74 20 69 73 20 73 75 70 70 6c 69 65 64 2c 20 69  t is supplied, i
1ca0: 74 20 63 6f 6e 74 61 69 6e 73 20 74 68 65 20 66  t contains the f
1cb0: 69 72 73 74 20 70 61 72 74 0a 6f 66 20 61 20 63  irst part.of a c
1cc0: 6f 6d 6d 61 6e 64 3b 20 20 77 68 65 6e 20 74 68  ommand;  when th
1cd0: 65 20 63 6f 6d 6d 61 6e 64 20 69 73 20 69 6e 76  e command is inv
1ce0: 6f 6b 65 64 20 64 75 72 69 6e 67 20 61 20 5c 66  oked during a \f
1cf0: 42 70 61 63 6b 61 67 65 20 72 65 71 75 69 72 65  Bpackage require
1d00: 5c 66 52 0a 63 6f 6d 6d 61 6e 64 2c 20 54 63 6c  \fR.command, Tcl
1d10: 20 61 70 70 65 6e 64 73 20 6f 6e 65 20 6f 72 20   appends one or 
1d20: 6d 6f 72 65 20 61 64 64 69 74 69 6f 6e 61 6c 20  more additional 
1d30: 61 72 67 75 6d 65 6e 74 73 20 67 69 76 69 6e 67  arguments giving
1d40: 20 74 68 65 20 64 65 73 69 72 65 64 0a 70 61 63   the desired.pac
1d50: 6b 61 67 65 20 6e 61 6d 65 20 61 6e 64 20 72 65  kage name and re
1d60: 71 75 69 72 65 6d 65 6e 74 73 2e 0a 46 6f 72 20  quirements..For 
1d70: 65 78 61 6d 70 6c 65 2c 20 69 66 20 5c 66 49 63  example, if \fIc
1d80: 6f 6d 6d 61 6e 64 5c 66 52 20 69 73 20 5c 66 42  ommand\fR is \fB
1d90: 66 6f 6f 20 62 61 72 5c 66 52 20 61 6e 64 20 6c  foo bar\fR and l
1da0: 61 74 65 72 20 74 68 65 20 63 6f 6d 6d 61 6e 64  ater the command
1db0: 0a 5c 66 42 70 61 63 6b 61 67 65 20 72 65 71 75  .\fBpackage requ
1dc0: 69 72 65 20 74 65 73 74 20 32 2e 34 5c 66 52 20  ire test 2.4\fR 
1dd0: 69 73 20 69 6e 76 6f 6b 65 64 2c 20 74 68 65 6e  is invoked, then
1de0: 20 54 63 6c 20 77 69 6c 6c 20 65 78 65 63 75 74   Tcl will execut
1df0: 65 0a 74 68 65 20 63 6f 6d 6d 61 6e 64 20 5c 66  e.the command \f
1e00: 42 66 6f 6f 20 62 61 72 20 74 65 73 74 20 32 2e  Bfoo bar test 2.
1e10: 34 5c 66 52 20 74 6f 20 6c 6f 61 64 20 74 68 65  4\fR to load the
1e20: 20 70 61 63 6b 61 67 65 2e 0a 49 66 20 6e 6f 20   package..If no 
1e30: 72 65 71 75 69 72 65 6d 65 6e 74 73 20 61 72 65  requirements are
1e40: 20 73 75 70 70 6c 69 65 64 20 74 6f 20 74 68 65   supplied to the
1e50: 20 5c 66 42 70 61 63 6b 61 67 65 20 72 65 71 75   \fBpackage requ
1e60: 69 72 65 5c 66 52 20 63 6f 6d 6d 61 6e 64 2c 0a  ire\fR command,.
1e70: 74 68 65 6e 20 6f 6e 6c 79 20 74 68 65 20 6e 61  then only the na
1e80: 6d 65 20 77 69 6c 6c 20 62 65 20 61 64 64 65 64  me will be added
1e90: 20 74 6f 20 69 6e 76 6f 6b 65 64 20 63 6f 6d 6d   to invoked comm
1ea0: 61 6e 64 2e 0a 49 66 20 74 68 65 20 5c 66 42 70  and..If the \fBp
1eb0: 61 63 6b 61 67 65 20 75 6e 6b 6e 6f 77 6e 5c 66  ackage unknown\f
1ec0: 52 20 63 6f 6d 6d 61 6e 64 20 69 73 20 69 6e 76  R command is inv
1ed0: 6f 6b 65 64 20 77 69 74 68 6f 75 74 20 61 20 5c  oked without a \
1ee0: 66 49 63 6f 6d 6d 61 6e 64 5c 66 52 0a 61 72 67  fIcommand\fR.arg
1ef0: 75 6d 65 6e 74 2c 20 74 68 65 6e 20 74 68 65 20  ument, then the 
1f00: 63 75 72 72 65 6e 74 20 5c 66 42 70 61 63 6b 61  current \fBpacka
1f10: 67 65 20 75 6e 6b 6e 6f 77 6e 5c 66 52 20 73 63  ge unknown\fR sc
1f20: 72 69 70 74 20 69 73 20 72 65 74 75 72 6e 65 64  ript is returned
1f30: 2c 0a 6f 72 20 61 6e 20 65 6d 70 74 79 20 73 74  ,.or an empty st
1f40: 72 69 6e 67 20 69 66 20 74 68 65 72 65 20 69 73  ring if there is
1f50: 20 6e 6f 6e 65 2e 0a 49 66 20 5c 66 49 63 6f 6d   none..If \fIcom
1f60: 6d 61 6e 64 5c 66 52 20 69 73 20 73 70 65 63 69  mand\fR is speci
1f70: 66 69 65 64 20 61 73 20 61 6e 20 65 6d 70 74 79  fied as an empty
1f80: 20 73 74 72 69 6e 67 2c 20 74 68 65 6e 20 74 68   string, then th
1f90: 65 20 63 75 72 72 65 6e 74 0a 5c 66 42 70 61 63  e current.\fBpac
1fa0: 6b 61 67 65 20 75 6e 6b 6e 6f 77 6e 5c 66 52 20  kage unknown\fR 
1fb0: 73 63 72 69 70 74 20 69 73 20 72 65 6d 6f 76 65  script is remove
1fc0: 64 2c 20 69 66 20 74 68 65 72 65 20 69 73 20 6f  d, if there is o
1fd0: 6e 65 2e 0a 2e 5c 22 20 4d 45 54 48 4f 44 3a 20  ne...\" METHOD: 
1fe0: 76 63 6f 6d 70 61 72 65 0a 2e 54 50 0a 5c 66 42  vcompare..TP.\fB
1ff0: 70 61 63 6b 61 67 65 20 76 63 6f 6d 70 61 72 65  package vcompare
2000: 20 5c 66 49 76 65 72 73 69 6f 6e 31 20 76 65 72   \fIversion1 ver
2010: 73 69 6f 6e 32 5c 66 52 0a 2e 0a 43 6f 6d 70 61  sion2\fR...Compa
2020: 72 65 73 20 74 68 65 20 74 77 6f 20 76 65 72 73  res the two vers
2030: 69 6f 6e 20 6e 75 6d 62 65 72 73 20 67 69 76 65  ion numbers give
2040: 6e 20 62 79 20 5c 66 49 76 65 72 73 69 6f 6e 31  n by \fIversion1
2050: 5c 66 52 20 61 6e 64 20 5c 66 49 76 65 72 73 69  \fR and \fIversi
2060: 6f 6e 32 5c 66 52 2e 0a 52 65 74 75 72 6e 73 20  on2\fR..Returns 
2070: 2d 31 20 69 66 20 5c 66 49 76 65 72 73 69 6f 6e  -1 if \fIversion
2080: 31 5c 66 52 20 69 73 20 61 6e 20 65 61 72 6c 69  1\fR is an earli
2090: 65 72 20 76 65 72 73 69 6f 6e 20 74 68 61 6e 20  er version than 
20a0: 5c 66 49 76 65 72 73 69 6f 6e 32 5c 66 52 2c 0a  \fIversion2\fR,.
20b0: 30 20 69 66 20 74 68 65 79 20 61 72 65 20 65 71  0 if they are eq
20c0: 75 61 6c 2c 20 61 6e 64 20 31 20 69 66 20 5c 66  ual, and 1 if \f
20d0: 49 76 65 72 73 69 6f 6e 31 5c 66 52 20 69 73 20  Iversion1\fR is 
20e0: 6c 61 74 65 72 20 74 68 61 6e 20 5c 66 49 76 65  later than \fIve
20f0: 72 73 69 6f 6e 32 5c 66 52 2e 0a 2e 5c 22 20 4d  rsion2\fR...\" M
2100: 45 54 48 4f 44 3a 20 76 65 72 73 69 6f 6e 73 0a  ETHOD: versions.
2110: 2e 54 50 0a 5c 66 42 70 61 63 6b 61 67 65 20 76  .TP.\fBpackage v
2120: 65 72 73 69 6f 6e 73 20 5c 66 49 70 61 63 6b 61  ersions \fIpacka
2130: 67 65 5c 66 52 0a 2e 0a 52 65 74 75 72 6e 73 20  ge\fR...Returns 
2140: 61 20 6c 69 73 74 20 6f 66 20 61 6c 6c 20 74 68  a list of all th
2150: 65 20 76 65 72 73 69 6f 6e 20 6e 75 6d 62 65 72  e version number
2160: 73 20 6f 66 20 5c 66 49 70 61 63 6b 61 67 65 5c  s of \fIpackage\
2170: 66 52 0a 66 6f 72 20 77 68 69 63 68 20 69 6e 66  fR.for which inf
2180: 6f 72 6d 61 74 69 6f 6e 20 68 61 73 20 62 65 65  ormation has bee
2190: 6e 20 70 72 6f 76 69 64 65 64 20 62 79 20 5c 66  n provided by \f
21a0: 42 70 61 63 6b 61 67 65 20 69 66 6e 65 65 64 65  Bpackage ifneede
21b0: 64 5c 66 52 0a 63 6f 6d 6d 61 6e 64 73 2e 0a 2e  d\fR.commands...
21c0: 5c 22 20 4d 45 54 48 4f 44 3a 20 76 73 61 74 69  \" METHOD: vsati
21d0: 73 66 69 65 73 0a 2e 54 50 0a 5c 66 42 70 61 63  sfies..TP.\fBpac
21e0: 6b 61 67 65 20 76 73 61 74 69 73 66 69 65 73 20  kage vsatisfies 
21f0: 5c 66 49 76 65 72 73 69 6f 6e 20 72 65 71 75 69  \fIversion requi
2200: 72 65 6d 65 6e 74 2e 2e 2e 5c 66 52 0a 2e 0a 52  rement...\fR...R
2210: 65 74 75 72 6e 73 20 31 20 69 66 20 74 68 65 20  eturns 1 if the 
2220: 5c 66 49 76 65 72 73 69 6f 6e 5c 66 52 20 73 61  \fIversion\fR sa
2230: 74 69 73 66 69 65 73 20 61 74 20 6c 65 61 73 74  tisfies at least
2240: 20 6f 6e 65 20 6f 66 20 74 68 65 20 67 69 76 65   one of the give
2250: 6e 0a 72 65 71 75 69 72 65 6d 65 6e 74 73 2c 20  n.requirements, 
2260: 61 6e 64 20 30 20 6f 74 68 65 72 77 69 73 65 2e  and 0 otherwise.
2270: 20 45 61 63 68 20 5c 66 49 72 65 71 75 69 72 65   Each \fIrequire
2280: 6d 65 6e 74 5c 66 52 20 69 73 20 61 6c 6c 6f 77  ment\fR is allow
2290: 65 64 20 74 6f 0a 68 61 76 65 20 61 6e 79 20 6f  ed to.have any o
22a0: 66 20 74 68 65 20 66 6f 72 6d 73 3a 0a 2e 52 53  f the forms:..RS
22b0: 0a 2e 49 50 20 5c 66 49 6d 69 6e 5c 66 52 0a 54  ..IP \fImin\fR.T
22c0: 68 69 73 20 66 6f 72 6d 20 69 73 20 63 61 6c 6c  his form is call
22d0: 65 64 0a 2e 51 57 20 6d 69 6e 2d 62 6f 75 6e 64  ed..QW min-bound
22e0: 65 64 20 2e 0a 2e 49 50 20 5c 66 49 6d 69 6e 5c  ed ...IP \fImin\
22f0: 66 42 5c 2d 5c 66 52 0a 54 68 69 73 20 66 6f 72  fB\-\fR.This for
2300: 6d 20 69 73 20 63 61 6c 6c 65 64 0a 2e 51 57 20  m is called..QW 
2310: 6d 69 6e 2d 75 6e 62 6f 75 6e 64 20 2e 0a 2e 49  min-unbound ...I
2320: 50 20 5c 66 49 6d 69 6e 5c 66 42 5c 2d 5c 66 49  P \fImin\fB\-\fI
2330: 6d 61 78 5c 66 52 0a 54 68 69 73 20 66 6f 72 6d  max\fR.This form
2340: 20 69 73 20 63 61 6c 6c 65 64 0a 2e 51 57 20 62   is called..QW b
2350: 6f 75 6e 64 65 64 20 2e 0a 2e 50 50 0a 77 68 65  ounded ...PP.whe
2360: 72 65 0a 2e 51 57 20 5c 66 49 6d 69 6e 5c 66 52  re..QW \fImin\fR
2370: 0a 61 6e 64 0a 2e 51 57 20 5c 66 49 6d 61 78 5c  .and..QW \fImax\
2380: 66 52 0a 61 72 65 20 76 61 6c 69 64 20 76 65 72  fR.are valid ver
2390: 73 69 6f 6e 20 6e 75 6d 62 65 72 73 2e 20 54 68  sion numbers. Th
23a0: 65 20 6c 65 67 61 63 79 20 73 79 6e 74 61 78 20  e legacy syntax 
23b0: 69 73 0a 61 20 73 70 65 63 69 61 6c 20 63 61 73  is.a special cas
23c0: 65 20 6f 66 20 74 68 65 20 65 78 74 65 6e 64 65  e of the extende
23d0: 64 20 73 79 6e 74 61 78 2c 20 6b 65 65 70 69 6e  d syntax, keepin
23e0: 67 20 62 61 63 6b 77 61 72 64 0a 63 6f 6d 70 61  g backward.compa
23f0: 74 69 62 69 6c 69 74 79 2e 20 52 65 67 61 72 64  tibility. Regard
2400: 69 6e 67 20 73 61 74 69 73 66 61 63 74 69 6f 6e  ing satisfaction
2410: 20 74 68 65 20 72 75 6c 65 73 20 61 72 65 3a 0a   the rules are:.
2420: 2e 49 50 20 5b 31 5d 0a 54 68 65 20 5c 66 49 76  .IP [1].The \fIv
2430: 65 72 73 69 6f 6e 5c 66 52 20 68 61 73 20 74 6f  ersion\fR has to
2440: 20 70 61 73 73 20 61 74 20 6c 65 61 73 74 20 6f   pass at least o
2450: 6e 65 20 6f 66 20 74 68 65 20 6c 69 73 74 65 64  ne of the listed
2460: 0a 5c 66 49 72 65 71 75 69 72 65 6d 65 6e 74 5c  .\fIrequirement\
2470: 66 52 73 20 74 6f 20 62 65 20 73 61 74 69 73 66  fRs to be satisf
2480: 61 63 74 6f 72 79 2e 0a 2e 49 50 20 5b 32 5d 0a  actory...IP [2].
2490: 41 20 76 65 72 73 69 6f 6e 20 73 61 74 69 73 66  A version satisf
24a0: 69 65 73 20 61 0a 2e 51 57 20 62 6f 75 6e 64 65  ies a..QW bounde
24b0: 64 0a 72 65 71 75 69 72 65 6d 65 6e 74 20 77 68  d.requirement wh
24c0: 65 6e 0a 2e 52 53 0a 2e 49 50 20 5b 61 5d 0a 46  en..RS..IP [a].F
24d0: 6f 72 20 5c 66 49 6d 69 6e 5c 66 52 20 65 71 75  or \fImin\fR equ
24e0: 61 6c 20 74 6f 20 74 68 65 20 5c 66 49 6d 61 78  al to the \fImax
24f0: 5c 66 52 20 69 66 2c 20 61 6e 64 20 6f 6e 6c 79  \fR if, and only
2500: 20 69 66 20 74 68 65 20 5c 66 49 76 65 72 73 69   if the \fIversi
2510: 6f 6e 5c 66 52 0a 69 73 20 65 71 75 61 6c 20 74  on\fR.is equal t
2520: 6f 20 74 68 65 20 5c 66 49 6d 69 6e 5c 66 52 2e  o the \fImin\fR.
2530: 0a 2e 49 50 20 5b 62 5d 0a 4f 74 68 65 72 77 69  ..IP [b].Otherwi
2540: 73 65 20 69 66 2c 20 61 6e 64 20 6f 6e 6c 79 20  se if, and only 
2550: 69 66 20 74 68 65 20 5c 66 49 76 65 72 73 69 6f  if the \fIversio
2560: 6e 5c 66 52 20 69 73 20 67 72 65 61 74 65 72 20  n\fR is greater 
2570: 74 68 61 6e 20 6f 72 20 65 71 75 61 6c 0a 74 6f  than or equal.to
2580: 20 74 68 65 20 5c 66 49 6d 69 6e 5c 66 52 2c 20   the \fImin\fR, 
2590: 61 6e 64 20 6c 65 73 73 20 74 68 61 6e 20 74 68  and less than th
25a0: 65 20 5c 66 49 6d 61 78 5c 66 52 2c 20 77 68 65  e \fImax\fR, whe
25b0: 72 65 20 62 6f 74 68 20 5c 66 49 6d 69 6e 5c 66  re both \fImin\f
25c0: 52 0a 61 6e 64 20 5c 66 49 6d 61 78 5c 66 52 20  R.and \fImax\fR 
25d0: 68 61 76 65 20 62 65 65 6e 20 70 61 64 64 65 64  have been padded
25e0: 20 69 6e 74 65 72 6e 61 6c 6c 79 20 77 69 74 68   internally with
25f0: 0a 2e 51 57 20 61 30 20 2e 0a 4e 6f 74 65 20 74  ..QW a0 ..Note t
2600: 68 61 74 20 77 68 69 6c 65 20 74 68 65 20 63 6f  hat while the co
2610: 6d 70 61 72 69 73 6f 6e 20 74 6f 20 5c 66 49 6d  mparison to \fIm
2620: 69 6e 5c 66 52 20 69 73 20 69 6e 63 6c 75 73 69  in\fR is inclusi
2630: 76 65 2c 20 74 68 65 0a 63 6f 6d 70 61 72 69 73  ve, the.comparis
2640: 6f 6e 20 74 6f 20 5c 66 49 6d 61 78 5c 66 52 20  on to \fImax\fR 
2650: 69 73 20 65 78 63 6c 75 73 69 76 65 2e 0a 2e 52  is exclusive...R
2660: 45 0a 2e 49 50 20 5b 33 5d 0a 41 0a 2e 51 57 20  E..IP [3].A..QW 
2670: 6d 69 6e 2d 62 6f 75 6e 64 65 64 0a 72 65 71 75  min-bounded.requ
2680: 69 72 65 6d 65 6e 74 20 69 73 20 61 0a 2e 51 57  irement is a..QW
2690: 20 62 6f 75 6e 64 65 64 0a 72 65 71 75 69 72 65   bounded.require
26a0: 6d 65 6e 74 20 69 6e 20 64 69 73 67 75 69 73 65  ment in disguise
26b0: 2c 0a 77 69 74 68 20 74 68 65 20 5c 66 49 6d 61  ,.with the \fIma
26c0: 78 5c 66 52 20 70 61 72 74 20 69 6d 70 6c 69 63  x\fR part implic
26d0: 69 74 6c 79 20 73 70 65 63 69 66 69 65 64 20 61  itly specified a
26e0: 73 20 74 68 65 20 6e 65 78 74 20 68 69 67 68 65  s the next highe
26f0: 72 20 6d 61 6a 6f 72 0a 76 65 72 73 69 6f 6e 20  r major.version 
2700: 6e 75 6d 62 65 72 20 6f 66 20 74 68 65 20 5c 66  number of the \f
2710: 49 6d 69 6e 5c 66 52 20 70 61 72 74 2e 20 41 20  Imin\fR part. A 
2720: 76 65 72 73 69 6f 6e 20 73 61 74 69 73 66 69 65  version satisfie
2730: 73 20 69 74 20 70 65 72 20 74 68 65 0a 72 75 6c  s it per the.rul
2740: 65 73 20 61 62 6f 76 65 2e 0a 2e 49 50 20 5b 34  es above...IP [4
2750: 5d 0a 41 20 5c 66 49 76 65 72 73 69 6f 6e 5c 66  ].A \fIversion\f
2760: 52 20 73 61 74 69 73 66 69 65 73 20 61 0a 2e 51  R satisfies a..Q
2770: 57 20 6d 69 6e 2d 75 6e 62 6f 75 6e 64 0a 72 65  W min-unbound.re
2780: 71 75 69 72 65 6d 65 6e 74 20 69 66 2c 20 61 6e  quirement if, an
2790: 64 20 6f 6e 6c 79 20 69 66 20 69 74 20 69 73 20  d only if it is 
27a0: 67 72 65 61 74 65 72 20 74 68 61 6e 20 6f 72 20  greater than or 
27b0: 65 71 75 61 6c 20 74 6f 20 74 68 65 0a 5c 66 49  equal to the.\fI
27c0: 6d 69 6e 5c 66 52 2c 20 77 68 65 72 65 20 74 68  min\fR, where th
27d0: 65 20 5c 66 49 6d 69 6e 5c 66 52 20 68 61 73 20  e \fImin\fR has 
27e0: 62 65 65 6e 20 70 61 64 64 65 64 20 69 6e 74 65  been padded inte
27f0: 72 6e 61 6c 6c 79 20 77 69 74 68 0a 2e 51 57 20  rnally with..QW 
2800: 61 30 20 2e 0a 54 68 65 72 65 20 69 73 20 6e 6f  a0 ..There is no
2810: 20 63 6f 6e 73 74 72 61 69 6e 74 20 74 6f 20 61   constraint to a
2820: 20 6d 61 78 69 6d 75 6d 2e 0a 2e 52 45 0a 2e 5c   maximum...RE..\
2830: 22 20 4d 45 54 48 4f 44 3a 20 70 72 65 66 65 72  " METHOD: prefer
2840: 0a 2e 54 50 0a 5c 66 42 70 61 63 6b 61 67 65 20  ..TP.\fBpackage 
2850: 70 72 65 66 65 72 20 5c 66 52 3f 5c 66 42 6c 61  prefer \fR?\fBla
2860: 74 65 73 74 5c 66 52 7c 5c 66 42 73 74 61 62 6c  test\fR|\fBstabl
2870: 65 5c 66 52 3f 0a 2e 0a 57 69 74 68 20 6e 6f 20  e\fR?...With no 
2880: 61 72 67 75 6d 65 6e 74 73 2c 20 74 68 65 20 63  arguments, the c
2890: 6f 6d 6d 61 6e 64 73 20 72 65 74 75 72 6e 73 20  ommands returns 
28a0: 65 69 74 68 65 72 0a 2e 51 57 20 6c 61 74 65 73  either..QW lates
28b0: 74 0a 6f 72 0a 2e 51 57 20 73 74 61 62 6c 65 20  t.or..QW stable 
28c0: 2c 0a 77 68 69 63 68 65 76 65 72 20 64 65 73 63  ,.whichever desc
28d0: 72 69 62 65 73 20 74 68 65 20 63 75 72 72 65 6e  ribes the curren
28e0: 74 20 6d 6f 64 65 20 6f 66 20 73 65 6c 65 63 74  t mode of select
28f0: 69 6f 6e 20 6c 6f 67 69 63 20 75 73 65 64 20 62  ion logic used b
2900: 79 0a 5c 66 42 70 61 63 6b 61 67 65 20 72 65 71  y.\fBpackage req
2910: 75 69 72 65 5c 66 52 2e 0a 2e 52 53 0a 2e 50 50  uire\fR...RS..PP
2920: 0a 57 68 65 6e 20 70 61 73 73 65 64 20 74 68 65  .When passed the
2930: 20 61 72 67 75 6d 65 6e 74 0a 2e 51 57 20 6c 61   argument..QW la
2940: 74 65 73 74 20 2c 0a 69 74 20 73 65 74 73 20 74  test ,.it sets t
2950: 68 65 20 73 65 6c 65 63 74 69 6f 6e 20 6c 6f 67  he selection log
2960: 69 63 20 6d 6f 64 65 20 74 6f 0a 2e 51 57 20 6c  ic mode to..QW l
2970: 61 74 65 73 74 20 2e 0a 2e 50 50 0a 57 68 65 6e  atest ...PP.When
2980: 20 70 61 73 73 65 64 20 74 68 65 20 61 72 67 75   passed the argu
2990: 6d 65 6e 74 0a 2e 51 57 20 73 74 61 62 6c 65 20  ment..QW stable 
29a0: 2c 0a 69 66 20 74 68 65 20 6d 6f 64 65 20 69 73  ,.if the mode is
29b0: 20 61 6c 72 65 61 64 79 0a 2e 51 57 20 73 74 61   already..QW sta
29c0: 62 6c 65 20 2c 0a 74 68 61 74 20 76 61 6c 75 65  ble ,.that value
29d0: 20 69 73 20 6b 65 70 74 2e 20 20 49 66 20 74 68   is kept.  If th
29e0: 65 20 6d 6f 64 65 20 69 73 20 61 6c 72 65 61 64  e mode is alread
29f0: 79 0a 2e 51 57 20 6c 61 74 65 73 74 20 2c 0a 74  y..QW latest ,.t
2a00: 68 65 6e 20 74 68 65 20 61 74 74 65 6d 70 74 20  hen the attempt 
2a10: 74 6f 20 73 65 74 20 69 74 20 62 61 63 6b 20 74  to set it back t
2a20: 6f 0a 2e 51 57 20 73 74 61 62 6c 65 0a 69 73 20  o..QW stable.is 
2a30: 69 6e 65 66 66 65 63 74 69 76 65 20 61 6e 64 20  ineffective and 
2a40: 74 68 65 20 6d 6f 64 65 20 76 61 6c 75 65 20 72  the mode value r
2a50: 65 6d 61 69 6e 73 0a 2e 51 57 20 6c 61 74 65 73  emains..QW lates
2a60: 74 20 2e 0a 2e 50 50 0a 57 68 65 6e 20 70 61 73  t ...PP.When pas
2a70: 73 65 64 20 61 6e 79 20 6f 74 68 65 72 20 76 61  sed any other va
2a80: 6c 75 65 20 61 73 20 61 6e 20 61 72 67 75 6d 65  lue as an argume
2a90: 6e 74 2c 20 72 61 69 73 65 20 61 6e 20 69 6e 76  nt, raise an inv
2aa0: 61 6c 69 64 20 61 72 67 75 6d 65 6e 74 0a 65 72  alid argument.er
2ab0: 72 6f 72 2e 0a 2e 50 50 0a 57 68 65 6e 20 61 6e  ror...PP.When an
2ac0: 20 69 6e 74 65 72 70 72 65 74 65 72 20 69 73 20   interpreter is 
2ad0: 63 72 65 61 74 65 64 2c 20 69 74 73 20 69 6e 69  created, its ini
2ae0: 74 69 61 6c 20 73 65 6c 65 63 74 69 6f 6e 20 6d  tial selection m
2af0: 6f 64 65 20 76 61 6c 75 65 20 69 73 20 73 65 74  ode value is set
2b00: 20 74 6f 0a 2e 51 57 20 73 74 61 62 6c 65 0a 75   to..QW stable.u
2b10: 6e 6c 65 73 73 20 74 68 65 20 65 6e 76 69 72 6f  nless the enviro
2b20: 6e 6d 65 6e 74 20 76 61 72 69 61 62 6c 65 20 5c  nment variable \
2b30: 66 42 54 43 4c 5f 50 4b 47 5f 50 52 45 46 45 52  fBTCL_PKG_PREFER
2b40: 5f 4c 41 54 45 53 54 5c 66 52 20 69 73 20 73 65  _LATEST\fR is se
2b50: 74 0a 28 74 6f 20 61 6e 79 20 76 61 6c 75 65 29  t.(to any value)
2b60: 20 6f 72 20 74 68 65 20 54 63 6c 20 70 61 63 6b   or the Tcl pack
2b70: 61 67 65 20 69 74 73 65 6c 66 20 69 73 20 75 6e  age itself is un
2b80: 73 74 61 62 6c 65 2e 20 4f 74 68 65 72 77 69 73  stable. Otherwis
2b90: 65 0a 74 68 65 20 69 6e 69 74 69 61 6c 20 28 61  e.the initial (a
2ba0: 6e 64 20 70 65 72 6d 61 6e 65 6e 74 29 20 73 65  nd permanent) se
2bb0: 6c 65 63 74 69 6f 6e 20 6d 6f 64 65 20 76 61 6c  lection mode val
2bc0: 75 65 20 69 73 20 73 65 74 20 74 6f 0a 2e 51 57  ue is set to..QW
2bd0: 20 6c 61 74 65 73 74 20 2e 0a 2e 52 45 0a 2e 53   latest ...RE..S
2be0: 48 20 22 56 45 52 53 49 4f 4e 20 4e 55 4d 42 45  H "VERSION NUMBE
2bf0: 52 53 22 0a 2e 50 50 0a 56 65 72 73 69 6f 6e 20  RS"..PP.Version 
2c00: 6e 75 6d 62 65 72 73 20 63 6f 6e 73 69 73 74 20  numbers consist 
2c10: 6f 66 20 6f 6e 65 20 6f 72 20 6d 6f 72 65 20 64  of one or more d
2c20: 65 63 69 6d 61 6c 20 6e 75 6d 62 65 72 73 20 73  ecimal numbers s
2c30: 65 70 61 72 61 74 65 64 0a 62 79 20 64 6f 74 73  eparated.by dots
2c40: 2c 20 73 75 63 68 20 61 73 20 32 20 6f 72 20 31  , such as 2 or 1
2c50: 2e 31 36 32 20 6f 72 20 33 2e 31 2e 31 33 2e 31  .162 or 3.1.13.1
2c60: 2e 0a 54 68 65 20 66 69 72 73 74 20 6e 75 6d 62  ..The first numb
2c70: 65 72 20 69 73 20 63 61 6c 6c 65 64 20 74 68 65  er is called the
2c80: 20 6d 61 6a 6f 72 20 76 65 72 73 69 6f 6e 20 6e   major version n
2c90: 75 6d 62 65 72 2e 0a 4c 61 72 67 65 72 20 6e 75  umber..Larger nu
2ca0: 6d 62 65 72 73 20 63 6f 72 72 65 73 70 6f 6e 64  mbers correspond
2cb0: 20 74 6f 20 6c 61 74 65 72 20 76 65 72 73 69 6f   to later versio
2cc0: 6e 73 20 6f 66 20 61 20 70 61 63 6b 61 67 65 2c  ns of a package,
2cd0: 20 77 69 74 68 0a 6c 65 66 74 6d 6f 73 74 20 6e   with.leftmost n
2ce0: 75 6d 62 65 72 73 20 68 61 76 69 6e 67 20 67 72  umbers having gr
2cf0: 65 61 74 65 72 20 73 69 67 6e 69 66 69 63 61 6e  eater significan
2d00: 63 65 2e 0a 46 6f 72 20 65 78 61 6d 70 6c 65 2c  ce..For example,
2d10: 20 76 65 72 73 69 6f 6e 20 32 2e 31 20 69 73 20   version 2.1 is 
2d20: 6c 61 74 65 72 20 74 68 61 6e 20 31 2e 33 20 61  later than 1.3 a
2d30: 6e 64 20 76 65 72 73 69 6f 6e 0a 33 2e 34 2e 36  nd version.3.4.6
2d40: 20 69 73 20 6c 61 74 65 72 20 74 68 61 6e 20 33   is later than 3
2d50: 2e 33 2e 35 2e 0a 4d 69 73 73 69 6e 67 20 66 69  .3.5..Missing fi
2d60: 65 6c 64 73 20 61 72 65 20 65 71 75 69 76 61 6c  elds are equival
2d70: 65 6e 74 20 74 6f 20 7a 65 72 6f 65 73 3a 20 20  ent to zeroes:  
2d80: 76 65 72 73 69 6f 6e 20 31 2e 33 20 69 73 20 74  version 1.3 is t
2d90: 68 65 0a 73 61 6d 65 20 61 73 20 76 65 72 73 69  he.same as versi
2da0: 6f 6e 20 31 2e 33 2e 30 20 61 6e 64 20 31 2e 33  on 1.3.0 and 1.3
2db0: 2e 30 2e 30 2c 20 73 6f 20 69 74 20 69 73 20 65  .0.0, so it is e
2dc0: 61 72 6c 69 65 72 20 74 68 61 6e 20 31 2e 33 2e  arlier than 1.3.
2dd0: 31 20 6f 72 20 31 2e 33 2e 30 2e 32 2e 0a 49 6e  1 or 1.3.0.2..In
2de0: 20 61 64 64 69 74 69 6f 6e 2c 20 74 68 65 20 6c   addition, the l
2df0: 65 74 74 65 72 73 0a 2e 51 57 20 61 0a 28 61 6c  etters..QW a.(al
2e00: 70 68 61 29 20 61 6e 64 2f 6f 72 0a 2e 51 57 20  pha) and/or..QW 
2e10: 62 0a 28 62 65 74 61 29 20 6d 61 79 20 61 70 70  b.(beta) may app
2e20: 65 61 72 0a 65 78 61 63 74 6c 79 20 6f 6e 63 65  ear.exactly once
2e30: 20 74 6f 20 72 65 70 6c 61 63 65 20 61 20 64 6f   to replace a do
2e40: 74 20 66 6f 72 20 73 65 70 61 72 61 74 69 6f 6e  t for separation
2e50: 2e 20 54 68 65 73 65 20 6c 65 74 74 65 72 73 0a  . These letters.
2e60: 73 65 6d 61 6e 74 69 63 61 6c 6c 79 20 61 64 64  semantically add
2e70: 20 61 20 6e 65 67 61 74 69 76 65 20 73 70 65 63   a negative spec
2e80: 69 66 69 65 72 20 69 6e 74 6f 20 74 68 65 20 76  ifier into the v
2e90: 65 72 73 69 6f 6e 2c 20 77 68 65 72 65 0a 2e 51  ersion, where..Q
2ea0: 57 20 61 0a 69 73 20 5c 2d 32 2c 20 61 6e 64 0a  W a.is \-2, and.
2eb0: 2e 51 57 20 62 0a 69 73 20 5c 2d 31 2e 20 45 61  .QW b.is \-1. Ea
2ec0: 63 68 20 6d 61 79 20 62 65 20 73 70 65 63 69 66  ch may be specif
2ed0: 69 65 64 20 6f 6e 6c 79 20 6f 6e 63 65 2c 20 61  ied only once, a
2ee0: 6e 64 0a 2e 51 57 20 61 0a 6f 72 0a 2e 51 57 20  nd..QW a.or..QW 
2ef0: 62 0a 61 72 65 20 6d 75 74 75 61 6c 6c 79 20 65  b.are mutually e
2f00: 78 63 6c 75 73 69 76 65 20 69 6e 20 61 20 73 70  xclusive in a sp
2f10: 65 63 69 66 69 65 72 2e 20 54 68 75 73 20 31 2e  ecifier. Thus 1.
2f20: 33 61 31 20 62 65 63 6f 6d 65 73 20 28 73 65 6d  3a1 becomes (sem
2f30: 61 6e 74 69 63 61 6c 6c 79 29 0a 31 2e 33 2e 5c  antically).1.3.\
2f40: 2d 32 2e 31 2c 20 31 2e 33 62 31 20 69 73 20 31  -2.1, 1.3b1 is 1
2f50: 2e 33 2e 5c 2d 31 2e 31 2e 20 4e 65 67 61 74 69  .3.\-1.1. Negati
2f60: 76 65 20 6e 75 6d 62 65 72 73 20 61 72 65 20 6e  ve numbers are n
2f70: 6f 74 20 64 69 72 65 63 74 6c 79 20 61 6c 6c 6f  ot directly allo
2f80: 77 65 64 0a 69 6e 20 76 65 72 73 69 6f 6e 20 73  wed.in version s
2f90: 70 65 63 69 66 69 65 72 73 2e 0a 41 20 76 65 72  pecifiers..A ver
2fa0: 73 69 6f 6e 20 6e 75 6d 62 65 72 20 6e 6f 74 20  sion number not 
2fb0: 63 6f 6e 74 61 69 6e 69 6e 67 20 74 68 65 20 6c  containing the l
2fc0: 65 74 74 65 72 73 0a 2e 51 57 20 61 0a 6f 72 0a  etters..QW a.or.
2fd0: 2e 51 57 20 62 0a 61 73 20 73 70 65 63 69 66 69  .QW b.as specifi
2fe0: 65 64 0a 61 62 6f 76 65 20 69 73 20 63 61 6c 6c  ed.above is call
2ff0: 65 64 20 61 20 5c 66 42 73 74 61 62 6c 65 5c 66  ed a \fBstable\f
3000: 52 20 76 65 72 73 69 6f 6e 2c 20 77 68 65 72 65  R version, where
3010: 61 73 20 70 72 65 73 65 6e 63 65 20 6f 66 20 74  as presence of t
3020: 68 65 20 6c 65 74 74 65 72 73 0a 63 61 75 73 65  he letters.cause
3030: 73 20 74 68 65 20 76 65 72 73 69 6f 6e 20 74 6f  s the version to
3040: 20 62 65 20 63 61 6c 6c 65 64 20 69 73 20 5c 66   be called is \f
3050: 42 75 6e 73 74 61 62 6c 65 5c 66 52 2e 0a 41 20  Bunstable\fR..A 
3060: 6c 61 74 65 72 20 76 65 72 73 69 6f 6e 20 6e 75  later version nu
3070: 6d 62 65 72 20 69 73 20 61 73 73 75 6d 65 64 20  mber is assumed 
3080: 74 6f 20 62 65 20 75 70 77 61 72 64 73 20 63 6f  to be upwards co
3090: 6d 70 61 74 69 62 6c 65 20 77 69 74 68 0a 61 6e  mpatible with.an
30a0: 20 65 61 72 6c 69 65 72 20 76 65 72 73 69 6f 6e   earlier version
30b0: 20 6e 75 6d 62 65 72 20 61 73 20 6c 6f 6e 67 20   number as long 
30c0: 61 73 20 62 6f 74 68 20 76 65 72 73 69 6f 6e 73  as both versions
30d0: 20 68 61 76 65 20 74 68 65 20 73 61 6d 65 0a 6d   have the same.m
30e0: 61 6a 6f 72 20 76 65 72 73 69 6f 6e 20 6e 75 6d  ajor version num
30f0: 62 65 72 2e 0a 46 6f 72 20 65 78 61 6d 70 6c 65  ber..For example
3100: 2c 20 54 63 6c 20 73 63 72 69 70 74 73 20 77 72  , Tcl scripts wr
3110: 69 74 74 65 6e 20 66 6f 72 20 76 65 72 73 69 6f  itten for versio
3120: 6e 20 32 2e 33 20 6f 66 20 61 20 70 61 63 6b 61  n 2.3 of a packa
3130: 67 65 20 73 68 6f 75 6c 64 0a 77 6f 72 6b 20 75  ge should.work u
3140: 6e 63 68 61 6e 67 65 64 20 75 6e 64 65 72 20 76  nchanged under v
3150: 65 72 73 69 6f 6e 73 20 32 2e 33 2e 32 2c 20 32  ersions 2.3.2, 2
3160: 2e 34 2c 20 61 6e 64 20 32 2e 35 2e 31 2e 0a 43  .4, and 2.5.1..C
3170: 68 61 6e 67 65 73 20 69 6e 20 74 68 65 20 6d 61  hanges in the ma
3180: 6a 6f 72 20 76 65 72 73 69 6f 6e 20 6e 75 6d 62  jor version numb
3190: 65 72 20 73 69 67 6e 69 66 79 20 69 6e 63 6f 6d  er signify incom
31a0: 70 61 74 69 62 6c 65 20 63 68 61 6e 67 65 73 3a  patible changes:
31b0: 0a 69 66 20 63 6f 64 65 20 69 73 20 77 72 69 74  .if code is writ
31c0: 74 65 6e 20 74 6f 20 75 73 65 20 76 65 72 73 69  ten to use versi
31d0: 6f 6e 20 32 2e 31 20 6f 66 20 61 20 70 61 63 6b  on 2.1 of a pack
31e0: 61 67 65 2c 20 69 74 20 69 73 20 6e 6f 74 20 67  age, it is not g
31f0: 75 61 72 61 6e 74 65 65 64 0a 74 6f 20 77 6f 72  uaranteed.to wor
3200: 6b 20 75 6e 6d 6f 64 69 66 69 65 64 20 77 69 74  k unmodified wit
3210: 68 20 65 69 74 68 65 72 20 76 65 72 73 69 6f 6e  h either version
3220: 20 31 2e 37 2e 33 20 6f 72 20 76 65 72 73 69 6f   1.7.3 or versio
3230: 6e 20 33 2e 31 2e 0a 2e 53 48 20 22 50 41 43 4b  n 3.1...SH "PACK
3240: 41 47 45 20 49 4e 44 49 43 45 53 22 0a 2e 50 50  AGE INDICES"..PP
3250: 0a 54 68 65 20 72 65 63 6f 6d 6d 65 6e 64 65 64  .The recommended
3260: 20 77 61 79 20 74 6f 20 75 73 65 20 70 61 63 6b   way to use pack
3270: 61 67 65 73 20 69 6e 20 54 63 6c 20 69 73 20 74  ages in Tcl is t
3280: 6f 20 69 6e 76 6f 6b 65 20 5c 66 42 70 61 63 6b  o invoke \fBpack
3290: 61 67 65 20 72 65 71 75 69 72 65 5c 66 52 0a 61  age require\fR.a
32a0: 6e 64 20 5c 66 42 70 61 63 6b 61 67 65 20 70 72  nd \fBpackage pr
32b0: 6f 76 69 64 65 5c 66 52 20 63 6f 6d 6d 61 6e 64  ovide\fR command
32c0: 73 20 69 6e 20 73 63 72 69 70 74 73 2c 20 61 6e  s in scripts, an
32d0: 64 20 75 73 65 20 74 68 65 20 70 72 6f 63 65 64  d use the proced
32e0: 75 72 65 0a 5c 66 42 70 6b 67 5f 6d 6b 49 6e 64  ure.\fBpkg_mkInd
32f0: 65 78 5c 66 52 20 74 6f 20 63 72 65 61 74 65 20  ex\fR to create 
3300: 70 61 63 6b 61 67 65 20 69 6e 64 65 78 20 66 69  package index fi
3310: 6c 65 73 2e 0a 4f 6e 63 65 20 79 6f 75 20 68 61  les..Once you ha
3320: 76 65 20 64 6f 6e 65 20 74 68 69 73 2c 20 70 61  ve done this, pa
3330: 63 6b 61 67 65 73 20 77 69 6c 6c 20 62 65 20 6c  ckages will be l
3340: 6f 61 64 65 64 20 61 75 74 6f 6d 61 74 69 63 61  oaded automatica
3350: 6c 6c 79 0a 69 6e 20 72 65 73 70 6f 6e 73 65 20  lly.in response 
3360: 74 6f 20 5c 66 42 70 61 63 6b 61 67 65 20 72 65  to \fBpackage re
3370: 71 75 69 72 65 5c 66 52 20 63 6f 6d 6d 61 6e 64  quire\fR command
3380: 73 2e 0a 53 65 65 20 74 68 65 20 64 6f 63 75 6d  s..See the docum
3390: 65 6e 74 61 74 69 6f 6e 20 66 6f 72 20 5c 66 42  entation for \fB
33a0: 70 6b 67 5f 6d 6b 49 6e 64 65 78 5c 66 52 20 66  pkg_mkIndex\fR f
33b0: 6f 72 20 64 65 74 61 69 6c 73 2e 0a 2e 53 48 20  or details...SH 
33c0: 45 58 41 4d 50 4c 45 53 0a 2e 50 50 0a 54 6f 20  EXAMPLES..PP.To 
33d0: 73 74 61 74 65 20 74 68 61 74 20 61 20 54 63 6c  state that a Tcl
33e0: 20 73 63 72 69 70 74 20 72 65 71 75 69 72 65 73   script requires
33f0: 20 74 68 65 20 54 6b 20 61 6e 64 20 68 74 74 70   the Tk and http
3400: 20 70 61 63 6b 61 67 65 73 2c 20 70 75 74 20 74   packages, put t
3410: 68 69 73 0a 61 74 20 74 68 65 20 74 6f 70 20 6f  his.at the top o
3420: 66 20 74 68 65 20 73 63 72 69 70 74 3a 0a 2e 50  f the script:..P
3430: 50 0a 2e 43 53 0a 5c 66 42 70 61 63 6b 61 67 65  P..CS.\fBpackage
3440: 20 72 65 71 75 69 72 65 5c 66 52 20 54 6b 0a 5c   require\fR Tk.\
3450: 66 42 70 61 63 6b 61 67 65 20 72 65 71 75 69 72  fBpackage requir
3460: 65 5c 66 52 20 68 74 74 70 0a 2e 43 45 0a 2e 50  e\fR http..CE..P
3470: 50 0a 54 6f 20 74 65 73 74 20 74 6f 20 73 65 65  P.To test to see
3480: 20 69 66 20 74 68 65 20 53 6e 61 63 6b 20 70 61   if the Snack pa
3490: 63 6b 61 67 65 20 69 73 20 61 76 61 69 6c 61 62  ckage is availab
34a0: 6c 65 20 61 6e 64 20 6c 6f 61 64 20 69 66 20 69  le and load if i
34b0: 74 20 69 73 0a 28 6f 66 74 65 6e 20 75 73 65 66  t is.(often usef
34c0: 75 6c 20 66 6f 72 20 6f 70 74 69 6f 6e 61 6c 20  ul for optional 
34d0: 65 6e 68 61 6e 63 65 6d 65 6e 74 73 20 74 6f 20  enhancements to 
34e0: 70 72 6f 67 72 61 6d 73 20 77 68 65 72 65 20 74  programs where t
34f0: 68 65 20 6c 6f 73 73 20 6f 66 0a 74 68 65 20 66  he loss of.the f
3500: 75 6e 63 74 69 6f 6e 61 6c 69 74 79 20 69 73 20  unctionality is 
3510: 6e 6f 74 20 63 72 69 74 69 63 61 6c 29 20 64 6f  not critical) do
3520: 20 74 68 69 73 3a 0a 2e 50 50 0a 2e 43 53 0a 69   this:..PP..CS.i
3530: 66 20 7b 5b 63 61 74 63 68 20 7b 5c 66 42 70 61  f {[catch {\fBpa
3540: 63 6b 61 67 65 20 72 65 71 75 69 72 65 5c 66 52  ckage require\fR
3550: 20 53 6e 61 63 6b 7d 5d 7d 20 7b 0a 20 20 20 20   Snack}]} {.    
3560: 23 20 45 72 72 6f 72 20 74 68 72 6f 77 6e 20 2d  # Error thrown -
3570: 20 70 61 63 6b 61 67 65 20 6e 6f 74 20 66 6f 75   package not fou
3580: 6e 64 2e 0a 20 20 20 20 23 20 53 65 74 20 75 70  nd..    # Set up
3590: 20 61 20 64 75 6d 6d 79 20 69 6e 74 65 72 66 61   a dummy interfa
35a0: 63 65 20 74 6f 20 77 6f 72 6b 20 61 72 6f 75 6e  ce to work aroun
35b0: 64 20 74 68 65 20 61 62 73 65 6e 63 65 0a 7d 20  d the absence.} 
35c0: 65 6c 73 65 20 7b 0a 20 20 20 20 23 20 57 65 20  else {.    # We 
35d0: 68 61 76 65 20 74 68 65 20 70 61 63 6b 61 67 65  have the package
35e0: 2c 20 63 6f 6e 66 69 67 75 72 65 20 74 68 65 20  , configure the 
35f0: 61 70 70 20 74 6f 20 75 73 65 20 69 74 0a 7d 0a  app to use it.}.
3600: 2e 43 45 0a 2e 53 48 20 22 53 45 45 20 41 4c 53  .CE..SH "SEE ALS
3610: 4f 22 0a 6d 73 67 63 61 74 28 6e 29 2c 20 70 61  O".msgcat(n), pa
3620: 63 6b 61 67 65 6e 73 28 6e 29 2c 20 70 6b 67 4d  ckagens(n), pkgM
3630: 6b 49 6e 64 65 78 28 6e 29 0a 2e 53 48 20 4b 45  kIndex(n)..SH KE
3640: 59 57 4f 52 44 53 0a 70 61 63 6b 61 67 65 2c 20  YWORDS.package, 
3650: 76 65 72 73 69 6f 6e 0a 27 5c 22 20 4c 6f 63 61  version.'\" Loca
3660: 6c 20 56 61 72 69 61 62 6c 65 73 3a 0a 27 5c 22  l Variables:.'\"
3670: 20 6d 6f 64 65 3a 20 6e 72 6f 66 66 0a 27 5c 22   mode: nroff.'\"
3680: 20 45 6e 64 3a 0a                                 End:.