Extend heaps to allow removing arbitrary elements via an additional equality operator. #507

merged 1 commit into from Mar 31, 2014


None yet

4 participants


Obviously a comparison function yielding an ordering/c would be better,
but this change is backwards compatible. I needed this change for implementing
the self-adjusting computation algorithm that uses a priority queue that additionally
removes elements that are discovered to be "obsolete."


Looks good to me.

Racket member

When merged, this has the following error:

/home/samth/sw/plt/pkgs/data-pkgs/data-doc/data/scribblings/heap.scrbl:112:43: defproc: bad argument form
  in: (#:same? (-> any/c any/c any/c) equal?)
   /home/samth/sw/plt/racket/collects/compiler/cm.rkt:345:0: compile-zo*
   /home/samth/sw/plt/racket/collects/compiler/cm.rkt:510:0: maybe-compile-zo
   /home/samth/sw/plt/racket/collects/compiler/cm.rkt:621:2: do-check
   /home/samth/sw/plt/racket/collects/compiler/../racket/private/map.rkt:113:23: loop
   /home/samth/sw/plt/racket/collects/compiler/cm.rkt:621:2: do-check
   /home/samth/sw/plt/racket/collects/setup/parallel-do.rkt:420:20: loop

Silly me forgot the identifier following #:same?. Fixed now.

@plt plt merged commit 4e20ede into racket:master Mar 31, 2014

1 check was pending

Details default The Travis CI build is in progress
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment