diff --git a/tcl/difference-of-squares/difference-of-squares.tcl b/tcl/difference-of-squares/difference-of-squares.tcl index 5d26ffd1..71198eb5 100644 --- a/tcl/difference-of-squares/difference-of-squares.tcl +++ b/tcl/difference-of-squares/difference-of-squares.tcl @@ -1,9 +1,9 @@ proc squareOfSum {number} { - return [expr ($number * ($number + 1) / 2) ** 2] + return [expr {($number * ($number + 1) / 2) ** 2}] } proc sumOfSquares {number} { - return [expr ($number * ($number + 1) * (2 * $number + 1) / 6)] + return [expr {$number * ($number + 1) * (2 * $number + 1) / 6}] } proc differenceOfSquares {number} { diff --git a/tcl/difference-of-squares/run-tests-tcl.txt b/tcl/difference-of-squares/run-tests-tcl.txt index 8e757f19..f44c59bf 100644 --- a/tcl/difference-of-squares/run-tests-tcl.txt +++ b/tcl/difference-of-squares/run-tests-tcl.txt @@ -21,30 +21,25 @@ warn: parsing /home/vpayno/git_vpayno/exercism-workspace/tcl/difference-of-squar /home/vpayno/git_vpayno/exercism-workspace/tcl/difference-of-squares/testHelpers.tcl: errors file: 1 warn: parsing /home/vpayno/git_vpayno/exercism-workspace/tcl/difference-of-squares/difference-of-squares.tcl /home/vpayno/git_vpayno/exercism-workspace/tcl/difference-of-squares/difference-of-squares.tcl: parsing file /home/vpayno/git_vpayno/exercism-workspace/tcl/difference-of-squares/difference-of-squares.tcl -/home/vpayno/git_vpayno/exercism-workspace/tcl/difference-of-squares/difference-of-squares.tcl:2: possible unintended double substitution for expr use {} <<($number>> -/home/vpayno/git_vpayno/exercism-workspace/tcl/difference-of-squares/difference-of-squares.tcl:6: possible unintended double substitution for expr use {} <<($number>> -/home/vpayno/git_vpayno/exercism-workspace/tcl/difference-of-squares/difference-of-squares.tcl:13: expect variable 'square' as 'numeric' but is 'string {}' <<$square>> -/home/vpayno/git_vpayno/exercism-workspace/tcl/difference-of-squares/difference-of-squares.tcl:13: expect variable 'sum' as 'numeric' but is 'string {}' <<$sum>> -/home/vpayno/git_vpayno/exercism-workspace/tcl/difference-of-squares/difference-of-squares.tcl: errors file: 4 -errors all: 5 (13.89% lines) -lines: 36 in: 00:00:00 59 lines/sec: 610.17 +/home/vpayno/git_vpayno/exercism-workspace/tcl/difference-of-squares/difference-of-squares.tcl:2: error in expression missing operator <<**>> +/home/vpayno/git_vpayno/exercism-workspace/tcl/difference-of-squares/difference-of-squares.tcl: errors file: 1 +errors all: 2 (5.56% lines) +lines: 36 in: 00:00:00 60 lines/sec: 600.00 commands: 5 variables: 1 -signature params 9 unknown: 5 55.56% unknown variables 0.00% +signature params 9 unknown: 3 33.33% unknown variables 0.00% -real 0m0.127s -user 0m0.103s -sys 0m0.025s +real 0m0.112s +user 0m0.100s +sys 0m0.013s =============================================================================== Running: nagelfar -s _ ./difference-of-squares.tcl Checking file ./difference-of-squares.tcl -Line 2: W Expr without braces -Line 6: W Expr without braces -real 0m0.034s -user 0m0.026s -sys 0m0.007s +real 0m0.032s +user 0m0.027s +sys 0m0.004s =============================================================================== @@ -52,17 +47,17 @@ Running: RUN_ALL=1 tclsh ./difference-of-squares.test difference-of-squares.test: Total 9 Passed 9 Skipped 0 Failed 0 real 0m0.010s -user 0m0.008s -sys 0m0.002s +user 0m0.006s +sys 0m0.004s =============================================================================== Running: misspell . -real 0m0.019s -user 0m0.023s -sys 0m0.008s +real 0m0.020s +user 0m0.017s +sys 0m0.012s ===============================================================================