Saturday, December 31, 2005

Ruby: Can a ruby statement break into multiple lines?

Yes,
A statement break into mutliple lines if it is not complete,
i.e. "if the last token on a line is an operator or comma".
But you can also use \ as the last character on the line, to
continue on the next line.
a = 2 +
3

a = 2 + 3

are both equivalent to a=2+3

1 comment: