     [ set-prev-when ]
     [ swap set-next-when ] 2bi ; inline
 
-M: dlist push-front* ( obj dlist -- dlist-node )
-    [ front>> f swap <dlist-node> dup dup set-next-prev ] keep
-    [ front<< ] keep
-    set-back-to-front ;
+M: dlist push-front*
+    [
+        f swap <dlist-node> dup dup set-next-prev
+    ] change-front set-back-to-front ;
 
 : push-node-front ( dlist-node dlist -- )
-    [ front>> >>next drop ]
-    [ front<< ]
-    [ [ set-next-prev ] [ set-back-to-front ] bi* ] 2tri ;
+    dupd [ >>next ] change-front
+    [ set-next-prev ] [ set-back-to-front ] bi* ;
 
 : push-node-back ( dlist-node dlist -- )
-    [ back>> >>prev drop ]
-    [ back<< ]
-    [ [ set-prev-next ] [ set-front-to-back ] bi* ] 2tri ;
-
-M: dlist push-back* ( obj dlist -- dlist-node )
-    [ back>> f <dlist-node> ] keep
-    [ back>> set-next-when ] 2keep
-    [ back<< ] 2keep
-    set-front-to-back ;
-
-M: dlist peek-front* ( dlist -- obj/f ? )
+    dupd [ >>prev ] change-back
+    [ set-prev-next ] [ set-front-to-back ] bi* ;
+
+M: dlist push-back*
+    [
+        [ f <dlist-node> dup dup ]
+        [ set-next-when ] bi
+    ] change-back set-front-to-back ;
+
+M: dlist peek-front*
     front>> [ obj>> t ] [ f f ] if* ;
 
-M: dlist peek-back* ( dlist -- obj/f ? )
+M: dlist peek-back*
     back>> [ obj>> t ] [ f f ] if* ;
 
-M: dlist pop-front* ( dlist -- )
-    [
-        [
-            [ empty-deque ] unless*
-            next>>
-            f over set-prev-when
-        ] change-front drop
-    ] keep
-    normalize-back ;
-
-M: dlist pop-back* ( dlist -- )
-    [
-        [
-            [ empty-deque ] unless*
-            prev>>
-            f over set-next-when
-        ] change-back drop
-    ] keep
-    normalize-front ;
+M: dlist pop-front*
+    [
+        [ empty-deque ] unless*
+        next>>
+        f over set-prev-when
+    ] change-front normalize-back ;
+
+M: dlist pop-back*
+    [
+        [ empty-deque ] unless*
+        prev>>
+        f over set-next-when
+    ] change-back normalize-front ;
 
 : dlist-find ( ... dlist quot: ( ... value -- ... ? ) -- ... obj/f ? )
     '[ obj>> @ ] dlist-find-node [ obj>> t ] [ f f ] if* ; inline

sequences summary vocabs.loader ;
IN: dlists

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

TUPLE: dlist-node < dlist-link obj ;


: dlist-any? ( ... dlist quot: ( ... value -- ... ? ) -- ... ? )
    dlist-find nip ; inline

M: dlist deque-member?
    [ = ] with dlist-any? ;

M: dlist delete-node
    [
        {
            { [ 2dup front>> eq? ] [ nip pop-front* ] }
