2010-01-05 21:40:36 -05:00
|
|
|
func: first, second, rest... =>
|
2009-12-31 17:50:12 -05:00
|
|
|
rest.join(' ')
|
|
|
|
|
|
|
|
result: func(1, 2, 3, 4, 5)
|
|
|
|
|
2009-12-31 19:52:13 -05:00
|
|
|
print(result is "3 4 5")
|
|
|
|
|
|
|
|
|
|
|
|
gold: silver: bronze: the_field: null
|
|
|
|
|
2010-01-05 21:40:36 -05:00
|
|
|
medalists: first, second, third, rest... =>
|
2009-12-31 19:52:13 -05:00
|
|
|
gold: first
|
|
|
|
silver: second
|
|
|
|
bronze: third
|
|
|
|
the_field: rest
|
|
|
|
|
|
|
|
contenders: [
|
|
|
|
"Michael Phelps"
|
|
|
|
"Liu Xiang"
|
|
|
|
"Yao Ming"
|
|
|
|
"Allyson Felix"
|
|
|
|
"Shawn Johnson"
|
|
|
|
"Roman Sebrle"
|
|
|
|
"Guo Jingjing"
|
|
|
|
"Tyson Gay"
|
|
|
|
"Asafa Powell"
|
|
|
|
"Usain Bolt"
|
|
|
|
]
|
|
|
|
|
2010-01-05 21:40:36 -05:00
|
|
|
medalists("Mighty Mouse", contenders...)
|
2009-12-31 19:52:13 -05:00
|
|
|
|
|
|
|
print(gold is "Mighty Mouse")
|
|
|
|
print(silver is "Michael Phelps")
|
|
|
|
print(bronze is "Liu Xiang")
|
|
|
|
print(the_field.length is 8)
|