Keyword Parameters in Tcl Procs: An Elegant Solution and a Metaprogramming Headache

2025-04-21

Frustrated by the lack of keyword parameters and the inaccessibility of built-in features in some programming languages, the author tackled the challenge of implementing keyword parameters in Tcl. The article presents a clever `proc*` command enabling keyword arguments in Tcl procs and details its implementation. However, due to Tcl's weak metaprogramming capabilities, the author resorted to regular expressions for string templating, resulting in complex and unwieldy code, highlighting Tcl's limitations in metaprogramming.

Development keyword parameters