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

Re: dynamic vs. static typing



Ken Shan <ken@digitas.harvard.edu> writes:

> You wrote in article <n0alvp4j.fsf@ccs.neu.edu> in gmane.comp.lang.lightweight:
>> The reason there are no `TRULY heterogeneous lists' is because it is
>> always possible to create a discriminated union type that covers all
>> elements.
>> 
>> It is especially pointless if you fold all operations on objects
>> into the object interface itself.
>> 
>> 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.
>
> You seem to be claiming that permutation of a truly heterogeneous list
> is impossible without taking the view that certain operations (like
> intensional equivalence or intensional identity) are independent of the
> objects.  I probably misunderstood you, but I don't see how this claim
> is true, if you are in fact making it.  Permutation of lists can be done
> for a homogeneous list without knowing what type all of the objects in
> the list are (the type of such a permutation function looks like "forall
> a. [a]->[a]"); as a special case, one can permute a list whose element
> type is homogeneously "I have no idea" (substitute "exists b. b" for
> "a").

If there is no `identity' for the objects in the list, then the list
cannot be permuted (all `permutations' would be indistinguishable).