• 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: Parameter lists
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Parameter lists


  • Subject: Re: Parameter lists
  • From: Alastair Houghton <email@hidden>
  • Date: Fri, 7 Nov 2003 22:55:27 +0000

On 7 Nov 2003, at 22:47, John MacMullin wrote:

With that reflection let us turn to the merits of my comment, which again, was not intended to insult Apple or anyone else.

I don't think anyone assumed that it was. We're just a bit surprised at what you wrote.

My original code came from the Objective C Pocket Reference by Duncan and and the C Programming Language by K and R. Placing multiple parameters in a function (or method) separated by commas is the ordinary c approach. Others on the cocoa list, and in the Apple doc, had stated that support for the ordinary c language is part of Cocoa.

I think you've got the wrong end of the stick.

Support for the ordinary C language is part of Objective-C. Cocoa is just a set of frameworks you can use with Objective-C. Methods, since they are not a part of the C language, use Objective-C syntax, which uses colons rather than commas, primarily because it supports named arguments (a single colon with no name is just an argument with a blank name).

Some methods do, in fact, use commas, but only if they take a variable number of arguments (e.g. NSString's +stringWithFormat: method); this does seem somewhat inconsistent, and is probably an artefact of the original implementation of Objective-C.

Accordingly, it just seems to me that this approach should be supported in Cocoa.

It is, for C functions. But Objective-C isn't part of C (rather, the other way around).

Kind regards,

Alastair.
_______________________________________________
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: Parameter lists
      • From: John MacMullin <email@hidden>
References: 
 >Re: Parameter lists (From: John MacMullin <email@hidden>)

  • Prev by Date: Re: Parameter lists
  • Next by Date: Controller Layer and Automatic Key-Value Observing
  • Previous by thread: Re: Parameter lists
  • Next by thread: Re: Parameter lists
  • Index(es):
    • Date
    • Thread