[add .jhci-hist file which stores history of commands typed at prompt, allow '--' as a comment in jhci
John Meacham <john@repetae.net>**20051214000008] hunk ./Interactive.hs 114
+        interactHistFile = Just ".jhci-hist",
+        interactComment = Just "--",
hunk ./Interactive.hs 149
-    do_expr act s = case parseStmt s of
+    do_expr act s = case parseStmt (s ++ "\n") of
hunk ./Util/Interact.hs 19
+import IO
hunk ./Util/Interact.hs 56
-basicParse :: String ->  Either (String,String) String
-basicParse s = f s' where
+basicParse :: Maybe String -> String ->  Either (String,String) String
+basicParse comm s = f s' where
hunk ./Util/Interact.hs 59
+    f xs | Just c <- comm, c `isPrefixOf` xs = Right ""
hunk ./Util/Interact.hs 79
-    interactEcho :: Bool                    -- ^ whether to echo commands
+    interactEcho :: Bool,                   -- ^ whether to echo commands
+    interactHistFile :: Maybe String,       -- ^ filename to store history of commands in
+    interactComment :: Maybe String         -- ^ comment initializer
hunk ./Util/Interact.hs 93
-    interactEcho = False
+    interactEcho = False,
+    interactHistFile = Nothing,
+    interactComment = Nothing
hunk ./Util/Interact.hs 123
-    case basicParse s of
+    case basicParse (interactComment act) s of
hunk ./Util/Interact.hs 163
+    hist <- case interactHistFile act of
+        Nothing -> return Nothing
+        Just fn -> do
+            ch <- catch (readFile fn >>= return . lines) (\_ -> return [])
+            mapM_ addHistory (map head $ group ch)
+            catch (openFile fn AppendMode >>= return . Just) (\_ -> return Nothing)
hunk ./Util/Interact.hs 173
+    case (hist,s) of
+        (Just h,(_:_)) -> catch (hPutStrLn h s) (const (return ()))
+        _ -> return ()