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

Re: dynamic vs. static typing



Matt Hellige <matt@immute.net> writes:

> [Joe Marshall <jrm@ccs.neu.edu>]
>> 
>> But if you take the view that certain operations (like intensional
>> equivalence or intensional identity) are independent of the objects,
>> then the notion of heterogeneous lists becomes much more interesting.
>> Permutation, for example, becomes possible.
>> 
>
> Can you explain why a designer would want to take this view? Does it
> have some benefits that I've missed?

I take that view for philosophical reasons.  I'm happy for objects to
have `interfaces' that define how they are used, but I think things
like `existance', `identity' and `intensional equivalence' (i.e. if the
type and representation of A and the type and representation of B are
identical, then A *is* B) are concepts that are `external' to objects,
not part of the object.

I think there is some benefit to this view in terms of referential
transparency:  if A and B are both cons cells, and A is identical to
B, the (CAR A) ought to be identical to (CAR B) independent of what
that might be.  But if we can only test intensional equivalence on
objects that support an interface for it, then this no longer holds.

The idea of a SET is problematic, too.  If you cannot test for
intensional equivalence, you cannot test membership.  Additionally,
the set of {x:~(x=x)} is often used as the definition of a NULL set,
but if there are objects that do not support equivalence operations,
then that set is no longer null.

Obviously one could define a language for which there are no identity
or equivalence operators on objects, but I'm not sure that such a
language would be consistent.

There are often equivalence operations that are more appropriate than
intensional equivalence, and there is obviously an advantage to
providing them where necessary, but I cannot see a benefit to having
an object that deliberately supports *no* equivalence operations.