IMO interesting idea.. We have ad hoc structs as tuples and it seems like
ad-hoc enums also could be helpful when we don't need a separate class for
using in limited scope.
I also can see advantage to use such anonymous enum type in code:
var codePath : (.one | .two | .three) = .one
...
switch codePath {
case .one : ...
case .two : ...
case .three : ...
}
IMO very clean and expressive code and I like the proposed syntax.
So I'd like to have such in Swift
On 31.05.2016 19:16, Erica Sadun via swift-evolution wrote:
func scaleAndCropImage(
image: UIImage,
toSize size: CGSize,
*operation: (.Fit | .Fill) = .Fit*
) -> UIImage {
_______________________________________________
swift-evolution mailing list
[email protected]
https://lists.swift.org/mailman/listinfo/swift-evolution