digitalmars.D - Compare in ParaSail
- bearophile (4/5) Jan 05 2010 Bye,
- Andrei Alexandrescu (3/10) Jan 05 2010 That means no static checking of ordered vs. unordered types.
From: http://parasail-programming-language.blogspot.com/2009/10/using-in-parasail-to-implement-etc.htmlParaSail skirts this issue by requiring the user to define only one operator, "=?", which returns a value from the enumeration Less, Equal, Greater, Unordered. The comparison and equality operators are defined in terms of "=?" [...] "Unordered" is used for types with only a partial ordering (or no ordering at all). "Ordered" is defined as the subtype containing only the values "Equal," "Less," and "Greater." The typical generic "Sort" operation would expect a "=?" operator whose result is guaranteed (via a postcondition) to be within the "Ordered" subtype. The "=?" operator can be used explicitly if desired, which is often convenient when searching a binary tree:<Bye, bearophile
Jan 05 2010
bearophile wrote:From: http://parasail-programming-language.blogspot.com/2009/10/using-in-parasail-to-implement-etc.htmlThat means no static checking of ordered vs. unordered types. AndreiParaSail skirts this issue by requiring the user to define only one operator, "=?", which returns a value from the enumeration Less, Equal, Greater, Unordered. The comparison and equality operators are defined in terms of "=?" [...] "Unordered" is used for types with only a partial ordering (or no ordering at all). "Ordered" is defined as the subtype containing only the values "Equal," "Less," and "Greater." The typical generic "Sort" operation would expect a "=?" operator whose result is guaranteed (via a postcondition) to be within the "Ordered" subtype. The "=?" operator can be used explicitly if desired, which is often convenient when searching a binary tree:<Bye, bearophile
Jan 05 2010