Using
tcl extension would be quite reasonable to write a flexable code. How ever if you use
parse command set and TCL_OK as a return, be sure that type of your function is
int, otherwise tcl complains with a strange run time error, saying bad code. So, be sure about the correct return type.