dlists: simpler equality.

db4
John Benediktsson 2012-07-13 17:29:20 -07:00
parent fd61f71956
commit 6f20c2fa61
1 changed files with 1 additions and 11 deletions

View File

@ -35,20 +35,10 @@ TUPLE: dlist
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?
over dlist? [
[ front>> ] bi@
[ 2dup dlist-nodes= ]
[ 2dup { [ and ] [ [ obj>> ] bi@ = ] } 2&& ]
[ [ next>> ] bi@ ] while
or not
] [