Email list hosting service & mailing list manager

circular <= shared Matthias Radestock (17 Dec 2002 08:58 UTC)
Re: circular <= shared bear (17 Dec 2002 15:02 UTC)
Re: circular <= shared Matthias Radestock (17 Dec 2002 15:08 UTC)

circular <= shared Matthias Radestock 17 Dec 2002 08:58 UTC

The SRFI fails to distinguish between sharing and circularities. This is
important because R5RS *does* specify how non-circular shared structures
should be written/displayed(*). For instance
  (define x (cons #f #f))
  (define y (cons 1 1))
  (set-car! x y)
  (set-cdr! x y)
  (write x)
should produce
  ((1 . 1) 1 . 1)
when written in an R5RS-conformant system, and *not*
  (#0=(1 . 1) . #0#)

iirc, Al Petrofsky posted an algorithm that detects circularities
without also catching sharing. It has higher computational complexity
and is harder to implement than detecting all sharing.

CL makes this distinction. See

(*) Arguably, R5RS even specifies how circular structures should be
written - as infinite outputs.