Re: A question about static typing
Re: A question about static typing
- Subject: Re: A question about static typing
- From: Chris Gehlker <email@hidden>
- Date: Mon, 23 Jul 2001 07:28:42 -0700
On 7/22/01 10:32 AM, "Dennis C. De Mars" <email@hidden> wrote:
>
So, init and brethren pretty much have to return "id," otherwise you'd get
>
so many compiler warnings it would make the warning system useless. (And
>
this isn't even the only issue, there are similar issues related to sending
>
init to the superclass in the overriding method).
>
>
There are some other examples in Cocoa, in the collection classes for
>
instance, where "id" is deliberately used to avoid these kinds of issues
>
with subclasses. This tends to happen in places where objects return other
>
objects of the same class as themselves.
Great explanation! Thanks.
>
A couple of months ago I was trying to think of ways Obj-C could be modified
>
to reduce the use of id and make typing possible in more circumstances (I
>
would especially like strong-typed collections)
I don't see how that could work without some form of generic programming.