Skip to content

Instantly share code, notes, and snippets.

@agoiabel
Created January 15, 2018 09:11
Show Gist options
  • Save agoiabel/7c996179776779c1b431c154d845c4a4 to your computer and use it in GitHub Desktop.
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)
@iampushpinder
Copy link

HI @agoiabel,

I've forked this example and revised it a bit. How to submit a Pull request to you so you can review it?

Cheers,
Nayyar

@agoiabel
Copy link
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