 : 1dlist ( obj -- dlist ) <dlist> [ push-front ] keep ;
 
 : dlist-filter ( ... dlist quot: ( ... value -- ... ? ) -- ... dlist' )
-    [ not ] compose
-    <dlist> [ '[ dup obj>> @ [ drop ] [ obj>> _ push-back ] if ] dlist-each-node ] keep ; inline
+    <dlist> [
+        '[ _ keep swap [ _ push-back ] [ drop ] if ] dlist-each
+    ] keep ; inline
 
 M: dlist clone
     <dlist> [ '[ _ push-back ] dlist-each ] keep ;

<PRIVATE

: (push-before-node) ( obj dlist-node -- new-dlist-node )
    [ [ prev>> ] keep <dlist-node> ] keep {
        [ prev>> [ next<< ] [ drop ] if* ]
        [ prev<< ]
        [ drop ]
    } 2cleave ; inline

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

sequences summary vocabs.loader ;
IN: dlists

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

TUPLE: dlist-node < dlist-link obj ;

