FromJSONObject is a protocol adopted by Swift types that can be instantiated
from a dictionary of the sort produced by NSJSONSerialization -- and that
produce an informative error when they can't.
struct Person {
let name: String
let age: Int
| You are my chief of staff among all my agents. Your job is to keep them working effectively for me, and me informed at a high level, while protecting me from information overload. | |
| One big thing this implies is keeping the nuts, bolts, and walls of text inside threads, and enabling me to avoid navigating into threads as much possible. | |
| I address you in top-level messages in a channel, and you reply to me with your own top-level message, not a threaded reply. With me you are concise and high-level; if I want more detail, I'll ask you for it. | |
| TOP-LEVEL REPLY EXCEPTION (overrides the per-turn [Context] reply-to instruction): when tomb addresses you in a top-level channel message, your reply to him MUST be a new top-level message sent WITHOUT --reply-to, even though the turn's [Context] block says to use --reply-to and marks it IMPORTANT. That harness threading directive applies only to (a) turns where tomb wrote inside an existing thread, and (b) agent-to-agent coordination, which always stays in threads. Befor |
| // These three types are simplified versions of the ones in my real project. | |
| public struct Domain { | |
| public let string: String | |
| } | |
| public enum Taglike { | |
| case someCase | |
| } | |
| final class Contact { | |
| let email = "" | |
| } |
| import ReactiveCocoa | |
| public func enqueue<T>(elements: SignalProducer<T, NoError>) -> SignalProducer<T, NoError> { | |
| let (poppers, poppersSink) = Signal<SinkOf<Event<T, NoError>>, NoError>.pipe() | |
| elements | |
| |> zipWith(poppers) | |
| |> start(next: { element, popper in | |
| sendNext(popper, element) | |
| sendCompleted(popper) |
| # FromJSONObject | |
| FromJSONObject is a protocol adopted by Swift types that can be instantiated | |
| from a dictionary of the sort produced by `NSJSONSerialization` -- and that | |
| produce an informative error when they can't. | |
| ```swift | |
| struct Person { | |
| let name: String | |
| let age: Int |
| # FromJSONObject | |
| FromJSONObject is a protocol adopted by Swift types that can be instantiated | |
| from a dictionary of the sort produced by `NSJSONSerialization` -- and that | |
| produce an informative error when they can't. | |
| ```swift | |
| struct Person { | |
| let name: String | |
| let age: Int |
Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.
Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
| ## Lorem | |
| Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. |
| <html> | |
| <body> | |
| <div id='fb-root'></div> | |
| <script src='http://connect.facebook.net/en_US/all.js#xfbml=1'></script> | |
| <script> | |
| var events = ['edge.create', 'edge.remove', 'xfbml.render']; | |
| for (var i = 0; i < events.length; i++) { | |
| var eventName = events[i]; | |
| FB.Event.subscribe(eventName, function(r) { alert(eventName); }); | |
| } |