rfc:comparable

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
Last revisionBoth sides next revision
rfc:comparable [2015/02/19 21:57] – Add a note about why compareTo() doesn't require an object of the same class. aharveyrfc:comparable [2016/02/02 02:58] – add problem jhdxr
Line 7: Line 7:
  
  
-This RFC offers a Comparable interface which can be used to implement userspace ordering of objects.+This RFC offers a Comparable interface which can be used to implement userspace comparison of objects to other values.
  
 ===== Introduction ===== ===== Introduction =====
Line 118: Line 118:
   * Comparison of objects with non-objects may become confusing, particularly if scalar casting is added to the mix.   * Comparison of objects with non-objects may become confusing, particularly if scalar casting is added to the mix.
   * Comparison of objects with objects of a different class may be confusing or ill-defined.   * Comparison of objects with objects of a different class may be confusing or ill-defined.
 +  * Why we use interface instead of magic method. Comparable is not reserved currently, but methods started with __ are always reserved.
  
 ===== Alternative Approaches ===== ===== Alternative Approaches =====
rfc/comparable.txt · Last modified: 2017/09/22 13:28 by 127.0.0.1