Skip to content

Instantly share code, notes, and snippets.

@yyamasak
Created July 5, 2018 05:33
Show Gist options
  • Save yyamasak/f2eef6a574e6ff8fcdb943adcfbc5a2b to your computer and use it in GitHub Desktop.
Save yyamasak/f2eef6a574e6ff8fcdb943adcfbc5a2b to your computer and use it in GitHub Desktop.
Replace expr command by mpexpr (this works in tclsh but not in wish because of command history hooks)
package require Mpexpr
if {[info commands tclexpr] eq {}} {
rename expr tclexpr
proc expr {args} {uplevel mpexpr $args}
}
# set PI [expr {4*atan(1)}]; #=> 3.14159265358979324
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment