Skip to content

Instantly share code, notes, and snippets.

View el-hoshino's full-sized avatar
🏠
Working from home

Elvis Shi el-hoshino

🏠
Working from home
View GitHub Profile
@takasek
takasek / CodePiece.swift
Last active March 27, 2018 15:44
ポプテピピックが完成したら竹書房を破壊するSwiftコード #CodePiece
import Foundation
enum PopTeamEpic: Int {
case ポ,プ,テピ,ピック
}
struct 蒼井翔太: Sequence, IteratorProtocol {
mutating func next() -> PopTeamEpic? {
return PopTeamEpic(rawValue: Int(arc4random_uniform(4)))
}
}
@lattner
lattner / async_swift_proposal.md
Last active April 21, 2024 09:43 — forked from oleganza/async_swift_proposal.md
Concrete proposal for async semantics in Swift

Async/Await for Swift

Introduction

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.

http://www.wtfpl.net/faq/ の翻訳(非公式)です。 以下の文章には何も保証がありません。

どのように WTFPLを使いますか?

ステップ1. WTFPLの全文をコピー&ペーストもしくはダウンロードし、あなたの成果物と共に配布します。一般的にライセンスファイルの名前は COPYING です。成果物が複数のライセンスを採用している場合は、COPYING.WTFPL というファイル名が一般的です。

ステップ2. あなたの著作権文章に次の文言を追加してください。