Member Availability
| Has member? | Handler for missing member | |||
|---|---|---|---|---|
| Method | Field | Method | Field | |
| ABAP Objects | ||||
| C++ (STL) | ||||
| Objective-C (Cocoa) | forwardInvocation: | |||
| Smalltalk | x respondsTo: selector | doesNotUnderstand: | ||
| C# | (using reflection) | |||
| Java | ||||
| D | opDispatch | |||
| Eiffel | ||||
| Python | hasattr(x, "method") and callable(x.method) | hasattr(x, "field") | __getattr__ | |
| Visual Basic .NET | (using reflection) | |||
| Windows PowerShell | (using reflection) | |||
| F# | (using reflection) | |||
| Ruby | x.respond_to?(:method) | method_missing | ||
| PHP | method_exists(x, "method") | property_exists(x, "field") | __call | __get / __set |
| Perl | x->can("method") | exists x->{field} | AUTOLOAD | |
| Perl 6 | x.can("method") | x.field.defined | AUTOLOAD | |
| OCaml | ||||
| JavaScript | typeof x.method === "function" | field in x | ||
Read more about this topic: Comparison Of Programming Languages (object-oriented Programming)
Famous quotes containing the words member and/or availability:
“When committees gather, each member is necessarily an actor, uncontrollably acting out the part of himself, reading the lines that identify him, asserting his identity.... We are designed, coded, it seems, to place the highest priority on being individuals, and we must do this first, at whatever cost, even if it means disability for the group.”
—Lewis Thomas (b. 1913)
“Since ... six weeks ago, there has been no day in which I have not had letters and visits on the subject of my nomination for the Presidency.... I say very little. I have in no instance encouraged any one to work to that end.... I have said the whole talk about me is on the score of availability. Let availability do the work then.”
—Rutherford Birchard Hayes (18221893)