[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

Re: Struggling with variable arguments to block

Austin Ziegler

10/24/2003 3:52:00 PM

On Sat, 25 Oct 2003 00:03:32 +0900, Yukihiro Matsumoto wrote:
> |You mean Hash#each and Hash::each_pair will behave
> |differently after the fix??
> Yes.

What will Hash#each behave like?

I've got a lot of code that simply uses Hash#each expecting:

hash.each { |k, v| ... }

Will Hash#each behave like Hash#each_key ? Or will it be something different
altogether?

-austin
--
austin ziegler * austin@halostatue.ca * Toronto, ON, Canada
software designer * pragmatic programmer * 2003.10.24
* 11.48.16



1 Answer

matz

10/24/2003 4:05:00 PM

0

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.

matz.