Understand your Mac and iPhone more deeply by tracing the evolution of Mac OS X from prelease to Swift. John Siracusa delivers the details.
You've got two main options:
import Foundation | |
func examine(_ str: String) { | |
print("\"\(str)\"") | |
print("bridges as: \(type(of: str as NSString))") | |
str.withCString { | |
print("inits an NSString as: \(type(of: NSString(cString: $0, encoding: String.Encoding.ascii.rawValue)!))") | |
} | |
print("\n") | |
} |
ACTIVITY_LOG_STDERR | |
AEConvertBookmarksToAliasesHack | |
AEDebugFull | |
AEDebugReceives | |
AEDebugSends | |
ALLOWED_GPU_IDS | |
APPLE_FRAMEWORKS_ROOT | |
ARCH | |
ASL_DISABLE | |
ASL_QUOTA_DISABLED |
// This file is based largely on the Runtime package - https://github.com/wickwirew/Runtime | |
extension KeyPath { | |
var fieldName: String? { | |
guard let offset = MemoryLayout<Root>.offset(of: self) else { | |
return nil | |
} | |
let typePtr = unsafeBitCast(Root.self, to: UnsafeMutableRawPointer.self) | |
let metadata = typePtr.assumingMemoryBound(to: StructMetadata.self) |
class SwiftFormat < Formula | |
desc "Formatting technology for Swift source code" | |
homepage "https://github.com/apple/swift-format" | |
url "https://github.com/apple/swift-format.git", :branch => "swift-5.1-branch" | |
head "https://github.com/apple/swift-format.git" | |
depends_on :xcode => ["11.0", :build] | |
def install | |
system "swift", "build", "--configuration", "release", |
# Thanks to here https://stackoverflow.com/questions/13861658/is-it-possible-to-search-though-all-xcodes-logs | |
EXT=".xcactivitylog" | |
for LOG in *.xcactivitylog; do | |
NAME=`basename $LOG $EXT` | |
gunzip -c -S $EXT "${NAME}${EXT}" > "${NAME}.log" | |
done |
Author: Chris Lattner
Modern Cocoa development involves a lot of asynchronous programming using closures and completion handlers, but these APIs are hard to use. This gets particularly problematic when many asynchronous operations are used, error handling is required, or control flow between asynchronous calls gets complicated. This proposal describes a language extension to make this a lot more natural and less error prone.
This paper introduces a first class Coroutine model to Swift. Functions can opt into to being async, allowing the programmer to compose complex logic involving asynchronous operations, leaving the compiler in charge of producing the necessary closures and state machines to implement that logic.
public protocol Diffable: Hashable { | |
var primaryKeyValue: String { get } | |
} | |
public struct AnyDiffable: Diffable { | |
private let _primaryKeyValue: () -> String | |
git remote add upstream https://github.com/whoever/whatever.git
git fetch upstream