On 2009-Oct-5, at 3:41 pm, Jon Lang wrote:
Concerning that last one: would it be reasonable to have a Discrete
role
that provides a .succ method, and then overload the Range role?
I think a type needs to be Discrete and Ordered for successors to make
sense (e.g. consider a discrete unordere
Jon Lang wrote:
Concerning that last one: would it be reasonable to have a Discrete role
that provides a .succ method, and then overload the Range role? E.g.:
role Range[Ordered ::T] { ... }
role Range[Ordered Discrete ::T] {
...
method iterator ( -> RangeIterator ) { .
Consider a Range role that is parameterized (i.e., "Range of T" is a
perfectly valid thing to do). According to the spec, the definition of
Range depends on the nature of T:
* If the lower bound is Numeric, certain coercion rules are attempted on the
upper bound; otherwise, the two boundaries mus