blob: 87978f25dfee8597cb7b40927af087be0155cd5f (
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
73
74
|
[comment {-*- tcl -*- doctools manpage}]
[manpage_begin interp n 0.1.2]
[keywords alias]
[keywords {empty interpreter}]
[keywords interpreter]
[keywords method]
[keywords snit]
[copyright {2006 Andreas Kupries <andreas_kupries@users.sourceforge.net>}]
[moddesc {Interpreter utilities}]
[titledesc {Interp creation and aliasing}]
[category {Programming tools}]
[require Tcl 8.3]
[require interp [opt 0.1.2]]
[description]
[para]
This package provides a number of commands for the convenient creation
of Tcl interpreters for highly restricted execution.
[section API]
[list_begin definitions]
[call [cmd ::interp::createEmpty] [opt [arg path]]]
This commands creates an empty Tcl interpreter and returns it
name. Empty means that the new interpreter has neither namespaces, nor
any commands. It is useful only for the creation of aliases.
[para]
If a [arg path] is specified then it is taken as the name of the new
interpreter.
[call [cmd ::interp::snitLink] [arg path] [arg methodlist]]
This command assumes that it was called from within a method of a snit
object, and that the command [cmd mymethod] is available.
[para]
It extends the interpreter specified by [arg path] with aliases for
all methods found in the [arg methodlist], with the alias directing
execution to the same-named method of the snit object invoking this
command.
Each element of [arg methodlist] is actually interpreted as a command
prefix, with the first word of each prefix the name of the method to
link to.
[para]
The result of the command is the empty string.
[call [cmd ::interp::snitDictLink] [arg path] [arg methoddict]]
This command behaves like [cmd ::interp::snitLink], except that it
takes a dictionary mapping from commands to methods as its input, and
not a list of methods.
Like for [cmd ::interp::snitLink] the method references are actually
command prefixes.
This command allows the creation of more complex command-method
mappings than [cmd ::interp::snitLink].
[para]
The result of the command is the empty string.
[list_end]
[vset CATEGORY interp]
[include ../doctools2base/include/feedback.inc]
[manpage_end]
|