Suggestion (without proper HTML formatting):
PFN: Because one cannot reliably operate on ephemerons in a portable
way without calling the procedure `reference-barrier`, this
post-finalization note makes the procedure `reference-barrier`
mandatory.
The following is an example where `reference-barrier` is needed:
;; Return the datum component of the ephemeron if its key component is
KEY. Return #f otherwise.
(define (ephemeron-ref ephemeron key)
(let ((k (ephemeron-key ephemeron))
(d (ephemeron-datum ephemeron)))
(and (not (ephemeron-broken? ephemeron)) (eq? key k)
(reference-barrier k)
d)))
In this procedure, the evaluation of `(eq? key k)` is side effect
free, so it can be evaluated at any time after `k` has been retrieved,
in particular before the call `ephemeron-broken?`. Without the call to
`reference-barrier`, `key` may, therefore, be no longer referenced
when `ephemeron-broken?` is called so that this predicate may return
`#f`. In other words, without the call to `reference-barrier`, a
Scheme implementation may implement the above procedure as `(define
(ephemeron-ref ephemeron key) #f)`.
Am Do., 27. Aug. 2020 um 01:22 Uhr schrieb Arthur A. Gleckler
<xxxxxx@speechcode.com>:
>
> Hi, Marc. Can you propose a PFN to address this without an answer to your clarification question to Taylor? If so, would you mind sending one when you have a chance?
>
> I'm working through my backlog of unanswered SRFI questions.
>
> Thanks.