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.2?
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 name‐
31 spaces, 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 in‐
53 put, and not a list of methods. Like for ::interp::snitLink the
54 method references are actually command prefixes. This command
55 allows the creation of more complex command-method mappings than
56 ::interp::snitLink.
57
58 The result of the command is the empty string.
59
61 This document, and the package it describes, will undoubtedly contain
62 bugs and other problems. Please report such in the category interp of
63 the Tcllib Trackers [http://core.tcl.tk/tcllib/reportlist]. Please
64 also report any ideas for enhancements you may have for either package
65 and/or documentation.
66
67 When proposing code changes, please provide unified diffs, i.e the out‐
68 put of diff -u.
69
70 Note further that attachments are strongly preferred over inlined
71 patches. Attachments can be made by going to the Edit form of the
72 ticket immediately after its creation, and then using the left-most
73 button in the secondary navigation bar.
74
76 alias, empty interpreter, interpreter, method, snit
77
79 Programming tools
80
82 Copyright (c) 2006 Andreas Kupries <andreas_kupries@users.sourceforge.net>
83
84
85
86
87tcllib 0.1.2 interp(n)