I've been doing a bit of
clojure lately and I've often found myself looking to convert a custom collection to a
sequence. Unfortunately, several custom collections from libraries that we use don't implement Iterable; therefore, I can't simply use the
seq function to create a seq.
In Java it's common to simply use a for loop and a get method to iterate through custom collections that don't implement Iterable.
for (int i=0; i<fooCollection.size(); i++) {
Foo foo = fooCollection.get(i);
}There are...
Published on April 12, 2010 18:51