summaryrefslogtreecommitdiff
path: root/com/simatime/repl.scm
diff options
context:
space:
mode:
Diffstat (limited to 'com/simatime/repl.scm')
-rw-r--r--com/simatime/repl.scm34
1 files changed, 34 insertions, 0 deletions
diff --git a/com/simatime/repl.scm b/com/simatime/repl.scm
new file mode 100644
index 0000000..3d2f6d9
--- /dev/null
+++ b/com/simatime/repl.scm
@@ -0,0 +1,34 @@
+(define-module (com simatime repl)
+ #:use-module ((ice-9 ftw) #:prefix ftw:)
+ #:export (pr prn pwd ls cd))
+
+
+;;
+;; shell-like stuff
+;;
+(use-modules ((ice-9 ftw) #:prefix ftw:))
+
+(define (pwd)
+ (regexp-substitute/global
+ #f "/home/ben" (getcwd) 'pre "~" 'post))
+
+(define (ls)
+ (ftw:scandir (getcwd)))
+
+(define (cd path)
+ (chdir path)
+ (ls))
+
+
+;;
+;; repl customization
+;;
+
+;; (use-modules (system repl common))
+;; (repl-default-option-set!
+;; 'prompt
+;; (lambda (repl)
+;; (format #f "\n[~a@~a:~a]\nλ> "
+;; (getenv "USER")
+;; (vector-ref (uname) 1)
+;; (pwd))))