reference-barrier Marc Nieper-Wißkirchen (27 Aug 2016 12:55 UTC)
Re: reference-barrier John Cowan (27 Aug 2016 14:01 UTC)
Re: reference-barrier Marc Nieper-Wißkirchen (27 Aug 2016 15:40 UTC)
Re: reference-barrier Taylor R Campbell (27 Aug 2016 18:30 UTC)
Re: reference-barrier Marc Nieper-Wißkirchen (29 Aug 2016 14:48 UTC)
Re: reference-barrier Marc Nieper-Wißkirchen (29 Oct 2016 08:29 UTC)
Re: reference-barrier Marc Nieper-Wißkirchen (18 Aug 2020 08:20 UTC)
Re: reference-barrier Taylor R Campbell (18 Aug 2020 14:17 UTC)
Re: reference-barrier Marc Nieper-Wißkirchen (18 Aug 2020 14:29 UTC)
Re: reference-barrier Arthur A. Gleckler (26 Aug 2020 23:22 UTC)
Re: reference-barrier Marc Nieper-Wißkirchen (27 Aug 2020 06:15 UTC)
Re: reference-barrier Arthur A. Gleckler (27 Aug 2020 06:26 UTC)
Re: reference-barrier Marc Nieper-Wißkirchen (07 Sep 2020 06:32 UTC)
Re: reference-barrier Arthur A. Gleckler (30 Nov 2020 19:46 UTC)
Re: reference-barrier John Cowan (30 Nov 2020 19:53 UTC)
Re: reference-barrier Arthur A. Gleckler (30 Nov 2020 20:31 UTC)
Re: reference-barrier John Cowan (30 Nov 2020 20:31 UTC)
Re: reference-barrier Arthur A. Gleckler (30 Nov 2020 20:47 UTC)
Re: reference-barrier Arthur A. Gleckler (30 Nov 2020 20:53 UTC)
Re: reference-barrier Marc Nieper-Wißkirchen (30 Nov 2020 21:10 UTC)

Re: reference-barrier Marc Nieper-Wißkirchen 27 Aug 2020 06:15 UTC

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.