Hi --

On Sat, 25 Oct 2003, Yukihiro Matsumoto wrote:

> Hi,
>
> In message "Re: Struggling with variable arguments to block"
>     on 03/10/25, Austin Ziegler <austin / halostatue.ca> writes:
>
> |> |You mean Hash#each and Hash::each_pair will behave
> |> |differently after the fix??
> |> Yes.
> |
> |What will Hash#each behave like?
>
> The only notable change will be that hash.each{|*a| p a} will produce
> [[k,v]], not [k,v].  Most code will run without any change.

I confess to confusion about the new arg/param semantics.  For example:

  irb(main):005:0> *a = 1,2
  => [1, 2]
  irb(main):006:0> *a = [1,2]
  => [1, 2]
  irb(main):007:0> *a = [[1,2]]
  => [[[1, 2]]]

The one that doesn't seem to occur at all is [[1,2]] -- but that's
what the new Hash#each will give... but aren't block semantics modeled
on assignment semantics?  (I'm also still puzzled about Proc.new {}
and proc {} being different from each other, but I'll settle for
understanding |*a| for now :-)


David

-- 
David Alan Black
home: dblack / superlink.net
work: blackdav / shu.edu
Web:  http://pirate.shu.edu/~blackdav