It would be convenient to be able to specify a class object by its name rather than sending the class message to it. The runtime already knows what the id of the class is so why should I go through the trouble of sending a message each time to retrieve this?
My guess is that the compiler will optimize it so that this doesn’t actually cause a message to be sent.
There must be some good reason (which I seek) that explains why the syntax must be this way.
That’s how it’s designed to work: the class name is a type. Objects are pointers to that type. And a tpye alone can’t be used as a value (constant, variable, expression, whatever you want to use it as…). If it’s inconvenient for you (euh, it sholdn’t be!), you can come up with a few workarounds: for eample, define a short macro:
or
Hope this helps.