[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Eq? issue



I have a few questions regarding the eq?-issue:

- Can one construct/traverse an eq?-cyclic or eqv?-cyclic graph of
  immutable record nodes?

  According to the spec, it seems that an eq? cyclic graph of
  immutable nodes cannot be constructed, so it would have to be
  eqv?-cyclic, but the spec does not guarantee that

   (let ((f (lambda () (construct ...))))
     (eqv? (f) (f))) => #f

  for /immutable/ records, which I think would be required for
  such cyclic graphs.

- I would not like to artificially declare an immutable record as
  mutable just so I can use it in a cyclic graph.

- A problem with treating mutable and immutable differently is that
  mutable might easily become immutable in the process of development
  if a field is dropped or changed - suddenly a program may break in
  places that are difficut to debug.

- Another problem is that programs that use eq?/eqv? incorrectly will
  mostly work on some Schemes, only to fail, and then mysteriously
  depending on compiler switches and type inference controlling unboxing,
  on others.

Cheers
Andre