Created
January 5, 2022 14:41
-
-
Save fogus/3d2fc07fb408d7c6756c9dbcaa5a143a to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// v is vector testing equiv | |
// obj is RHS operand, potentially infinite seq | |
else if(obj instanceof List) | |
{ | |
Collection ma = (Collection) obj; | |
if(ma instanceof Counted) | |
if(ma.size() != v.count()) | |
return false; | |
Iterator i2 = ma.iterator(); | |
for(Iterator i1 = ((List) v).iterator(); i1.hasNext();) | |
{ | |
if(!Util.equiv(i1.next(), i2.next())) | |
return false; | |
} | |
return !i2.hasNext(); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment