interp(n)
β¨ interp(n) β Interpreter utilities β¨
okay bestie, so this is the interp manual page from Tcllib, and it's literally the page about making baby Tcl interpreters for when you want something to run in a highly restricted little sandbox π. No cap, it's niche but it slays.
πΈ SYNOPSIS πΈ
package require Tcl 8.5 9
package require interp ?0.1.3?
::interp::createEmpty ?path?
::interp::snitLink path methodlist
::interp::snitDictLink path methoddict
π DESCRIPTION π
So this package hands you a handful of commands for conveniently creating Tcl interpreters for highly restricted execution. Like, locked-down baby interpreters that only get to do exactly what you say. It's giving β¨controlled environmentβ¨, it's giving main character energy for sandboxing, and honestly? obsessed. π«Ά
π API π
π
::interp::createEmpty ?path?
This command creates an empty Tcl interpreter and returns its name. And bestie, "empty" here is not a vibe, it's a fact: the new interpreter has neither namespaces, nor any commands. Like, nothing. Zero. It is useful only for the creation of aliases.
If a path is specified, then it is taken as the name of the new interpreter.
π
::interp::snitLink path methodlist
This command assumes that it was called from within a method of a snit object, and that the command mymethod is available.
It extends the interpreter specified by path with aliases for all methods found in the methodlist, with the alias directing execution to the same-named method of the snit object invoking this command. And here's the plot twist π«’ β each element of methodlist is actually interpreted as a command prefix, with the first word of each prefix the name of the method to link to.
The result of the command is the empty string.
π
::interp::snitDictLink path methoddict
This command behaves like ::interp::snitLink, except that it takes a dictionary mapping from commands to methods as its input, and not a list of methods. Like for ::interp::snitLink, the method references are actually command prefixes. This command allows the creation of more complex command-method mappings than ::interp::snitLink does. So if you need the deluxe version of the mapping, this is her. π
The result of the command is the empty string.
π¦ BUGS, IDEAS, FEEDBACK π¦
This document, and the package it describes, will undoubtedly contain bugs and other problems. π
Please report such in the category interp of the Tcllib Trackers [http://core.tcl.tk/tcllib/reportlist]. Please also report any ideas for enhancements you may have for either package and/or documentation. We love ideas fr fr. π
When proposing code changes, please provide unified diffs, i.e the output of diff -u.
Note further that attachments are strongly preferred over inlined patches. Attachments can be made by going to the Edit form of the ticket immediately after its creation, and then using the left-most button in the secondary navigation bar. iykyk β¨
π₯ KEYWORDS π₯
alias, empty interpreter, interpreter, method, snit
π CATEGORY π
Programming tools
π COPYRIGHT π
Copyright (c) 2006 Andreas Kupries <andreas_kupries@users.sourceforge.net>
okay that's the whole page bestie, no notes π this was tcllib version 0.1.3 of the interp(n) page β mwah, go build something restricted and iconic πβ¨
π¦ where this page comes from
- fedora 43: tcllib 2.0-3.fc43 Β· TCL
- fedora 44: tcllib 2.0-4.fc44 Β· TCL
- nixos 26.05: tcllib 2.0
- nixpkgs unstable: tcllib 2.0
- Copyright (c) 2006 Andreas Kupries <andreas_kupries@users\&.sourceforge\&.net>
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms