Add "transient" intmap interface
authorAndy Wingo <wingo@pobox.com>
Wed, 1 Apr 2015 08:01:16 +0000 (10:01 +0200)
committerAndy Wingo <wingo@pobox.com>
Wed, 8 Apr 2015 15:17:59 +0000 (17:17 +0200)
* module/language/cps/intmap.scm (make-atomic-reference):
  (get-atomic-reference, set-atomic-reference!): New helpers.
  (*branch-size-with-edit*, *edit-index*): Branches now have a trailing
  field, an atomic reference to their owner.
  (<transient-intmap>): New record type.  A mutable intmap.
  (new-branch): Set the "edit" field on the branch.
  (clone-branch-and-set): No editor for this field.
  (assert-readable!, writable-branch): New helpers.
  (transient-intmap, persistent-intmap): New exported functions.
  (intmap-add!): New function.
  (intmap-next, intmap-prev, intmap-ref): Work on transient intmaps.
  (intmap-fold): Persist the intmap before folding over it.


No differences found