From 1542c85458dcd58bb6d40f1f8d3917f80298ddd2 Mon Sep 17 00:00:00 2001 From: Ben Sima Date: Sat, 9 May 2020 20:02:55 -0700 Subject: Remove my nil thing --- Alpha/Core.scm | 32 +++++++++----------------------- Biz/Serval.scm | 8 ++++---- 2 files changed, 13 insertions(+), 27 deletions(-) diff --git a/Alpha/Core.scm b/Alpha/Core.scm index 6666e7d..997bc4f 100644 --- a/Alpha/Core.scm +++ b/Alpha/Core.scm @@ -4,12 +4,12 @@ #:use-module ((ice-9 rdelim) #:select (read-line)) #:use-module ((srfi srfi-1) #:select (any)) #:export (fmt printf pr prn - first ffirst second rest last butlast - true? false? nil nil? some? empty? - -> ->> fn /. curry comp - repeat - inc dec member? contains? - comment get-source* get-source source)) + first ffirst second rest last butlast + true? false? some? empty? + -> ->> fn /. curry comp + repeat + inc dec member? contains? + comment get-source* get-source source)) (define (flip f) (lambda (x y) (f y x))) (define (curry f a) (lambda (b) (apply f (cons a (list b))))) @@ -56,11 +56,6 @@ (define (true? x) (eq? #t x)) -(define nil #nil) - -(define (nil? x) - (eq? nil x)) - (define (some? a) (not (nil? a))) @@ -71,7 +66,7 @@ "Return the first item in the collection." (if (pair? a) (car a) - nil)) + '())) (define (ffirst a) (first (first a))) @@ -95,19 +90,10 @@ (let ((len (length ls))) (list-head ls (- len 1)))) -;; Ignores body, returns nil. +;; Ignores body, returns '(). (define-syntax comment (syntax-rules () - ((_ ...) nil))) - -(comment - ;; nil is different from null. nil is supposed to be more like - ;; 'Nothing' in Haskell, it is the absence of any value or type; - ;; whereas null is specifically the empty list, which still has a type - ;; of 'list'. - (null? '()) ;; => #t - (nil? '()) ;; => #f - ) + ((_ ...) '()))) (define (some pred coll) (or (pred (first coll)) diff --git a/Biz/Serval.scm b/Biz/Serval.scm index 87cc238..1ccab41 100644 --- a/Biz/Serval.scm +++ b/Biz/Serval.scm @@ -37,7 +37,7 @@ #:use-module ((srfi srfi-9) #:select (define-record-type)) #:use-module ((Alpha Core) - #:select (second rest fmt prn first comment nil)) + #:select (second rest fmt prn first comment)) #:use-module ((Alpha Test) #:select (testing)) #:use-module ((Alpha Shell) #:prefix Shell.) @@ -157,14 +157,14 @@ TODO: ensure kit-name is unique (define (update-kit! args) ;; TODO: load kit and update with new config file - (let ([kit nil]) + (let ([kit #nil]) (Shell.exec (fmt "nix-env -p ~a/system -I nixos-config=~a -f --set -A system" *nix-profiles-dir* - (get-system-path nil))))) + (get-system-path #nil))))) (define (run-in-kit! args) - (let ([kit nil]) + (let ([kit #nil]) (Shell.exec (fmt "systemd-run --machine ~a --pty --quiet -- ~{~a~}" (kit-name kit) args)))) -- cgit v1.2.3