SketchyLISP Reference |
Copyright (C) 2006 Nils M Holm |
<<[succ] | [Index] | [-/-] |
Conformance: R5RS
Purpose: Test a number for being zero.
Arguments:
X - number
Model:
(define (zero? x) (= x 0))
Implementation:
(define (zero? x) (letrec ((zerop (lambda (list-x) (cond ((eq? (car list-x) 0d) (null? (cdr list-x))) (#t (= x 0)))))) (zerop (integer->list x))))
Example:
(zero? 0) => #t
See also:
digits,
even?,
negative?,
positive?.
<<[succ] | [Index] | [-/-] |