[builtin_while
strick**20111005080747
 Ignore-this: 2e365504a71577aae44e6f5a4fdcb527
] hunk ./tcl.hs 14
-import qualified Numeric(readDec)
+import qualified Numeric(readDec,readFloat)
hunk ./tcl.hs 129
+      M.insert "while" (Builtin builtin_while) $
hunk ./tcl.hs 157
+builtin_while :: [String] -> Action
+builtin_while [cond, body] = do
+  -- TODO: parse cond only once.
+  r1 <- evalString cond
+  r1 `ifOk` \s1 ->
+    if truthOfTclString s1
+      then do
+        r2 <- evalString body
+        r2 `ifOk` \_s2 -> builtin_while [cond, body]
+      else do
+        ok
+
hunk ./tcl.hs 446
-atoi :: String -> Int
+atoi :: String -> Integer
hunk ./test.hs 52
+  goodScript "21" "proc tri {n} { if [< $n 1] { + 0 } else { + $n [tri [+ $n -1]] } }; tri 6"
+  goodScript "28" "proc tri {n} { set z 0; while {> $n 0} {set z [+ $z $n]; set n [+ $n -1]}; k $z}; tri 7"
+