extension Optional { mutating func unwrapped(default: @autoclosure () throws -> Wrapped) rethrows -> Wrapped { if let val = self { return val } self = `default`() return self! } }