2010-01-16 16:37:49 -05:00
|
|
|
# CoffeeScript's operations should be chainable, like Python's.
|
|
|
|
|
2010-01-29 23:30:54 -05:00
|
|
|
puts 500 > 50 > 5 > -5
|
2010-01-16 16:37:49 -05:00
|
|
|
|
2010-01-29 23:30:54 -05:00
|
|
|
puts true is not false is true is not false
|
2010-01-16 16:37:49 -05:00
|
|
|
|
2010-01-29 23:30:54 -05:00
|
|
|
puts 10 < 20 > 10
|
2010-01-16 16:37:49 -05:00
|
|
|
|
2010-01-29 23:30:54 -05:00
|
|
|
puts 50 > 10 > 5 is parseInt('5', 10)
|
2010-01-16 22:04:08 -05:00
|
|
|
|
|
|
|
|
|
|
|
# Make sure that each argument is only evaluated once, even if used
|
|
|
|
# more than once.
|
|
|
|
|
|
|
|
i: 0
|
2010-01-26 10:52:05 -05:00
|
|
|
func: -> i++
|
2010-01-16 22:04:08 -05:00
|
|
|
|
2010-01-29 23:30:54 -05:00
|
|
|
puts 1 > func() < 1
|