diff options
-rw-r--r-- | Biz/Serval.scm | 5 | ||||
-rw-r--r-- | bs/core.scm | 17 |
2 files changed, 13 insertions, 9 deletions
diff --git a/Biz/Serval.scm b/Biz/Serval.scm index 303acdb..0e6be55 100644 --- a/Biz/Serval.scm +++ b/Biz/Serval.scm @@ -39,9 +39,10 @@ #:use-module ((srfi srfi-9) #:select (define-record-type)) #:use-module ((bs core) - #:select (rest fmt prn comment)) + #:select (first second rest turn fmt prn comment)) #:use-module ((bs test) #:select (testing)) + #:use-module ((bs shell) #:prefix Shell.) #:export (main)) (define *data-dir* "/var/lib/serval") @@ -64,7 +65,7 @@ ["ssh" (run-in-kit! args)] ["info" (prn "TODO: show kit")] ["ls" ("TODO: list available kits")] - [else (prn "help")]))) + [else (prn "TODO: help text")]))) (define-record-type @Kit (Kit name nix-path system-path host-address diff --git a/bs/core.scm b/bs/core.scm index 943e586..73b328d 100644 --- a/bs/core.scm +++ b/bs/core.scm @@ -4,7 +4,7 @@ #:use-module ((ice-9 rdelim) #:select (read-line)) #:use-module (srfi srfi-1) #:export (fmt printf pr prn - first ffirst rest last butlast + first ffirst second rest last butlast true? false? some? empty? -> ->> fn /. curry comp repeat for seq turn @@ -59,15 +59,18 @@ (define (empty? a) (equal? a '())) -(define (first a) - (car a)) +(define (first coll) + (car coll)) -(define (ffirst a) - (first (first a))) +(define (ffirst coll) + (first (first coll))) -(define (rest a) +(define (rest coll) "Returns a list of the items after the first." - (cdr a)) + (cdr coll)) + +(define (second coll) + (first (rest coll))) (define (last coll) "Return the last time in coll, in linear time." |