Working with TCL and I’d like to implement something like the Strategy Pattern. I want to pass in the ‘strategy’ for printing output in a TCL function, so I can easily switch between printing to the screen and printing to a log file. What’s the best way to do this in TCL?
Share
TCL allows you to store the name of a procedure in a variable and then call the procedure using that variable; so
will call the proc A and print out Hello