1interp(n) Interpreter utilities interp(n)
2
3
4
5______________________________________________________________________________
6
8 interp - Interp creation and aliasing
9
11 package require Tcl 8.3
12
13 package require interp ?0.1?
14
15 ::interp::createEmpty ?path?
16
17 ::interp::snitLink path methodlist
18
19 ::interp::snitDictLink path methoddict
20
21_________________________________________________________________
22
24 This package provides a number of commands for the convenient creation
25 of Tcl interpreters for highly restricted execution.
26
28 ::interp::createEmpty ?path?
29 This commands creates an empty Tcl interpreter and returns it
30 name. Empty means that the new interpreter has neither names‐
31 paces, nor any commands. It is useful only for the creation of
32 aliases.
33
34 If a path is specified then it is taken as the name of the new
35 interpreter.
36
37 ::interp::snitLink path methodlist
38 This command assumes that it was called from within a method of
39 a snit object, and that the command mymethod is available.
40
41 It extends the interpreter specified by path with aliases for
42 all methods found in the methodlist, with the alias directing
43 execution to the same-named method of the snit object invoking
44 this command. Each element of methodlist is actually inter‐
45 preted as a command prefix, with the first word of each prefix
46 the name of the method to link to.
47
48 The result of the command is the empty string.
49
50 ::interp::snitDictLink path methoddict
51 This command behaves like ::interp::snitLink, except that it
52 takes a dictionary mapping from commands to methods as its
53 input, and not a list of methods. Like for ::interp::snitLink
54 the method references are actually command prefixes. This com‐
55 mand allows the creation of more complex command-method mappings
56 than ::interp::snitLink.
57
58 The result of the command is the empty string.
59
61 alias, empty interpreter, interpreter, method, snit
62
64 Copyright (c) 2006 Andreas Kupries <andreas_kupries@users.sourceforge.net>
65
66
67
68
69interp 0.1 interp(n)