 
 : pop-back* ( dlist -- ) pop-back drop ;
 
-: (dlist-find-node) ( quot dlist-node -- node/f ? )
-    dup dlist-node-obj pick dupd call [
-        drop nip t
-    ] [
-        drop dlist-node-next [ (dlist-find-node) ] [ drop f f ] if*
-    ] if ;
-
-: dlist-find-node ( quot dlist -- node/f ? )
-    dlist-front [ (dlist-find-node) ] [ drop f f ] if* ;
-
 : dlist-find ( quot dlist -- obj/f ? )
     dlist-find-node dup [ >r dlist-node-obj r> ] when ;
 

: set-front-to-back ( dlist -- )
    dup dlist-front
    [ drop ] [ dup dlist-back swap set-dlist-front ] if ;
PRIVATE>

: push-front ( obj dlist -- )

                  dec-length ] }
    } cond ;

: delete-node* ( quot dlist -- obj/f ? )
    tuck dlist-find-node [
        [ (delete-node) ] keep [ dlist-node-obj t ] [ f f ] if*
    ] [
        2drop f f
    ] if ;

: delete-node ( quot dlist -- obj/f )
    delete-node* drop ;

: dlist-each ( dlist quot -- )
    [ dlist-node-obj ] swap compose dlist-each-node ; inline
