ARM Blocks: ease of use and for loops
Reinier Zwitserloot
reinier at zwitserloot.com
Wed Nov 11 13:21:04 PST 2009
Unless all existing filters are rewritten to support Closeable, and their
close methods do an instanceof check on the contained Iterator and pass on
the close call if they are also ClosableIterators, I don't see how that's
going to work. That design is not backwards compatible, and forgetting to
create this passthrough closeable principle is going to lead to very nasty
surprises when you take existing code:
for (SomeType x : someClosableThingie) {
}
and later wrap the someClosableThingie into an iterator which does not have
this explicit pass-through mechanism in it. I can easily imagine that
happening in day to day java development. May not be a show-stopper, but
it's an issue worth thinking about. Or did you have a different mechanism in
mind for preserving the closable nature of the iterator?
--Reinier Zwitserloot
On Wed, Nov 11, 2009 at 10:17 PM, Neal Gafter <neal at gafter.com> wrote:
> On Wed, Nov 11, 2009 at 1:13 PM, Reinier Zwitserloot <
> reinier at zwitserloot.com> wrote:
>
>> The concept of having a CloseableIterator does not survive filtering.
>> This is bad.
>>
>
> There's no reason for it to not survive filtering.
>
More information about the coin-dev
mailing list