8 ms·
Something like go, yes. Imo there is benefit to only being able to do things one way, and in swift there are a lot of ways to do everything. A trivial example:
by emoII 2y ago
Something like go, yes. Imo there is benefit to only being able to do things one way, and in swift there are a lot of ways to do everything. A trivial example: why can you bind variables in pattern matches with both case let .some(x) and case .some(let x)?
- geoffpado 2y agoBecause the former works with all associated values in a case, whereas the latter does not. `case let .some(x, y, z)` vs `case .some(let x, let y, let z)`. And the latter exists because you may want some to be immutable and others to be mutable: `case .some(let x, var y, _)`.