Hacker News new | ask | show | jobs
by geoffpado 485 days ago
Because 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, _)`.
1 comments

In other words, the former is syntactic sugar and having just the latter option would suffice
Yes, but I also don't want to have to go around writing Optional<Array<String>> everywhere, so syntactic sugar is fine.