From ae527499ae56fa869b23b8a0c1ffba12e01a6473 Mon Sep 17 00:00:00 2001 From: Chris Roberts Date: Thu, 30 Dec 2021 23:41:26 +0000 Subject: [PATCH] Remove unintentionally duplicated docs directory This actually has the potential to mightily confused people on case-insensitive filesystems where this file can overwrite its sibling in /Doc/. --- doc/tutorial/tohil_tclprocs.rst | 57 --------------------------------- 1 file changed, 57 deletions(-) delete mode 100644 doc/tutorial/tohil_tclprocs.rst diff --git a/doc/tutorial/tohil_tclprocs.rst b/doc/tutorial/tohil_tclprocs.rst deleted file mode 100644 index c88e3b7..0000000 --- a/doc/tutorial/tohil_tclprocs.rst +++ /dev/null @@ -1,57 +0,0 @@ - -************* -TclProcs -************* - -TclProcs brings the integration of Tcl functions into Python to a new -level of transparency, simplicity and versatility. Using TclProcs, -Most Tcl procs -now look and behave just like Python functions in most cases. - -Using Tcl's introspection capabilities, tohil traverses a hierarchy -of Tcl namespaces, identifying all the procs and C-commands in each one, -and for the procs, sussing out their arguments and default values, -and stashing it so that we can create entrypoints for all of the -Tcl procs in Python to invoke Tohil's trampoline function to call -the Tcl proc and return the result. - -It's awesome! - -While tohil can't determine arguments and defaults for Tcl commands -that are implemented in C, Tohil still makes entrypoints for them, -making them available from Python. Since many Tcl commands and -extensions are implemented in C and provide their functionality -with a hybrid of Tcl procs and C commands, wrapping the C functions -can be important for providing a way for Python to have access to -everything such a package provides. - -``tohil.import_tcl()`` returns a TclNamespace object corresponding to whatever -namespace you point it at ("::" is a good one), and all of the procs and -commands found in that namespace are defined as methods of the TclNamespace -object, and can be executed as such methods. It's very natural and pythonic. - -This means you can do stuff like: - -:: - - import tohil - k = tohil.import_namespace("::") - -...and then invoke top level procs like k.intersect3(). -And you can chain namespaces. - -:: - - >>> tohil.package_require("Tclx") - >>> k = tohil.import_tcl() - list1 = ["a", "b", "c", "d", "e", "f"] - list1 = ["d", "e", "f", "g", "h", "i"] - a_only, in_both, b_only = k.intersect3(list1, list2, to=tuple) - -And the subordinate namespaces are created in there too, and they're chainable too. - -:: - - k.clock('format', k.clock("seconds", to=seconds), "-format", "%D %T", "-gmt", 1) - -