I also had further fun with wrapping "proc" by implementing a "pyproc" which called out to Python while looking like a normal Tcl proc.
For sure there is a lack of proper "code as data" constructs in Tcl, like you would find in Lisp.
I think it would be very useful to turn ad_proc into a built-in command and incorporate it into TCL.
https://core.tcl-lang.org/tcllib/doc/trunk/embedded/md/tclli...
My own nxproc extension is more comprehensive. (See wiki [0].)
The extension enables named arguments, regular positional arguments, and 'rest' arguments, nxargs and nxunknown. Nxproc also provides (optional) type-checking of procedure arguments. (Types: string, number, bool and enumerated. Enums are lists of values restricting what the arg can contain.)
Nxproc supports TclOO with nxcontructor and nxmethod commands -- same feature set as "plain" nxproc. Also provides case-insensitive '-ci' variants, and runtime display of named-argument default/actual values and types.
Nxproc is a Tcl C extension. Bundle has Windows, Linux binaries. Compiles easily on other platforms.
andrewshadura•2h ago
BoingBoomTschak•2h ago
grewsome•17m ago