Retro video games delivered to your door every month!
Click above to get retro games delivered to your door ever month!
X-Hacker.org- Class(y) - <b>@:</b> http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
 @:
 Invoke sibling method directly without using a message send
------------------------------------------------------------------------------

 Syntax:

    @:<method name>[ ( [<parameter list>] ) ]

 Arguments:

    <method name> is the name of the method to be invoked.  It must be a
    method in the same class as the current method, and should either be
    defined in the same program module or according to the rules governing
    external methods.

    <parameter list> is the list of parameters to be sent to the method
    being invoked.

 Description:

    Similar to the double-colon (::) for message sends to self, the
    'at-colon' allows direct invocation of sibling methods, ie. methods in
    the same class as the invoking method.  Since the location of the
    invoked method is known in such a case, a message lookup is not
    necessary.  A direct invocation of this kind is therefore faster than
    the equivalent message send, but this is a trade-off for loss of
    flexibility.

 Warning:

    This feature should be used with great caution, since it prevents
    methods invoked in this fashion from being overridden in a subclass.
    This is sometimes desirable, however.

    For those familiar with C++, @: allows methods to be invoked in a way
    similar to that in which ordinary (non-virtual) C++ member functions
    are invoked.  Because of dynamic binding, methods in Clipper would
    otherwise behave in a similar way to C++ virtual methods.

Online resources provided by: http://www.X-Hacker.org --- NG 2 HTML conversion by Dave Pearson