Path: csiph.com!x330-a1.tempe.blueboxinc.net!usenet.pasdenom.info!weretis.net!feeder4.news.weretis.net!news.musoftware.de!wum.musoftware.de!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail From: Robert Klemme Newsgroups: comp.lang.ruby Subject: Re: parentheses and newlines Date: Fri, 17 Feb 2012 16:33:04 +0100 Lines: 26 Message-ID: <9q7a9gFe09U1@mid.individual.net> References: <139b9140-b002-4300-b43a-38db39cab653@bs8g2000vbb.googlegroups.com> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Trace: individual.net VnvY+VwDVry8dmPxFVc9IggXcIuJz/pGxJBObQDCuxa1h5BFs= Cancel-Lock: sha1:kFmDWqewr0t4Gr46/xNSJ631fyQ= User-Agent: Mozilla/5.0 (X11; Linux i686; rv:9.0) Gecko/20111229 Thunderbird/9.0 In-Reply-To: <139b9140-b002-4300-b43a-38db39cab653@bs8g2000vbb.googlegroups.com> Xref: x330-a1.tempe.blueboxinc.net comp.lang.ruby:6458 On 02/17/2012 03:01 PM, jsnark wrote: > Can anyone explain the following behavior? I would expect both > expressions to fail, but the first unexpectedly succeeds. > > $ irb --version > irb 0.9.6(09/06/30) > $ ruby --version > ruby 1.9.2p136 (2010-12-25) [x86_64-linux] > $ irb > irb(main):001:0> (2 > irb(main):002:1> 3) > => 3 > irb(main):003:0> (2 3) > SyntaxError: (irb):3: syntax error, unexpected tINTEGER, expecting ')' > (2 3) > ^ > from /usr/local/ruby-1.9.2/bin/irb:12:in `
' irb(main):001:0> (2;3) => 3 Line terminator is more than just whitespace. Kind regards robert