 : delete-node-if ( ... dlist quot: ( ... value -- ... ? ) -- ... obj/f )
     '[ obj>> @ ] delete-node-if* drop ; inline
 
-M: dlist clear-deque ( dlist -- )
-    f >>front
-    f >>back
-    drop ;
+M: dlist clear-deque
+    f >>front f >>back drop ;
 
 : dlist-each ( ... dlist quot: ( ... value -- ... ) -- ... )
     '[ obj>> @ ] dlist-each-node ; inline

sequences summary vocabs.loader ;
IN: dlists

TUPLE: dlist-link { prev maybe{ dlist-link } } { next maybe{ dlist-link } } ;

TUPLE: dlist-node < dlist-link obj ;


<PRIVATE

: (push-before-node) ( obj dlist-node -- new-dlist-node )
    [ [ prev>> ] keep <dlist-node> dup ] keep
    [ dupd next<< ] change-prev drop ; inline

: push-before-node ( obj dlist-node dlist -- new-dlist-node )
    2dup front>> eq? [
