Skip to content

Instantly share code, notes, and snippets.

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)
@puttin
puttin / Person.m
Last active August 29, 2015 14:19 — forked from janodev/Person.m
#import <objc/runtime.h>
#import <Foundation/Foundation.h>
@interface Person : NSObject
@end
@implementation Person
@end
@interface Person(dynamicProperties)