[#30722] JSON ライブラリの取り込み — "NARUSE, Yui" <naruse@...>

naruseです。

20 messages 2007/04/21

[ruby-dev:30729] Re: Ruby 1.9: multiple splats on rvalues in parallel assignment

From: SASADA Koichi <ko1@...>
Date: 2007-04-26 07:51:10 UTC
List: ruby-dev #30729
 ささだです.

 以下の件,初めて見るんですが,詳しい仕様ってどうなってます?

1. multiple splats を「どこで許す」んでしょうか.多重代入だけ?
  splat が書ける,どんなところでも?
2. コンパイルは,「*a, b, *c」 -> 「*(a.splat + [b] + c.splat)」でいいん
でしょうか.
3. どういう構文木になるんでしょうか


Yukihiro Matsumoto wrote:
> Hi,
> 
> In message "Re: Ruby 1.9: multiple splats on rvalues in parallel assignment"
>     on Thu, 26 Apr 2007 03:07:09 +0900, David Flanagan <david@davidflanagan.com> writes:
> |
> |I've confirmed this bug against the current trunk:
> |
> |ruby1.9 -ve 'x,y,z=1,*[2],*[3]; p x,y,z'
> |ruby 1.9.0 (2007-04-25 patchlevel 0) [i686-linux]
> |[1]
> |3
> |nil
> |
> |My question (for Matz or Nobu?) is about the nature of the bug.  In 1.8, 
> |this code would be a syntax error, because multiple splats are not 
> |allowed on the right-hand side of a parallel assignment.  Has this 
> |changed in Ruby 1.9?  Is it supposed to be legal to have multiple 
> |splats?  Is the parser allowing something that it shouldn't?  Or is the 
> |VM mis-interpreting valid new syntax?
> 
> Ruby 1.9 will allow multiple splats in the (argument) list.
> Unfortunately, YARV does not support it yet.
> 
> 							matz.
> 


-- 
// SASADA Koichi at atdot dot net
// 4. 知らなかったのは私が忘れていただけ?

In This Thread

Prev Next