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

Re: Lexical syntax for boxes

This page is part of the web mail archives of SRFI 111 from before July 7th, 2015. The new archives for SRFI 111 contain all messages, not just those from before July 7th, 2015.

Alan Watson scripsit:

> A SRFI is a mini-standard. You can invoke the spirit when you're
> designing it. However, the text needs to specify the behavior of eqv?
> and eq?.

Point.  I'll add this to the next draft.

> My feeling is that the spirit of equal? is "equivalent same in the
> absence of mutation, eqv?, and eq?". However, R7RS abandoned this for
> records, presumably for a good reason.

Primarily because different Schemes do it in different ways: some use
`eqv?`, some descend into the object like Common Lisp `equalp` (but not
Common Lisp `equal`), some vary depending on whether the object contains
any mutable fields or not.

> Anyway, the SRFI needs to say what the behaviour of equal? is for
> boxes, regardless of whether you adopt vector-like or record-like
> behaviour.

I don't believe it does need to.  The answer can be left open, as it is
in R5RS and R7RS-small.  In R6RS, it's defined to be `eqv?`, at least if
boxes are defined using records, but left open if they are magic.

At the end of the Metatarsal Age, the dinosaurs     John Cowan
abruptly vanished. The theory that a single         cowan@xxxxxxxx
catastrophic event may have been responsible        http://www.ccil.org/~cowan
has been strengthened by the recent discovery of
a worldwide layer of whipped cream marking the
Creosote-Tutelary boundary.             --Science Made Stupid