<commit_before>//
//  ARCWeakRef.h
//  M9Dev
//
//  Created by MingLQ on 2013-07-08.
//  Copyright (c) 2013 MingLQ <<EMAIL>>.
//  Released under the MIT license.
//

#import <Foundation/Foundation.h>

#import "EXTScope.h"

/**
 *  Bring ARC weak ref to MRC code.
 *  !!!: Use weakify and strongify from extobjc instead in ARC.
 *
 *  Usage:
 *      weakifyself;
 *      [object setCallback:^{
 *          strongifyself;
 *          NSLog(@"self: %@", self);
 *      }];
 *  OR
 *      __typeof__(self) selfType;
 *      ARCWeakRef *weakRef = [ARCWeakRef weakRefWithObject:self];
 *      [object setCallback:^{
 *          __typeof__(selfType) self = weakRef.object
 *          NSLog(@"self: %@", self);
 *      }];
 */

#define weakifyself __typeof__(self) $selfType; ARCWeakRef *$weakRef = [ARCWeakRef weakRefWithObject:self]
#define strongifyself __typeof__($selfType) self = $weakRef.object

@interface ARCWeakRef : NSObject

@property(nonatomic, weak) id object;

+ (instancetype)weakRefWithObject:(id)object;

@end
<commit_msg>remove weakifyself and strongifyself from ARCWeakRef<commit_after>//
//  ARCWeakRef.h
//  M9Dev
//
//  Created by MingLQ on 2013-07-08.
//  Copyright (c) 2013 MingLQ <<EMAIL>>.
//  Released under the MIT license.
//

#import <Foundation/Foundation.h>

#import "EXTScope.h"

/**
 *  Bring ARC weak ref to MRC code.
 *  !!!: Use weakify and strongify from extobjc instead in ARC.
 *
 *  Usage:
 *      NSMutableArray *observers = ...;
 *      [observers addObject:[ARCWeakRef weakRefWithObject:observer]];
 *  OR
 *      __typeof__(self) selfType;
 *      ARCWeakRef *weakRef = [ARCWeakRef weakRefWithObject:self];
 *      [object setCallback:^{
 *          __typeof__(selfType) self = weakRef.object
 *          NSLog(@"self: %@", self);
 *      }];
 */

@interface ARCWeakRef : NSObject

@property(nonatomic, weak) id object;

+ (instancetype)weakRefWithObject:(id)object;

@end

{'fraction_non_alphanumeric': 0.14285714285714285, 'fraction_numerical': 0.013605442176870748, 'mean_word_length': 3.0854700854700856, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 9, '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': '1829189', 'n_tokens_mistral': 727, 'n_tokens_neox': 658, 'n_words': 153}