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

Re: Why would anyone want opacity?



> I'm not quite sure, BTW, what sort of accident you have in mind.
> Is the programmer going to write "car" instead of the right
> accessor, or is it something a bit more subtle, such as calling
> "length" on something that isn't supposed to be treated as a
> list?

For example, a student might call MAP instead of SET-MAP.
This might happen to work when sets are represented as lists.
When the representation of a set is changed to a bitvector,
the code breaks.

In other words, your second example evolves into the first
example as the program is maintained.

> And are many programmers really going to type "car" or "vector-ref"
> (or whatever the "concrete" operation is) by accident, rather than
> out of some kind of misunderstanding?

Yes.  I am reporting an empirical fact.  I am not trying to
explain why it should be so.

Will