[bitc-dev] Type compatibility at application

Jonathan S. Shapiro shap at eros-os.org
Fri May 19 10:20:32 EDT 2006


Currently, if a procedure accepts type T, it is legal to pass a value of
type (mutable T) -- the copy strips mutability.

In principle, this could be extended: a procedure accepting (ref T) can
safely be passed a value of type (ref (mutable T)) [note that the
reverse is not true, because this is not a value copy].

This can be extended further: a procedure accepting (vector T) can
safely be passed a value of type (vector (mutable T)).

Things do get trickier for arguments of procedure type, because of
contravariance issues.

Which of these subtypings should be permitted in the context of
procedure application?

The reason I ask is that I am concerned about the number of cases that
may require polyinstantiation due to mutability. I do not have any
intuition about how important this is.


shap



More information about the bitc-dev mailing list