Skip to content

Instantly share code, notes, and snippets.

View morozkin's full-sized avatar

Denis Morozov morozkin

View GitHub Profile
@morozkin
morozkin / GSoC.md
Last active August 29, 2017 11:50
GSoC 17 Summary
switch "a"..."z" {
case "x":
print("Stranger things")
default:
break
}
if case "x" = "a"..."z" {
print("Stranger things")
}
struct Foo {
let name: String
}
func ~=(pattern: String, value: Foo) -> Bool {
return pattern == value.name
}
let foo = Foo(name: "foo")
@morozkin
morozkin / PatternMatching1.swift
Last active May 8, 2017 19:26
PatternMatching1
switch 5 {
case 0...10:
print("Range contains value")
default:
break
}
if case 0...10 = 5 {
print("Range contains value")
}