Enchancing pattern matching with @vars ... issue #721

This commit is contained in:
Jeremy Ashkenas
2010-10-04 22:10:10 -04:00
parent 8eb283df2c
commit d1bca6364a
7 changed files with 220 additions and 175 deletions

View File

@@ -249,3 +249,14 @@ ok b is 100
eq '\\`', `
"\\\`"
`
# Shorthand objects with property references.
obj =
one: 1
two: 2
func: -> {@one, @two}
result = obj.func()
ok result.one is 1
ok result.two is 2