This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
struct RecurrenceRelation<Element>: SequenceType, GeneratorType { | |
private var prevs: [Element] | |
private let relat: ([Element], Int) -> Element | |
private var i: Int = 0 | |
mutating func next() -> Element? { | |
guard i == prevs.endIndex else { return prevs[i++] } | |
prevs.append(relat(prevs, i)) | |
prevs.removeAtIndex(0) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#import <objc/runtime.h> | |
#import <Foundation/Foundation.h> | |
@interface Person : NSObject | |
@end | |
@implementation Person | |
@end | |
@interface Person(dynamicProperties) |