summaryrefslogtreecommitdiff
path: root/com/simatime/repl.scm
diff options
context:
space:
mode:
authorBen Sima <ben@bsima.me>2019-10-27 09:48:52 -0700
committerBen Sima <ben@bsima.me>2019-10-27 12:14:40 -0700
commitc790672cc244ac4caba1bda3572829a6c6862891 (patch)
tree2706bb8044f7b14840c5f90f215b79b433e81045 /com/simatime/repl.scm
parent44df4ba39f65c3afd84bee6b03f47d9b061e9038 (diff)
move everything to namespace directories
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))))