cash = 100_000.00
sum = 0
cash += 1.00, sum while cash < 1_000_000.00 # underscores ignored
I found the above example in a book "Learning Ruby" but using Ruby 1.9 it doesn't compile ("interpret"?)
syntax error, unexpected ',', expecting $end
What's the comma supposed to be doing after 1.00?
Here's the full context of the example:
#Also, like if, you can use while as a statement modifier, at the end of a statement:
cash = 100_000.00
sum = 0
cash += 1.00, sum while cash < 1_000_000.00 # underscores ignored
#So cash just keeps adding up until it equals $1,000,000.00. I like that!