patch s:equal? in srfi 63 (from Chongkai)
svn: r6063
This commit is contained in:
parent
138009b8a5
commit
6db966db0e
|
@ -154,23 +154,21 @@
|
|||
(and (s:equal? (vector-ref obj1 idx)
|
||||
(vector-ref obj2 idx))
|
||||
(lp (sub1 idx))))))
|
||||
(cond
|
||||
((my-array? obj1)
|
||||
(and (array? obj2)
|
||||
(equal? (array-dimensions obj1) (array-dimensions obj2))
|
||||
(s:equal? (array->vector obj1) (array->vector obj2))))
|
||||
((struct? obj1)
|
||||
(and (struct? obj2)
|
||||
(let-values (((obj1-type obj1-skipped?)
|
||||
(struct-info obj1))
|
||||
((obj2-type obj2-skipped?)
|
||||
(struct-info obj2)))
|
||||
(and (eq? obj1-type obj2-type)
|
||||
(not obj1-skipped?)
|
||||
(not obj2-skipped?)
|
||||
(s:equal? (struct->vector obj1)
|
||||
(struct->vector obj2))))))
|
||||
(else #f))))
|
||||
(and (my-array? obj1)
|
||||
(my-array? obj2)
|
||||
(equal? (array-dimensions obj1) (array-dimensions obj2))
|
||||
(s:equal? (array->vector obj1) (array->vector obj2)))
|
||||
(and (struct? obj1)
|
||||
(struct? obj2)
|
||||
(let-values (((obj1-type obj1-skipped?)
|
||||
(struct-info obj1))
|
||||
((obj2-type obj2-skipped?)
|
||||
(struct-info obj2)))
|
||||
(and (eq? obj1-type obj2-type)
|
||||
(not obj1-skipped?)
|
||||
(not obj2-skipped?)
|
||||
(s:equal? (struct->vector obj1)
|
||||
(struct->vector obj2)))))))
|
||||
|
||||
(define (array-rank obj)
|
||||
(if (array? obj) (length (array-dimensions obj)) 0))
|
||||
|
|
Loading…
Reference in New Issue
Block a user