util.isomorph
- Determine isomorphism ¶Provides a procedure that determines whether two structures are isomorphic.
{util.isomorph
}
Returns #t
if obj1 and obj2 are isomorphic.
context is used if you want to call isomorphic?
recursively inside object-isomorphic?
described below.
(isomorphic? '(a b) '(a b)) ⇒ #t (define x (cons 0 0)) (define y (cons 0 0)) (isomorphic? (cons x x) (cons x y)) ⇒ #f (isomorphic? (cons x x) (cons y y)) ⇒ #t
{util.isomorph
}
With this method, you can customize how to determine isomorphism of
two objects. Basically, you will call isomorphic?
recursively
for each slots of object you want to traverse; the method should return
#t
if all of the test succeeds, or return #f
otherwise.
context is an opaque structure
that keeps the traversal context, and you should pass it to
isomorphic?
as is.
The default method returns #t
if obj1 and obj2 are
equal (in the sense of equal?
).