Skip to content

Instantly share code, notes, and snippets.

@agoiabel
Created January 15, 2018 09:11
Show Gist options
  • Select an option

  • Save agoiabel/7c996179776779c1b431c154d845c4a4 to your computer and use it in GitHub Desktop.

Select an option

Save agoiabel/7c996179776779c1b431c154d845c4a4 to your computer and use it in GitHub Desktop.
/** associate without labels */
enum Trade {
case Buy(String, amount)
case Sell(String, Int)
}
Trade.Buy("Firstbank PLC", 300)
Trade.Sell("Firstbank PLC", 700)
/** associate with labels */
enum Trade {
case Buy(stock: String, amount: Int)
case Sell(stock: String, amount: Int)
}
Trade.Buy(stock: "Firstbank PLC", amount: 300)
Trade.Sell(stock: "Firstbank PLC", amount: 700)
@agoiabel
Copy link
Copy Markdown
Author

agoiabel commented Apr 27, 2020 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment