The value-binding pattern

A value-binding pattern binds matched values to variable or constant names. The following example presents the value binding pattern by binding x to 5 and y to 7:

let position = (5, 7) 

switch position {
case let (x, y): print("x:(x), y:(y)")
}
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset