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: What is the purpose of static typing?



On Thursday, July 25, 2002, at 09:53 , Marcel Weiher wrote:

No. The code for dealing with return types is at the call-site, the object has no control over it. It also has no actual knowledge of it, because the selector it gets passed doesn't contain any type-information,
at least not in Apple's Objective-C.

On Thursday, July 25, 2002, at 05:31 Uhr, email@hidden wrote:

The object can always use introspection to choose the right method though (this doesn't really correspond with your example).

Well, he is right, in a sense. The compiler just *might* compile the message passing into a very complicated code of

- getting the actual signature of the given selector with the given object;
- storing arguments at stack appropriately (using a very complicated code with many ifs).

That is, *THEORETICALLY*. In practice it would be *EXTREMELY* complicated (taking into account things like value struct arguments / return types, or first-responder sending, whoa!), and I fear that the result would be utterly unuseable, mainly for efficiency reasons. Nevertheless, in plain theory, it still could be done.
---
Ondra Cada
OCSoftware: email@hidden http://www.ocs.cz
private email@hidden http://www.ocs.cz/oc
_______________________________________________
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.
References: 
 >Re: What is the purpose of static typing? (From: Marcel Weiher <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.