On Thu, Mar 31, 2011 at 9:08 PM, Ben Kloosterman <[email protected]> wrote:
>
>
>>
>> On Thu, Mar 31, 2011 at 7:23 PM, Ben Kloosterman <[email protected]>
>> wrote:
>> > C# and .NET 1.0 had the same scheme but you were always checking if
>> > the type is correct , casting  and sometimes boxing ( since object is
>> > a reference
>> > type)  and generics gave quite a nice boost .
>>
>> I guess I am confused by the reference to generics, because (from shap's
>> email)
>>
>>   pure boxed List('a) is
>>     elem: 'a
>>     next:: List('a)
>>
>> seems like a fairly generic list to me, I kind of assumed that any
> inheritance
>> mechanism would maintain the type variable mechanism.
>
> But for this question  only for one variable right ?  This boils down to is
> a single value generic  <T> good enough and not say <T,K>.
> So a custom collection holing a list and another element would require 2
> types  and what about dictionaries ( you can have an intermediate  key
> /value element but you cant have a type class on the element and key)  .
> Also your ability to represent standard interfaces via Type classes maybe an
> Issue eg some form of Collection  TypeClass which would allow  you to change
> between ArrayList , Sorted List  , Linked list according to need following
> benchmarking .
>

I believe multiple type variables are fine e.g.

pure boxed ListOfTwoThings('a, 'b) is
    elem: 'a
    elemNumberTwo: 'b
    next:: ListOfTwoThings('a, 'b)

which would allow you to subclass 'List' into ArrayList, and
SortedList, but due to single inheritance, you could not use multiple
inheritance to subclass both ArrayList and SortedList into
SortedArrayList.

This is the understanding with which I have approached this thread anyhow.

_______________________________________________
bitc-dev mailing list
[email protected]
http://www.coyotos.org/mailman/listinfo/bitc-dev

Reply via email to