- About Scala
- Documentation
- Code Examples
- Software
- Scala Developers
sizeCompare, minSize, or whatever
Tue, 2010-01-12, 15:20
It looks like this:
https://lampsvn.epfl.ch/trac/scala/ticket/2865
was caused by this line in Zipped:
def length = self.length min other.size
the latter size blithely trying to see how far infinity goes. I
replaced this like so:
def length =
if (other.hasDefiniteSize) self.length min other.size
else other take self.length size
but I quite suspect more locations require treatment.
I see we have a "lengthCompare" method on Seq-derived classes, but as
size is a Traversable method, and zip* methods are on Iterable, I need
something higher in the hierarchy to calculate the smaller size of two
collections in a way which will terminate if either is finite. Any
nominations?