Patches: Browse | Submit New | Admin

[#7684] rdoc: define "duplicate" for uniq and friends

Date:
2007-01-09 00:53
Priority:
3
Submitted By:
Steven Lumos (slumos)
Assigned To:
Eric Hodel (drbrain)
Category:
Documentation, ri, and rdoc
State:
Open
Summary:
rdoc: define "duplicate" for uniq and friends

Detailed description
A colleague was surprised that uniq didn't seem to work for instances of classes he created.

Index: array.c
===================================================================
--- array.c     (revision 11516)
+++ array.c     (working copy)
@@ -2588,6 +2588,8 @@
  *  containing elements common to the two arrays, with no duplicates.
  *
  *     [ 1, 1, 3, 5 ] & [ 1, 2, 3 ]   #=> [ 1, 3 ]
+ *
+ *  (a is a duplicate of b if a.hash == b.hash and a.eql?(b))
  */
 
 
@@ -2621,6 +2623,8 @@
  *
  *     [ "a", "b", "c" ] | [ "c", "d", "a" ]
  *            #=> [ "a", "b", "c", "d" ]
+ *
+ *  (a is a duplicate of b if a.hash == b.hash and a.eql?(b))
  */
 
 static VALUE
@@ -2661,6 +2665,8 @@
  *     a.uniq!   #=> ["a", "b", "c"]
  *     b = [ "a", "b", "c" ]
  *     b.uniq!   #=> nil
+ *
+ *  (a is a duplicate of b if a.hash == b.hash and a.eql?(b))
  */
 
 static VALUE
@@ -2694,6 +2700,8 @@
  *     
  *     a = [ "a", "a", "b", "b", "c" ]
  *     a.uniq   #=> ["a", "b", "c"]
+ *
+ *  (a is a duplicate of b if a.hash == b.hash and a.eql?(b))
  */
 
 static VALUE

Add A Comment: Notepad

Please login


Followup

No Followups Have Been Posted

Attached Files:

Name Description Download
No Files Currently Attached

Changes:

Field Old Value Date By
assigned_tonone2007-06-13 06:28zenspider
summaryrdoc: define "duplicate" for uniq and friends2007-06-13 06:28zenspider
summaryrdoc: define "duplicate" for uniq and friends2007-05-30 04:06zenspider
category_idMisc / Other Standard Library2007-05-30 04:06zenspider
category_idDB / File Formats2007-05-30 03:50zenspider
summaryrdoc: define "duplicate" for uniq and friends2007-05-30 03:50zenspider
artifact_group_idNone2007-05-30 03:41zenspider
summaryrdoc: define "duplicate" for uniq and friends2007-05-30 03:41zenspider