in playground shouldn't "hearts" be printed

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
G G
Reply | Threaded
Open this post in threaded view
|

in playground shouldn't "hearts" be printed

G G


enum Suit {


   case Spades, Hearts, Diamonds, Clubs

   

   func simpleDescription() -> String {

   

      switch self {

      

      case .Spades:

      

         return "spades"

         

      case .Hearts:

      

         return "hearts"

         

      case .Diamonds:

      

         return "diamonds"

         

      case .Clubs:

      

         return "clubs"

      }

   }

}


let hearts = Suits.Hearts


let heartsDescription = hearts.simpleDescription()


println(heartsDescription)


--
You received this message because you are subscribed to the Google Groups "Swift Language" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/swift-language/726667fa-89eb-4c81-bb4a-422ad04d2b9a%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: in playground shouldn't "hearts" be printed

Adam Sharp
Should it be "Suit.Hearts" instead of "Suits.Hearts"?

What result you actually seeing?


–Adam

On 14 Jun 2015 7:44 PM +1000, G G <[hidden email]>, wrote:


enum Suit {


   case Spades, Hearts, Diamonds, Clubs

   

   func simpleDescription() -> String {

   

      switch self {

      

      case .Spades:

      

         return "spades"

         

      case .Hearts:

      

         return "hearts"

         

      case .Diamonds:

      

         return "diamonds"

         

      case .Clubs:

      

         return "clubs"

      }

   }

}


let hearts = Suits.Hearts


let heartsDescription = hearts.simpleDescription()


println(heartsDescription)


--
You received this message because you are subscribed to the Google Groups "Swift Language" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/swift-language/726667fa-89eb-4c81-bb4a-422ad04d2b9a%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "Swift Language" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/swift-language/ceeaeda1-fd1f-4802-aa9e-10e45d999720%40Adams-iPhone.
For more options, visit https://groups.google.com/d/optout.
G G
Reply | Threaded
Open this post in threaded view
|

Re: in playground shouldn't "hearts" be printed

G G
Ah. ok

it showed nothing. it didn't indicate a problem

On Sunday, June 14, 2015 at 6:23:10 AM UTC-4, Adam Sharp wrote:
Should it be "Suit.Hearts" instead of "Suits.Hearts"?

What result you actually seeing?


–Adam

On 14 Jun 2015 7:44 PM +1000, G G <<a href="javascript:" target="_blank" gdf-obfuscated-mailto="H744HIp6fRwJ" rel="nofollow" onmousedown="this.href='javascript:';return true;" onclick="this.href='javascript:';return true;">gdo...@...>, wrote:


enum Suit {


   case Spades, Hearts, Diamonds, Clubs

   

   func simpleDescription() -> String {

   

      switch self {

      

      case .Spades:

      

         return "spades"

         

      case .Hearts:

      

         return "hearts"

         

      case .Diamonds:

      

         return "diamonds"

         

      case .Clubs:

      

         return "clubs"

      }

   }

}


let hearts = Suits.Hearts


let heartsDescription = hearts.simpleDescription()


println(heartsDescription)


--
You received this message because you are subscribed to the Google Groups "Swift Language" group.
To unsubscribe from this group and stop receiving emails from it, send an email to <a href="javascript:" target="_blank" gdf-obfuscated-mailto="H744HIp6fRwJ" rel="nofollow" onmousedown="this.href='javascript:';return true;" onclick="this.href='javascript:';return true;">swift-languag...@googlegroups.com.
To post to this group, send email to <a href="javascript:" target="_blank" gdf-obfuscated-mailto="H744HIp6fRwJ" rel="nofollow" onmousedown="this.href='javascript:';return true;" onclick="this.href='javascript:';return true;">swift-l...@googlegroups.com.
To view this discussion on the web visit <a href="https://groups.google.com/d/msgid/swift-language/726667fa-89eb-4c81-bb4a-422ad04d2b9a%40googlegroups.com?utm_medium=email&amp;utm_source=footer" target="_blank" rel="nofollow" onmousedown="this.href='https://groups.google.com/d/msgid/swift-language/726667fa-89eb-4c81-bb4a-422ad04d2b9a%40googlegroups.com?utm_medium\75email\46utm_source\75footer';return true;" onclick="this.href='https://groups.google.com/d/msgid/swift-language/726667fa-89eb-4c81-bb4a-422ad04d2b9a%40googlegroups.com?utm_medium\75email\46utm_source\75footer';return true;">https://groups.google.com/d/msgid/swift-language/726667fa-89eb-4c81-bb4a-422ad04d2b9a%40googlegroups.com.
For more options, visit <a href="https://groups.google.com/d/optout" target="_blank" rel="nofollow" onmousedown="this.href='https://groups.google.com/d/optout';return true;" onclick="this.href='https://groups.google.com/d/optout';return true;">https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "Swift Language" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/swift-language/b5b41c57-53d0-4b47-9e2d-264c2d86c64f%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.