If we’re talking about non optional values here, then I don’t produce a
possible expensive copy of my associated values (sure it depends on the type,
COW etc.), but that’s my main point for excluding the the associated values.
Somewhere in my code I also have a semi schema subscript which evaluates the
enum case like this:
if case .double = $0 { return true } else { return false }
There is just no better way for this check. I wish I could write something like
return .double ~= $0 there.
--
Adrian Zubarev
Sent with Airmail
Am 29. November 2016 um 17:19:16, Tony Allevato ([email protected]) schrieb:
I suppose I'm not seeing why it's important to exclude the associated values
from pattern matching. What do you gain except saving a few characters?
_______________________________________________
swift-evolution mailing list
[email protected]
https://lists.swift.org/mailman/listinfo/swift-evolution