Version 0 of tclsh as a powerful calculator

Updated 2004-07-11 03:55:09 by GPS

George Peter Staplin: July 10, 2004 - It sometimes amazes me how beautiful some aspects of Tcl are. I've been using proc unknown args {expr $args} for a while for doing calculations and tests when designing software. Today it occured to me that I could make life easier and avoid so many parentheses by extending that simple unknown procedure to this:

 proc unknown args {set ::that [expr $args]}

Now I can do:

 $ echo "proc unknown args {set ::that [expr \$args]}" > .tclshrc
 $ tclsh8.4 
 % 1000 * 256
 256000
 % $that / 8
 32000