aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.gitignore2
-rw-r--r--iclean.icl10
2 files changed, 10 insertions, 2 deletions
diff --git a/.gitignore b/.gitignore
index 2fdc4e0..51a17d0 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,3 +1,5 @@
Clean System Files
*.o
iclean
+.iclean_history
+
diff --git a/iclean.icl b/iclean.icl
index 6f7ff04..9f51c05 100644
--- a/iclean.icl
+++ b/iclean.icl
@@ -42,9 +42,9 @@ Start :: *World -> *World
Start w
# w = setReadLineName "iClean" w
# w = usingHistory w
-# (_, w) = readHistory readline_history w
+# w = checkedWorldFunc readHistory "Couldn't read history file\n" readline_history w
# w = loop w
-# (i, w) = writeHistory readline_history w
+# w = checkedWorldFunc writeHistory "Couldn't write history file\n" readline_history w
= w
where
loop :: !*World -> *World
@@ -60,6 +60,12 @@ where
# w = run (temp_path +++ temp_module) w
= loop w
+checkedWorldFunc :: (a *World -> (Bool, *World)) !String !a !*World -> *World
+checkedWorldFunc f err s w
+# (ok, w) = f s w
+| not ok = print err w
+| otherwise = w
+
print :: String *World -> *World
print s w
# (io,w) = stdio w