On Jun 11, 2015, at 19:48 , Marco S Hyman <[email protected]> wrote:
>
> switch test {
Roland “maliciously” misused capitalization of types. ‘test’ is actually an
enum type, not a variable of enum type, so this switch statement isn’t valid
either.
The example in the video is this:
> for case .MyEnumCase (let value) in enumValues {
One thing the video doesn’t show is what ‘enumValues’ is. Perhaps it’s
something other than [MyEnum].
What’s odd about ‘for case’ (I think) is that there’s a two-level binding going
on. There’s a retrieval of an element of the sequence (of some enum type), then
there’s the retrieval of the associated value. Perhaps this is sufficiently
complex to implement that it’s not actually done yet.
The following works:
> for case test.two in x {
so the pattern matching itself is implemented. The puzzle is how to correctly
bind the associated value.
_______________________________________________
Cocoa-dev mailing list ([email protected])
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com
This email sent to [email protected]