Created
February 7, 2017 14:48
-
-
Save sshine/b2c8b47b8dcc01034f3f8f2e9f2b9079 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env tclsh | |
proc sum {k m n e} { | |
set r 0 | |
for {set k $m} {$k < $n} {incr k} { | |
set r [expr {$r + [uplevel 1 [list set k $k]; uplevel 1 $e]}] | |
} | |
return $r | |
} | |
set test [sum k 1 5 {expr {pow($k, 2)}}] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment