1[comment {-*- tcl -*- doctools manpage}] 2[manpage_begin interp n 0.1.1] 3[copyright {2006 Andreas Kupries <andreas_kupries@users.sourceforge.net>}] 4[moddesc {Interpreter utilities}] 5[titledesc {Interp creation and aliasing}] 6[category {Programming tools}] 7[require Tcl 8.3] 8[require interp [opt 0.1.1]] 9[description] 10[para] 11 12This package provides a number of commands for the convenient creation 13of Tcl interpreters for highly restricted execution. 14 15 16[section API] 17[list_begin definitions] 18 19[call [cmd ::interp::createEmpty] [opt [arg path]]] 20 21This commands creates an empty Tcl interpreter and returns it 22name. Empty means that the new interpreter has neither namespaces, nor 23any commands. It is useful only for the creation of aliases. 24 25[para] 26 27If a [arg path] is specified then it is taken as the name of the new 28interpreter. 29 30 31[call [cmd ::interp::snitLink] [arg path] [arg methodlist]] 32 33This command assumes that it was called from within a method of a snit 34object, and that the command [cmd mymethod] is available. 35 36[para] 37 38It extends the interpreter specified by [arg path] with aliases for 39all methods found in the [arg methodlist], with the alias directing 40execution to the same-named method of the snit object invoking this 41command. 42 43Each element of [arg methodlist] is actually interpreted as a command 44prefix, with the first word of each prefix the name of the method to 45link to. 46 47[para] 48 49The result of the command is the empty string. 50 51 52[call [cmd ::interp::snitDictLink] [arg path] [arg methoddict]] 53 54This command behaves like [cmd ::interp::snitLink], except that it 55takes a dictionary mapping from commands to methods as its input, and 56not a list of methods. 57 58Like for [cmd ::interp::snitLink] the method references are actually 59command prefixes. 60 61This command allows the creation of more complex command-method 62mappings than [cmd ::interp::snitLink]. 63 64[para] 65 66The result of the command is the empty string. 67 68[list_end] 69 70[section {BUGS, IDEAS, FEEDBACK}] 71 72This document, and the package it describes, will undoubtedly contain 73bugs and other problems. 74 75Please report such in the category [emph interp] of the 76[uri {http://sourceforge.net/tracker/?group_id=12883} {Tcllib SF Trackers}]. 77 78Please also report any ideas for enhancements you may have for either 79package and/or documentation. 80 81 82[keywords interpreter {empty interpreter}] 83[keywords snit method alias] 84[manpage_end] 85