Skip to content

Instantly share code, notes, and snippets.

(use 'clojure.core.async)
(def output (atom []))
(defn producer [ctrl k]
(go (loop [i 0]
(when-let [c (<! ctrl)]
(>! c [k i])
(>! ctrl c)
(recur (inc i))))))
//
// CPPViewController.m
// Catalog Playlist Playback
//
// Created by Robert Crooks on 10/2/13.
// Copyright (c) 2013 Brightcove. All rights reserved.
//
#import "CPPViewController.h"
//
// CPPViewController.h
// Catalog Playlist Playback
//
// Created by Robert Crooks on 10/9/13.
// Copyright (c) 2013 Brightcove. All rights reserved.
//
#import <UIKit/UIKit.h>
//
// CPUViewController.h
// Cue Point Usage
//
// Created by Robert Crooks on 11/14/13.
// Copyright (c) 2013 Robert Crooks. All rights reserved.
//
#import <UIKit/UIKit.h>
// import the SDK master header
//
// CPUViewController.m
// Cue Point Usage
//
// Created by Robert Crooks on 11/14/13.
// Copyright (c) 2013 Robert Crooks. All rights reserved.
//
#import "CPUViewController.h"
// import the SDK master header and RAC EXTScope header
// 1.
// “Safe” but retain cycle.
[self setCompletionBlock:^{
NSLog(@"1: %@", self->_foo);
}];
// 2.
// Unsafe. Could dereference nil.
__weak BCThing *weakSelf = self;