about summary refs log tree commit diff stats
path: root/mu
diff options
context:
space:
mode:
authorKartik K. Agaram <vc@akkartik.com>2015-02-23 00:45:35 -0800
committerKartik K. Agaram <vc@akkartik.com>2015-02-23 00:45:35 -0800
commiteacb2ce45868c952346ae2efea64dc759e50488f (patch)
tree07b8e0baab1722f888d365e3cba6f16eb1f4cf29 /mu
parent7cd72da17c979d3b5f8662f5e5d7e10796f1c8e4 (diff)
downloadmu-eacb2ce45868c952346ae2efea64dc759e50488f.tar.gz
828 - interactive repl
Still klunky since mu has no notion of a return value. I find myself
using $print all the time.
Diffstat (limited to 'mu')
-rwxr-xr-xmu24
1 files changed, 16 insertions, 8 deletions
diff --git a/mu b/mu
index e2731406..858438b8 100755
--- a/mu
+++ b/mu
@@ -1,19 +1,27 @@
 #!/bin/bash
-# Run this from the mu directory.
 #
-# Wrapper to allow selectively running parts of the mu codebase/tests.
+# To run a program:
+#   $ mu [mu files]
+# To run a file of tests (in arc):
+#   $ mu test [arc files]
+# To start an interactive session:
+#   $ mu repl
 #
-# Usage:
-#  mu [mu files]
-#  mu test [arc files]
-#
-# To actually mess with load levels, skip this script and call load.arc
-# directly.
+# To mess with load levels and selectively run parts of the codebase, skip
+# this script and call load.arc directly.
 
 if [[ $1 == "test" ]]
 then
   shift
   ./anarki/arc load.arc "$@"  # test currently assumed to be arc files rather than mu files
+elif [[ $1 == "repl" ]]
+then
+  if [ "$(type rlwrap)" ]
+  then
+    rlwrap -C mu ./anarki/arc mu.arc
+  else
+    ./anarki/arc mu.arc
+  fi
 else
   ./anarki/arc load.arc mu.arc -- "$@"  # mu files from args
 fi