4/21/2025 at 8:36:47 PM
As a search of the Tcl wiki shows, attempts to add named-argument capability to the Tcl proc command have been around for several years.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.
by jrapdx3
4/21/2025 at 11:33:21 PM
That looks very nice!by sigzero