Avatar
Avatar
Iceman
@swift-6.0.3 func ~= (_ lhs: (Int) -> Bool, rhs: Int) -> Bool { lhs(rhs) } func isEven(_ v: Int) -> Bool { v.isMultiple(of: 2) } let v: Int = 2 switch v { case isEven: print("Even") default: print("Odd") }
Even