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

[matthias@xxxxxxxxxx: [Fwd: why are there no mutable collections?]]



Forwarded on behalf of Matthias:

From: Matthias Radestock <matthias@xxxxxxxxxx>
Organization: LShift Ltd
To: srfi-44@xxxxxxxxxxxxxxxxx
Subject: why are there no mutable collections?

The SRFI document refers to mutability in several places, yet the only 
mutating operations defined are linear updates. Linear update, as it is 
currently defined is "optional", ie. linear update operations are free 
to return fresh data structures. Thus linear update is little more than 
an optimization technique based on hints from the user, and the SRFI 
does not cater for mutable collections.

Many Schemes have mutable collections (e.g. hash tables are usually 
defined as mutable collections) and there is a substantial code base 
that relies on this mutability. Such code could not be easily modified 
to take advantage of this SRFI, which seems unfortunate.

Mutation is evil in most cases, but it can be useful. That's why Scheme 
has set!, set-car! and set-cdr!. So can we please have mutable collections.


Matthias.




----- End forwarded message -----

-- 

Attachment: pgp486zmqZeWU.pgp
Description: PGP signature