# break puts # don't do this in a Wish console because that uses puts internally, use tclsh % proc puts {args} {error broken} % puts -nonewline stdout "Does this work?" brokenThis leaves us with a thoroughly unusable puts. Next to remedy the situation.Start with creating a new interpreter:
interp create iputsNow we can use the newly created interpreter to have access to puts again:
% set test "\"" # will error out % interp eval iputs puts $test missing " # use list % interp eval iputs [list puts $test] "We now have access to the normal puts again. One thing to keep in mind is that interps do not share any resources by default. One of the resources one can think of is an open file.
% set f [open c:/temp/test.txt w] file9de458 % interp eval iputs [list puts $f test] can not find channel named "file9de458"This will be a problem when you have to use resources that are opened in the main interpreter. In the general case you can always open the resource in the slave interpreter (iputs) instead. If this is not possible you can share the resource between the interpreters.
% interp share {} $f iputs % interp eval iputs [list puts $f test]When sharing the resource between two interpreters, remember to close the resource in both interpreters.For an explanation of the commands, see interp
Jeez, it's unbelievable the lengths some people will go to just to avoid learning how to use namespaces.
MJ - Of course the original embedder shouldn't have overridden the command in the first place (namespaces indeed) unfortunately in an embedded or extension setting you might not be able to influence this. The whole exercise above is intended to retrieve access to the original core commands in that case.