From: raja@... (Raja S.) Date: 2001-10-27T04:53:53+09:00 Subject: [ruby-talk:23505] Re: Issues with white space [was Re: Bruce Eckel's opinion of Ruby] Paul Prescod writes: >"Raja S." wrote: >> >>... Unlike Python, Ruby has some ability to automatically detect when an >> expression is spanning multiple lines: >Well, since you mentioned Python... >Python also automatically detects, but in different situations. >>>> print (8 + >.. 20)/2 >14 >The parens are a very explicit way of saying that an expression is not >over. You are correct. Shortly after posting my earlier note I checked my Python reference and realized the other option in Python. ( line_1 line_2 ) It seems that both Ruby and Python do a syntactic transformation of the above. Python makes it equivalent to: line_1 \ line_2 while Ruby makes it equivalent to line_1 ; line_2 As Pixel also points out, since everything in Ruby is an expression, taking Python's interpretation could be messy. > Ruby's behaviour confuses even Ruby programmers like Johann, SER and > you. The behaviour they expected is precisely the Python behaviour. There have been times I've felt that: The design of Ruby is based on the principle of least surprise. But the catch is that occasionally one may need to know the principles of Ruby in order not to be surprised. ;-) Raja