>> It wouldn't make sense to make Sequence iterable
> 
> You're the first person I get to know who says that sequences are not 
> iterable. ;-)

Well, in fairness, I do think that Lists are Iterable. Just not Sequences.  ;-)

>> That's true, but getSelectedRows() is primarily meant to be a convenience 
>> method. The primary means of obtaining a table view's selection is 
>> getSelectedRanges(). This method returns an instance of 
>> ListSelectionSequence, which could (and probably should) implement Iterable.
> 
> That's ok, it would help in this case. Note that you need to make 
> getSelectedRanges() return ListSelectionSequence instead of Sequence<Span>. 
> And ListSelectionSequence needs to be public. (And, btw., you are making just 
> one more class, which is implementing Sequence directly (but not List), 
> implement Iterable. ;-)
> 
> Please don't forget ListView.getSelectedRanges(), too.
> Uh, and TreeView.getSelectedPaths(). And 
> FileBrowser(Sheet).getSelectedFiles().

Yup, thanks for pointing that out. Would you mind pasting that into a JIRA 
ticket, just so we don't lose track of it?

>> You might suggest that getSelectedRows() return a List. We don't do this 
>> because it might imply that the return value is a "live" collection to which 
>> the caller can listen for updates, which is not the case.
> 
> So you're saying that any list that is not "live" is a sequence and is not 
> iterable?!? That's odd. (Sorry, can't stop :-)

No problem.  :-)  Maybe "live" isn't the best term, but I just mean that it 
fires events when the data changes. List guarantees this, but Sequence does not.

Reply via email to