From f1bd1d461fcd029d1392e8070603d3d960954b17 Mon Sep 17 00:00:00 2001 From: Jan Nieuwenhuizen Date: Sun, 17 Jul 2016 12:56:31 +0200 Subject: [PATCH] add simple <=, >= and list?. --- scm.mes | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/scm.mes b/scm.mes index 533b9477..ad0dd531 100755 --- a/scm.mes +++ b/scm.mes @@ -108,6 +108,18 @@ (cond (x #f) (#t #t))) +(define (<= a b) ;; FIXME: only 2 arg + (or (< a b) + (= a b))) + +(define (>= a b) ;; FIXME: only 2 arg + (or (> a b) + (= a b))) + +(define (list? x) + (or (null? x) + (and (pair? x) (list? (cdr x))))) + (define-macro (if expr then . else) `(cond (,expr ,then)