SketchyLISP Reference |
Copyright (C) 2007 Nils M Holm |
<<[divide] | [Index] | [eqvp]>> |
Conformance: R5RS Scheme
Purpose:
Compare two forms. Return
#t,
if the forms print equal.
Arguments:
A - datum
B - datum
Implementation:
(define (equal? a b) (cond ((string? a) (and (string? b) (string=? a b))) ((and (pair? a) (pair? b)) (and (equal? (car a) (car b)) (equal? (cdr a) (cdr b)))) ; This is actually caught by eqv? below ; ((or (procedure? a) (procedure? b)) ; (bottom)) (else (eqv? a b))))
Example:
(equal? '(a b (c d (e)) f) '(a b (c d (e)) f)) => #t
<<[divide] | [Index] | [eqvp]>> |