This page is no longer maintained — Please continue to the home page at www.scala-lang.org

a word of explanation on r20607

No replies
extempore
Joined: 2008-12-17,
User offline. Last seen 35 weeks 3 days ago.

I picked through every use of .zipped.forall in trunk and to my eye,
every single one of them should in principle include a length check.
About half of them actually had one. It's likely that in most or all
cases, an explicit length check would be redundant because something
somewhere would already have caught mismatched lists: but given the
implementation of corresponds, it can only be beneficial to have the
length check in place (for intention-documentation if nothing else.)

To be extra careful, I did a build where I logged it if corresponds
would ever give a different answer than zipped.forall. This happened
zero times, so I think it is all safe. To make it easy to review the
spots where the length check was introduced, I commented them:

// @PP: corresponds

with the intention of deleting all those after you've had a chance to
confirm it's all cool.

Copyright © 2012 École Polytechnique Fédérale de Lausanne (EPFL), Lausanne, Switzerland