On Fri, Aug 30, 2013 at 1:23 AM, Jonathan S. Shapiro <[email protected]>wrote:

> On Thu, Aug 29, 2013 at 10:14 AM, David Jeske <[email protected]> wrote:
>
>> On Thu, Aug 29, 2013 at 9:54 AM, Jonathan S. Shapiro < [email protected] 
>> >wrote:
>>
>>>
>
>>  Yes. That's a big issue. Shifting the fixed-size arrays to the bottom
>>> is a useful special case, but it is defeated if further child classes are
>>> derived.
>>>
>>
>> Hmm.. yes, messy. Thus the reason fixed-size arrays are only allowed in
>> structs, which do not allow subtyping.
>>
>
> Nope. C# doesn't have a Nat kind, so the size of a fixed-size array cannot
> be parametric. There is no issue with subtyping a class that contains a
> fixed-size array in C#.
>
> Another limitation in C# is that a fixed size array can only contain
> non-reference types. That restriction is completely arbitrary and
> unnecessary. As with other restrictions, it reflects a limitation in the
> underlying CLR.
>
>
>> Somewhere in my core I'm convinced the solution to all of this is to end
>> implementation inheritence (and even implementation typing), and instead
>> rely on interface typing and implementation composition. We just need a
>> solution to that nasty traits/composition multiple-implementation issue. :)
>>
>
> I'm unclear how interfaces differ from inheritance, though. An interface
> is simply a degenerate class, so why does this move actually help anything?
> From a type system perspective, it certainly doesn't simplify anything.
>
> Lack of inheritance would also present a bit of a problem for code
> migration.
>

I would be happy with a warning for inheritance and a must be sealed error
for all var size containing objects .

Would really love

impl IComparer<Type1> { Compare =  ( x,y) => if ( x==y ) return 0; else
return -1} ;

where the implimentation is inferred.

at the moment people are just using predicates and lamda expressions (since
they are quicker to write) which is useful but that would be better in many
cases.

Regarding code  migration winrt  has no in heritance but it supports
inheritance in C# for UIElement  (and its the only winrt object)  , it does
this with a technique using 3 interfaces.  I can look it up if need be but
it should be  something like    class  Sample : IBaseClass
 constructor Sample  ( IBaseClass base)  and then aother indirection  if
that makes sense.


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

Reply via email to