Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: beginner obj-c question



On Apr 4, 2008, at 4:36 PM, Bill Bumgarner wrote:
Objective-C does not have named parameters.

Here's a trivial proof that parameters are not named. If method parameters were named, you wouldn't be able to have a method like this:


    - (void)doSomethingWithThis:(id)objectOne
                        andThis:(id)objectTwo
                        andThis:(id)objectThree
                        andThis:(id)objectFour;

...because then you'd have three parameters with the same name.

The purpose of Objective-C method syntax is not to name the parameters, but to make method calls more readable when there are multiple parameters.

I forget where I saw the above trivial proof. I know bbum has commented on this misconception in a few places.

--Andy

_______________________________________________
Do not post admin requests to the list. They will be ignored.
Objc-language mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/objc-language/email@hidden

This email sent to email@hidden
References: 
 >Re: beginner obj-c question (From: Baiss Eric Magnusson <email@hidden>)
 >Re: beginner obj-c question (From: Bill Bumgarner <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.