Download Firefox: WindowsMac OS X
logo       
Google Custom Search
    AddThis Social Bookmark Button
-->

Hash#merge, with block ...: msg#00033

Subject: Hash#merge, with block ...
With reference to the source code and to Pickaxe2, ri should tell me
that hash merge takes a block...


--- ./hash.c.orig       2004-10-02 04:50:49.000000000 +0100
+++ ./hash.c    2004-11-16 13:48:19.924061000 +0000
@@ -1576,8 +1576,10 @@

 /*
  *  call-seq:
- *     hsh.merge!(other_hash)    => hsh
- *     hsh.update(other_hash)    => hsh
+ *     hsh.merge!(other_hash)                                 => hsh
+ *     hsh.update(other_hash)                                 => hsh
+ *     hsh.merge!(other_hash){|key, oldval, newval| block}    => hsh
+ *     hsh.update(other_hash){|key, oldval, newval| block}    => hsh
  *
  *  Adds the contents of <i>other_hash</i> to <i>hsh</i>, overwriting
  *  entries with duplicate keys with those from <i>other_hash</i>.
@@ -1603,7 +1605,8 @@

 /*
  *  call-seq:
- *     hsh.merge(other_hash) -> a_hash
+ *     hsh.merge(other_hash)                              -> a_hash
+ *     hsh.merge(other_hash){|key, oldval, newval| block} -> a_hash
  *
  *  Returns a new hash containing the contents of <i>other_hash</i> and
  *  the contents of <i>hsh</i>, overwriting entries in <i>hsh</i> with


Or should this go to Ruby-Core..?
        Hugh





<Prev in Thread] Current Thread [Next in Thread>