On May 17, 2006, at 9:20 AM, Dan Stenning wrote:
Oh no it doesn't!
Sure it does, but not for the specific use you want.
Can you use for each on an RB class representing a list, collection
or array ??
No but that's NOT because I cannot make a class that does not behave
like an array. It's because FOR EACH does NOT take things that
implement an interface or an iterator. If FOR EACH took such a class
that implemented an interface then we'd already have this. Or if it
took an iterator.
But RB Arrays are not classes so they don't implement interfaces.
Note I asked for iterators a year ago specifically for this usage
http://www.realsoftware.com/feedback/viewreport.php?reportid=xvxukqjb
Only if you expose the internal RB array - an OOP no no... :)
Only if you MUST use for each which is wired into the guts of Arrays
and dictionaries and nothing else (not very OOP)
If RB had iterators and FOR EACH used one of those this would not be
an issue.
Any class could implement the required methods, you could get an
iterator, and use FOR EACH.
_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>
Search the archives of this list here:
<http://support.realsoftware.com/listarchives/lists.html>