• 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: Usage of +class
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Usage of +class


  • Subject: Re: Usage of +class
  • From: j o a r <email@hidden>
  • Date: Sat, 22 Apr 2006 18:00:38 +0200


On 22 apr 2006, at 17.42, Jonathon Mah wrote:

A class identifier has two uses: a _type_, and a message receiver. Contrast this to a variable, which has two uses: a _value_, and a message receiver.

I think you say "variable" where you mean "object" (instance of a class). A variable has a type, and can hold a value. If that value is an object (class or instance), you can send messages to it. Consider the following entities:


Class Name
Class Object
Object (Instance of Class)

When you send class messages to the class name, you're really sending them to the class object. Using the class name is just a shorthand / convenience. This convenience (substitution of the class object for the class name) doesn't work elsewhere, for example when passing class objects as parameters to methods.

Interestingly, you can change the use of a class name from a type to a value:

I think you're just playing with the _scope_ of variables here.

j o a r


Attachment: smime.p7s
Description: S/MIME cryptographic signature

 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

References: 
 >Usage of +class (From: Jonathon Mah <email@hidden>)
 >Re: Usage of +class (From: j o a r <email@hidden>)
 >Re: Usage of +class (From: Jonathon Mah <email@hidden>)

  • Prev by Date: init code for new document only
  • Next by Date: debugger problem
  • Previous by thread: Re: Usage of +class
  • Next by thread: Re: Usage of +class
  • Index(es):
    • Date
    • Thread