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 Cocoa | |
enum CoroutineState { | |
case Fresh, Running, Blocked, Canceled, Done | |
} | |
struct CoroutineCancellation: ErrorType {} | |
class CoroutineImpl<InputType, YieldType> { | |
let body: (yield: YieldType throws -> InputType) throws -> Void |
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
protocol Copyable: class { | |
init(copy: Self) | |
} | |
// | |
// this is a 'diffing' constructor, in your callback modify properties of $0 as needed | |
// | |
func _copy<T:Copyable, U>(obj: T, @noescape fun: inout T -> ()) -> U { |
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
infix operator ??= { | |
associativity right | |
precedence 90 | |
assignment | |
} | |
func ??=<T>(inout optional: T?, @autoclosure defaultValue: () -> T?) { | |
optional = optional ?? defaultValue() | |
} |
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 Foundation | |
func copy<T: AnyObject>(obj: T) -> T { | |
let ptr = UnsafeMutablePointer<T>.alloc(1) | |
ptr.initialize(obj) | |
return ptr.memory | |
} | |
class C: NonObjectiveCBase { |
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 Foundation | |
struct Test { | |
var value: Int = 0 | |
var f: (Int, Int) -> Int { | |
mutating get { | |
var this = self | |
print("in getter value: \(this.value)") |
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
% swiftc -Xllvm -help-hidden /tmp/foo.swift | |
USAGE: swift (LLVM option parsing) [options] | |
OPTIONS: | |
-a9-754319-workaround - Enable workarounds for A9 HW bugs #754319 | |
-a9-754320-workaround - Enable workarounds for A9 HW bugs #754320 | |
-aarch64-use-tbi - Assume that top byte of an address is ignored | |
-agg-antidep-debugdiv=<int> - Debug control for aggressive anti-dep breaker | |
-agg-antidep-debugmod=<int> - Debug control for aggressive anti-dep breaker | |
-aggressive-ext-opt - Aggressive extension optimization |
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
ACTION = build | |
AD_HOC_CODE_SIGNING_ALLOWED = NO | |
ALTERNATE_GROUP = staff | |
ALTERNATE_MODE = u+w,go-w,a+rX | |
ALTERNATE_OWNER = grantdavis | |
ALWAYS_SEARCH_USER_PATHS = NO | |
ALWAYS_USE_SEPARATE_HEADERMAPS = YES | |
APPLE_INTERNAL_DEVELOPER_DIR = /AppleInternal/Developer | |
APPLE_INTERNAL_DIR = /AppleInternal | |
APPLE_INTERNAL_DOCUMENTATION_DIR = /AppleInternal/Documentation |
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
comma script import ~/lldb/subl.py | |
comma script add -f subl.subl subl |
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 <Foundation/Foundation.h> | |
void loadFScript() { | |
[[[NSBundle bundleWithPath:@"/Library/Frameworks/FScript.framework"] classNamed:@"FScriptMenuItem"] performSelector:@selector(insertInMainMenu)]; | |
} | |
template<typename T> | |
inline | |
NSValue* NSValueFromStruct(T *object) | |
{ |
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 <Foundation/Foundation.h> | |
template<typename T> | |
inline | |
NSValue* NSValueFromStruct(T *object) | |
{ | |
return [NSValue value:object withObjCType:@encode(T)]; | |
} | |
template<typename T> |