File: stack.man

package info (click to toggle)
tcllib 1.8-1
  • links: PTS
  • area: main
  • in suites: etch, etch-m68k
  • size: 13,628 kB
  • ctags: 4,897
  • sloc: tcl: 88,012; sh: 7,856; ansic: 4,174; xml: 1,765; yacc: 753; perl: 84; f90: 84; makefile: 60; python: 33; ruby: 13; php: 11
file content (68 lines) | stat: -rw-r--r-- 2,058 bytes parent folder | download
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
[manpage_begin struct::stack n 1.3.1]
[moddesc   {Tcl Data Structures}]
[titledesc {Create and manipulate stack objects}]
[require Tcl 8.2]
[require struct::stack [opt 1.3.1]]
[description]

The [cmd ::struct::stack] command creates a new stack object with an
associated global Tcl command whose name is [emph stackName].  This
command may be used to invoke various operations on the stack.  It has
the following general form:

[list_begin definitions]

[call [arg stackName] [cmd option] [opt [arg "arg arg ..."]]]

[arg Option] and the [arg arg]s determine the exact behavior of the
command.  The following commands are possible for stack objects:


[call [arg stackName] [cmd clear]]

Remove all items from the stack.


[call [arg stackName] [cmd destroy]]

Destroy the stack, including its storage space and associated command.


[call [arg stackName] [cmd peek] [opt "[arg count]"]]

Return the top [arg count] items of the stack, without removing them from
the stack.  If [arg count] is not specified, it defaults to 1.  If
[arg count] is 1, the result is a simple string; otherwise, it is a
list.  If specified, [arg count] must be greater than or equal to 1.

If there are not enoughs items on the stack to fulfull the request,
this command will throw an error.


[call [arg stackName] [cmd pop] [opt "[arg count]"]]

Return the top [arg count] items of the stack, and remove them
from the stack.  If [arg count] is not specified, it defaults to 1.
If [arg count] is 1, the result is a simple string; otherwise, it is a
list.  If specified, [arg count] must be greater than or equal to 1.

If there are not enoughs items on the stack to fulfull the request,
this command will throw an error.


[call [arg stackName] [cmd push] [arg item] [opt "[arg "item ..."]"]]

Push the [arg item] or items specified onto the stack.  If more than
one [arg item] is given, they will be pushed in the order they are
listed.


[call [arg stackName] [cmd size]]

Return the number of items on the stack.


[list_end]

[keywords queue matrix tree graph]
[manpage_end]