Rick Engebretson wrote:
The original FPC-TCL unit can be broken into several separate units.
An appropriate breakdown might be;
tcl_commands unit (to build and register a tcl command), tcl_channels unit (including file and socket channel types), tcl_events (...), tcl_hashtables, tcl_interpreters, tcl_namespaces, tcl_objects, tcl_strings, tcl_variables.
Thus, getting started with only the tcl_command unit is simpler.
I have not yet figured out why the FPC-TCL unit author did not use the ParamStr, and ParamCount functions. argc and argv are the glue between TCL commands. I don't understand the approach taken in the FPC unit.
A TCL shell binding works, but differently than described above.
First, as the FPC:TCL demo does, creating a fully functional TCL interpreter shell from pascal is easy. Most of the above listed pascal interfaces don't add much functionality for the complexity added.
Second, the pascal functions ParamStr and ParamCount seem to work. So I don't know why the FPC:TCL unit doesn't use them.
Third, the functionality I'm seeking ( instrumentation multiplexer ), seems to be better provided in the Zshell, not the TCLshell. The TCLshell binding might not add much anyway.
Lastly, the Linux (Unix) "socketpair" function is obscure.
Endless learning process underway. Lots of terrific work to be re-discovered.