         nip data>> pop*
     ] [
         [ nip data>> pop ]
-        [ data-set-nth ]
+        [ data>> data-set-nth ]
         [ swap sift-up ] 2tri
     ] if ;
 

        pop* drop
    ] if ; inline

M: heap heap-pop
    [ data-first >entry< ] [ heap-pop* ] bi ;

: slurp-heap ( ... heap quot: ( ... value key -- ... ) -- ... )
    [ drop '[ _ heap-empty? ] ]

GENERIC: heap-push* ( value key heap -- entry )
GENERIC: heap-peek ( heap -- value key )
GENERIC: heap-pop* ( heap -- )
GENERIC: heap-delete ( entry heap -- )
GENERIC: heap-empty? ( heap -- ? )
GENERIC: heap-size ( heap -- n )
