Joy Online Manual

NAME
@protocol - Define a new Objective-C protocol

SYNOPSIS

@protocol protocol-name [<protocol1, protocol2, ...>]
[-|+][(type)] method-selector [declaration-list]
[-|+][(type)] method-selector [declaration-list]
...
@end

DESCRIPTION
Defines a new protocol that adopts the given other protocols and consists of the declared methods.  The @protocol syntax is identical to Objective-C. Joy understands the special protocol type qualifiers const, in, out, inout, bycopy, byref, and oneway.

Joy will report an error if there is a conflict between the protocol's methods and the methods required by any of the adopted other protocols.

If protocol-name already exists, a warning message will be reported, and the redefinition will be ignored.

EXAMPLE
A reference-counting protocol could be declared like this:

@protocol ReferenceCounting
- (void) setRefCount: (int) count;
- (int) refCount;
- (void) incrementCount;
- (void) decrementCount;
@end

SEE ALSO

@Class
@protocol (expression)

Index