• 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: Future Objective-C changes
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Future Objective-C changes


  • Subject: Re: Future Objective-C changes
  • From: David Cittadini <email@hidden>
  • Date: Fri, 16 May 2003 16:16:50 +1000

With regards to generics, I have found the feature very useful to (a) type collections - this guarantees the collections are of a certain type without having to programmatically check all the time and (b) cutting down on coding time as I don't have to create lots of different methods for different parameter types. The problem with Objective-C++ is that I cannot use generics on "native" Objective-C/C++ functions/methods - I can use templates within Objective-C/C++ methods/functions but methods/field declarations cannot contain templates. It would be nice if generic/parameterized types were at least available to all parts of Objective-C++ code.

With regards to abstract classes, it is a bit of a pain to create empty methods that just throw exceptions. The problem is that the caller has no way of knowing if the class is abstract or not. You have to sort of instantiate it to see if it works. Wouldn't it be much nicer of the class could declare itself as abstract in some way - without finding out after you call it.

With regards to method overloading, I thought it may be useful to be able to say:

-(int)doSomethingWithFoo:(Foo*)y;
-(int)doSomethingWithFoo:(int)y;

With method overloading the compiler could resolve most of the parameter type issues without me having to create different method names just because the parameter type is different.

David.


On Friday, May 16, 2003, at 02:31 PM, Nicholas Riley wrote:

On Fri, May 16, 2003 at 02:04:37PM +1000, David Cittadini wrote:
Is there anywhere to monitor or suggest changes to the Objective-C
language? For example, I am interested to know if one day Objective-C
classes will support:

a) Namespaces/packages.
b) Generics/parameterized types.
c) Abstract classes, or at least some way to enforce that a class
cannot be instantiated directly.
d) Method overloading.

a) is useful and needed IMO; c) can be done easily by raising an
exception. b) really doesn't fit Objective-C's type system very well,
and doesn't provide any efficiency gains, since all methods are
dynamically invoked. Nothing stops you from using STL with
Objective-C++, of course.

d) is rather unnecessary given the format of Objective-C selectors.
Instead of int doSomething(Foo *y), you have
- (int)doSomethingWithFoo:(Foo *)y;

--
=Nicholas Riley <email@hidden> | <http://www.uiuc.edu/ph/www/njriley>
Pablo Research Group, Department of Computer Science and
Medical Scholars Program, University of Illinois at Urbana-Champaign
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.

  • Follow-Ups:
    • Re: Future Objective-C changes
      • From: Chris Hanson <email@hidden>
    • Re: Future Objective-C changes
      • From: Nicholas Riley <email@hidden>
    • Re: Future Objective-C changes
      • From: Prachi Gauriar <email@hidden>
    • Re: Future Objective-C changes
      • From: James McCartney <email@hidden>
References: 
 >Re: Future Objective-C changes (From: Nicholas Riley <email@hidden>)

  • Prev by Date: Re: opposite of +initlialize
  • Next by Date: Re: Future Objective-C changes
  • Previous by thread: Re: Future Objective-C changes
  • Next by thread: Re: Future Objective-C changes
  • Index(es):
    • Date
    • Thread