Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.ruby > #6458

Re: parentheses and newlines

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 <shortcutter@googlemail.com>
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> (permalink)
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

Show key headers only | View raw


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 `<main>'

irb(main):001:0> (2;3)
=> 3

Line terminator is more than just whitespace.

Kind regards

	robert

Back to comp.lang.ruby | Previous | NextPrevious in thread | Next in thread | Find similar


Thread

parentheses and newlines jsnark <swr@monmouth.com> - 2012-02-17 06:01 -0800
  Re: parentheses and newlines Robert Klemme <shortcutter@googlemail.com> - 2012-02-17 16:33 +0100
  Re: parentheses and newlines Simon Krahnke <overlord@gmx.li> - 2012-02-18 20:56 +0100

csiph-web