mirror of
https://github.com/jashkenas/coffeescript.git
synced 2022-11-09 12:23:24 -05:00
changing switch/case to switch/when -- it's a better word
This commit is contained in:
parent
849f0e4192
commit
8d76f4bd3f
13 changed files with 85 additions and 38 deletions
|
@ -115,10 +115,10 @@ drink(bottle) for bottle, i in ['soda', 'wine', 'lemonade'] if even(i).
|
|||
|
||||
# Switch statements ("else" serves as a default).
|
||||
activity: switch day
|
||||
case "Tuesday" then eat_breakfast()
|
||||
case "Sunday" then go_to_church()
|
||||
case "Saturday" then go_to_the_park()
|
||||
case "Wednesday"
|
||||
when "Tuesday" then eat_breakfast()
|
||||
when "Sunday" then go_to_church()
|
||||
when "Saturday" then go_to_the_park()
|
||||
when "Wednesday"
|
||||
if day is bingo_day
|
||||
go_to_bingo()
|
||||
else
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue