<commit_before>/*
 *  EXTConcreteProtocol.h
 *  extobjc
 *
 *  Created by <NAME> on 2010-11-09.
 *  Released into the public domain.
 */

#import <objc/runtime.h>
#import <stdio.h>
#import "metamacros.h"

/**
 * Used to list methods with concrete implementations within a \@protocol
 * definition.
 *
 * Semantically, this is equivalent to using \@optional, but is recommended for
 * documentation reasons. Although concrete protocol methods are optional in the
 * sense that conforming objects don't need to implement them, they are,
 * however, always guaranteed to be present.
 */
#define concrete \
	optional

/**
 * Defines a "concrete protocol," which can provide default implementations of
 * methods within protocol \a NAME. A \@protocol block should exist in a header
 * file, and a corresponding \@concreteprotocol block in an implementation file.
 * Any object that declares itself to conform to protocol \a NAME will receive
 * its method implementations \e only if no method by the same name already
 * exists.
 *
 * @code
 *

@protocol MyProtocol
@required
	- (void)someRequiredMethod;

@optional
	- (void)someOptionalMethod;

@concrete
	- (BOOL)isConcrete;

@end

 *
 * @endcode
 * @code
 *

@concreteprotocol(MyProtocol)
- (BOOL)isConcrete {
  	return YES;
}

@end

 *
 * @endcode
 *
 * @warning You should not invoke methods against \c super in the implementation
 * of a concrete protocol, as the superclass may not be the type you expect (and
 * may not even inherit from \c NSObject).
 */
#define concreteprotocol(NAME) \
	/*
	 * create a class that simply contains all the methods used in this protocol
	 */ \
	interface NAME ## _MethodContainer : NSObject < NAME > {} \
	@end \
	\
	@implementation NAME ## _MethodContainer \
	/*
	 * when this class is loaded into the runtime, add the concrete protocol<commit_msg>Added a clarification comment to the concreteprotocol macro about why the container class conforms to the protocol itself<commit_after>/*
 *  EXTConcreteProtocol.h
 *  extobjc
 *
 *  Created by <NAME> on 2010-11-09.
 *  Released into the public domain.
 */

#import <objc/runtime.h>
#import <stdio.h>
#import "metamacros.h"

/**
 * Used to list methods with concrete implementations within a \@protocol
 * definition.
 *
 * Semantically, this is equivalent to using \@optional, but is recommended for
 * documentation reasons. Although concrete protocol methods are optional in the
 * sense that conforming objects don't need to implement them, they are,
 * however, always guaranteed to be present.
 */
#define concrete \
	optional

/**
 * Defines a "concrete protocol," which can provide default implementations of
 * methods within protocol \a NAME. A \@protocol block should exist in a header
 * file, and a corresponding \@concreteprotocol block in an implementation file.
 * Any object that declares itself to conform to protocol \a NAME will receive
 * its method implementations \e only if no method by the same name already
 * exists.
 *
 * @code
 *

@protocol MyProtocol
@required
	- (void)someRequiredMethod;

@optional
	- (void)someOptionalMethod;

@concrete
	- (BOOL)isConcrete;

@end

 *
 * @endcode
 * @code
 *

@concreteprotocol(MyProtocol)
- (BOOL)isConcrete {
  	return YES;
}

@end

 *
 * @endcode
 *
 * @warning You should not invoke methods against \c super in the implementation
 * of a concrete protocol, as the superclass may not be the type you expect (and
 * may not even inherit from \c NSObject).
 */
#define concreteprotocol(NAME) \
	/*
	 * create a class that simply contains all the methods used in this protocol
	 *
	 * it also conforms to the protocol itself, to help with static typing (for
	 * instance, calling another protocol'd method on self) – this doesn't cause
	 * any problems with the injection, since it's always done non-destructively
	 */ \
	interface NAME ## _MethodContainer : NSObject < NAME > {} \
	@end \
	\
	@implementation NAME ## _MethodContainer \
	/*
	 * when this class is loaded into the runtime, add the concrete protocol
{'fraction_non_alphanumeric': 0.08513816280806571, 'fraction_numerical': 0.003983071944236993, 'mean_word_length': 3.743801652892562, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 11, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2999817', 'n_tokens_mistral': 1164, 'n_tokens_neox': 1096, 'n_words': 488}