add simple <=, >= and list?.

This commit is contained in:
Jan Nieuwenhuizen 2016-07-17 12:56:31 +02:00
parent c4d3d26f8d
commit f1bd1d461f

12
scm.mes
View file

@ -108,6 +108,18 @@
(cond (x #f) (cond (x #f)
(#t #t))) (#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) (define-macro (if expr then . else)
`(cond `(cond
(,expr ,then) (,expr ,then)