Skip to content

Instantly share code, notes, and snippets.

🏠
Working from home

omochimetaru omochi

🏠
Working from home
  • japan
  • tokyo
Block or report user

Report or block omochi

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View ort-specializer-only-same-module.swift
// a.swift
public protocol P {
func f() -> Int
}
public struct PublicStruct : P {
public func f() -> Int {
return 11
}
View swift-constexpr.md

slidenumber: true autoscale: true

Swiftのコンパイル時計算

わいわいswiftc #12

omochimetaru


コンパイル時計算

View force-cast-to-self.swift
protocol CopyInitializable {}
extension CopyInitializable {
init(copy: Self) { self = copy }
}
class Animal : CopyInitializable {
init() {}
convenience init(a: Int) {
let copy = Animal()
View optional-ensure.swift
extension Optional {
public mutating func ensure(_ f: () throws -> Wrapped) rethrows -> Wrapped {
if let x = self {
return x
}
let x = try f()
self = x
return x
}
View wwdc-websocket.md

slidenumber: true autoscale: true

iOS13とmacOS CatalinaのWebSocketサポート

参加してなくてもついていけるもん!

WWDCゴリゴリキャッチアップ会 2019

@omochimetaru


View wwswc-ort-impl.md

slidenumber: true autoscale: true

Opaque Result Typeの実装

omochimetaru

わいわいswiftc #11


疑問

View wwswc-ort-desc.md

slidenumber: true autoscale: true

Opaque Result Typeの解説

omochimetaru

わいわいswiftc #11


5秒なら

View wwswc-abi.md

slidenumber: true autoscale: true

ABI安定化とLibrary Evolution

omochimetaru

わいわいswiftc #11


Swift5といえば

View struct-in-let-is-meaningless.swift
// HogeLib.framework
public struct S {
public let a: Int
public let b: Int
}
// YourApp
extension S {
View NoErrorExtension3.swift
protocol Stream {
associatedtype ErrorType: Error
func read() -> Result<Int, ErrorType>
}
class FileStream : Stream {
// 固有のエラー型
enum Error : Swift.Error {
case ioError
case fileNotFound
You can’t perform that action at this time.