[R6RS] mutability of pairs

dyb at cs.indiana.edu dyb at cs.indiana.edu
Tue Jun 20 14:23:50 EDT 2006


>         Will moved that pairs created during construction
>             of a rest argument be immutable; Kent pointed
>             out that (lambda x x) would no longer be a
>             legitimate implementation of list
>         Motion failed for lack of a second

Also, I don't see enough point in the restriction.  It wouldn't generally
obviate the list copy done by apply (i.e., allow the pairs to be shared
among the list passed to apply and the rest argument) unless we also
require that the list passed to apply be immutable.  On the other hand, it
might allow a compiler to avoid quadratic copying with recursive
procedures defined with apply in some cases where the compiler can't do so
already.

>         Mike moved that pairs be immutable; Will seconded
>             (this includes leaving set-car! and set-cdr! out
>             of any official R5RS compatibility libraries)
>         Discussion: maybe we should announce it and see
>             what the community says
>         Motion withdrawn, with consent of Mike and Will
>         Anton moved that the status report say we are
>             considering making pairs immutable after all
>             and would like community feedback; Mike
>             seconded (or maybe the other way around)
>         Vote: approved unanimously

Should we also say we're considering requiring that cons's second argument
be a list?  Then list? is just (lambda (x) (or (null? x) (pair? x))) and we
can get rid of even more cruft.  It would make clear that one should use
records instead of pairs for anything but actual lists of elements, which
I think is basically where all this is heading.

This is a serious suggestion---please respond ASAP so that I can include
it in the report if we want.  I vote 'yes': we should say we're considering
this.

Kent



More information about the R6RS mailing list