add simple <=, >= and list?.

This commit is contained in:
Jan Nieuwenhuizen 2016-07-17 12:56:31 +02:00
parent c4d3d26f8d
commit f1bd1d461f
1 changed files with 12 additions and 0 deletions

12
scm.mes
View File

@ -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)