Re: SRFI 124: Ephemerons Taylor R Campbell 07 Sep 2015 18:48 UTC

   Date: Mon, 07 Sep 2015 18:25:00 +0000
   From: John Cowan <xxxxxx@ccil.org>

   Taylor R Campbell scripsit:

   > I suggest providing another procedure REFERENCE-BARRIER that
   > guarantees whatever object you pass to it will not have been GC'd
   > before the call to REFERENCE-BARRIER.

   How is that different from stashing the object in a variable?

Consider:

(let ((key (ephemeron-key e)))
  (if (not (ephemeron-broken? e))
      (begin
        (gc)
        (let ((datum (ephemeron-datum e)))
          ...no further references to key here...))))

At the (gc), the system may prove that key is no longer referenced, so
the ephemeron can be correctly broken.

Adding (reference-barrier key) into the body of the inner LET
invalidates that proof.