dlists: simpler equality.
parent
fd61f71956
commit
6f20c2fa61
|
@ -35,20 +35,10 @@ TUPLE: dlist
|
||||||
|
|
||||||
M: dlist deque-empty? front>> not ; inline
|
M: dlist deque-empty? front>> not ; inline
|
||||||
|
|
||||||
<PRIVATE
|
|
||||||
|
|
||||||
: dlist-nodes= ( dlist-node/f dlist-node/f -- ? )
|
|
||||||
{
|
|
||||||
[ [ dlist-link? ] both? ]
|
|
||||||
[ [ obj>> ] bi@ = ]
|
|
||||||
} 2&& ; inline
|
|
||||||
|
|
||||||
PRIVATE>
|
|
||||||
|
|
||||||
M: dlist equal?
|
M: dlist equal?
|
||||||
over dlist? [
|
over dlist? [
|
||||||
[ front>> ] bi@
|
[ front>> ] bi@
|
||||||
[ 2dup dlist-nodes= ]
|
[ 2dup { [ and ] [ [ obj>> ] bi@ = ] } 2&& ]
|
||||||
[ [ next>> ] bi@ ] while
|
[ [ next>> ] bi@ ] while
|
||||||
or not
|
or not
|
||||||
] [
|
] [
|
||||||
|
|
Loading…
Reference in New Issue