• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: A question about static typing
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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.


References: 
 >Re: A question about static typing (From: "Dennis C. De Mars" <email@hidden>)

  • Prev by Date: Re: Obj-C vs Java
  • Next by Date: Printer driver sample code?
  • Previous by thread: Re: A question about static typing
  • Next by thread: re: A question about static typing
  • Index(es):
    • Date
    • Thread