What about Objective-C's treatment of nil (or NIL).  In Objective-C,
messages cannot be overloaded; the argument types and return type are fixed
on first declaration.  The same message can be sent to instances of any
class, of course. The system then ignores messages sent to nil: Assuming
reasonable declarations:

id foo = nil;
[foo shout:@"I don't exist."]; // Does nothing.
double weight = [foo weight]; // Does nothing but returns 0.0;
id bar = [foo parent]; // Does nothing but returns nil;

None of these would cause a stack trace or raise any sort of error
condition.

Respectfully,
Eric Jablow

-- 
You received this message because you are subscribed to the Google Groups "Java 
Posse" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/javaposse?hl=en.

Reply via email to