aboutsummaryrefslogtreecommitdiff
path: root/iclean.icl
diff options
context:
space:
mode:
Diffstat (limited to 'iclean.icl')
-rw-r--r--iclean.icl42
1 files changed, 21 insertions, 21 deletions
diff --git a/iclean.icl b/iclean.icl
index dce11f3..6b64d98 100644
--- a/iclean.icl
+++ b/iclean.icl
@@ -58,27 +58,27 @@ Start w
# w = checkedWorldFunc writeHistory "Couldn't write history" readline_history w
= w
where
- loop :: ![String] Bool !*World -> *World
- loop mem success w
- # prompt = color (if success None Red) "λ. "
- # (s,w) = readLine prompt False w
- | isNothing s = print "\n" w
- # s = fromJust s
- | s == "" = loop mem False (print "Use Ctrl-D to exit\n" w)
- # w = addHistory s w
- | s == ":quit" || s == ":q" = w
- | s == ":mem" = loop mem True (print (join "\n" mem) w)
- | matches ":import " s = loop (mem ++ [skip 1 s]) True w
- | matches ":def " s = loop (mem ++ [skip 5 s]) True w
+ loop :: ![String] Bool !*World -> *World
+ loop mem success w
+ # prompt = color (if success None Red) "λ. "
+ # (s,w) = readLine prompt False w
+ | isNothing s = print "\n" w
+ # s = fromJust s
+ | s == "" = loop mem False (print "Use Ctrl-D to exit\n" w)
+ # w = addHistory s w
+ | s == ":quit" || s == ":q" = w
+ | s == ":mem" = loop mem True (print (join "\n" mem) w)
+ | matches ":import " s = loop (mem ++ [skip 1 s]) True w
+ | matches ":def " s = loop (mem ++ [skip 5 s]) True w
| matches ":undef " s = loop (filter (undef (skip 7 s)) mem) True w
| s == ":help" = loop mem True (print help w)
- | matches ":" s = loop mem False (print ("Unknown command\n") w)
- # w = writemodule mem s w
- # (r,w) = compile temp_path temp_module w
- | r <> 0 = loop mem False w
- # (r,w) = run (temp_path +++ temp_module) w
- | r <> 0 = loop mem False w
- = loop mem True w
+ | matches ":" s = loop mem False (print ("Unknown command\n") w)
+ # w = writemodule mem s w
+ # (r,w) = compile temp_path temp_module w
+ | r <> 0 = loop mem False w
+ # (r,w) = run (temp_path +++ temp_module) w
+ | r <> 0 = loop mem False w
+ = loop mem True w
undef :: !String !String -> Bool
undef n h = not (matches (n +++ " ") h)
@@ -115,10 +115,10 @@ writemodule mem s w
// C functions
compile :: !String !String !*World -> *(!Int,!*World)
compile _ _ _ = code {
- ccall compile "SS:p:A"
+ ccall compile "SS:p:A"
}
run :: !String !*World -> (!Int, !*World)
run _ _ = code {
- ccall run "S:I:A"
+ ccall run "S:I:A"
}