summaryrefslogtreecommitdiff
path: root/itcl/itcl/doc/find.n
blob: 5dfbedacb0e88c9c1fa41ca650d54a714769f1db (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
'\"
'\" Copyright (c) 1993-1998  Lucent Technologies, Inc.
'\"
'\" See the file "license.terms" for information on usage and redistribution
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
'\"
'\" RCS: $Id$
'\"
.so man.macros
.TH find n 3.0 itcl "[incr\ Tcl]"
.BS
'\" Note:  do not modify the .SH NAME line immediately below!
.SH NAME
find \- search for classes and objects
.SH SYNOPSIS
\fBfind \fIoption\fR ?\fIarg arg ...\fR?
.BE

.SH DESCRIPTION
.PP
The \fBfind\fR command is used to find classes and objects
that are available in the current interpreter.  Classes and objects
are reported first in the active namespace, then in all other
namespaces in the interpreter.
.PP
The \fIoption\fR argument determines what action is carried out
by the command.  The legal \fIoptions\fR (which may be abbreviated)
are:
.TP
\fBfind classes ?\fIpattern\fR?
Returns a list of [incr Tcl] classes.  Classes in the current
namespace are listed first, followed by classes in all other
namespaces in the interpreter.  If the optional \fIpattern\fR
is specified, then the reported names are compared using the rules
of the "\fBstring match\fR" command, and only matching names are
reported.
.sp
If a class resides in the current namespace context, this command
reports its simple name--without any qualifiers.  However, if the
\fIpattern\fR contains \fB::\fR qualifiers, or if the class resides
in another context, this command reports its fully-qualified name.
Therefore, you can use the following command to obtain a list where
all names are fully-qualified:
.CS
find classes ::*
.CE
.TP
\fBfind objects ?\fIpattern\fR? ?\fB-class \fIclassName\fR? ?\fB-isa \fIclassName\fR?
Returns a list of [incr Tcl] objects.  Objects in the current
namespace are listed first, followed by objects in all other
namespaces in the interpreter.  If the optional \fIpattern\fR is
specified, then the reported names are compared using the rules
of the "\fBstring match\fR" command, and only matching names are
reported.
If the optional "\fB-class\fR" parameter is specified, this list is
restricted to objects whose most-specific class is \fIclassName\fR.
If the optional "\fB-isa\fR" parameter is specified, this list is
further restricted to objects having the given \fIclassName\fR
anywhere in their heritage.
.sp
If an object resides in the current namespace context, this command
reports its simple name--without any qualifiers.  However, if the
\fIpattern\fR contains \fB::\fR qualifiers, or if the object resides
in another context, this command reports its fully-qualified name.
Therefore, you can use the following command to obtain a list where
all names are fully-qualified:
.CS
find objects ::*
.CE

.SH KEYWORDS
class, object, search, import