Odd assignments

Hi
a,*b,c = 3
Why is now c=3 ???
Is that a bug?!
Is this only in my case?

Thx Berg

Hi,

with which Ruby version are you running this snippet?

I tried it with versions 1.9.3, 2.0.0 and 2.3.0 C-Ruby and JRuby 9.01.0 in
the irb, and I get the following for all of them:

$ a, *b, c = 3
$ a
$ => 3
$ b
$ =>
$ c
$ => nil

- Paul

···

2016-07-27 14:10 GMT+02:00 A Berger <aberger7890@gmail.com>:

Hi
a,*b,c = 3
Why is now c=3 ???
Is that a bug?!
Is this only in my case?

Thx Berg

Unsubscribe: <mailto:ruby-talk-request@ruby-lang.org?subject=unsubscribe>
<http://lists.ruby-lang.org/cgi-bin/mailman/options/ruby-talk&gt;

Hi
Thats nice to hear,
I'm on Ruboto-irb
- perhaps it could be corrected there.

Thx Berg

you could use

a, (*b), c = 3

I tested it with jruby-1.7.19 and get the "standard" behaviour nil = c

···

On 07/27/2016 02:48 PM, A Berger wrote:

Hi
Thats nice to hear,
I'm on Ruboto-irb
- perhaps it could be corrected there.