From c790672cc244ac4caba1bda3572829a6c6862891 Mon Sep 17 00:00:00 2001 From: Ben Sima Date: Sun, 27 Oct 2019 09:48:52 -0700 Subject: move everything to namespace directories --- com/simatime/repl.scm | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 com/simatime/repl.scm (limited to 'com/simatime/repl.scm') 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)))) -- cgit v1.2.3