On Oct 23, 2006, at 2:57 AM, Jay Rimalrick wrote:
I am trying to make an iterator class. My plan is to make a new class with an "array" as the super class and then add some new "iterator" methods like java has. However, I can't seem to get an array as the super class. When I type array in the super class text box it disappears and there is not an array option to choose from the drop down box. RB is obviously telling me that I can't use an array as a super class, however what can I do to reach my iterator ends? I thought about making a new class with all of the array methods simply "wrapped" in methods with exactly the same name and then adding the iterator methods, however this plan seems like a crude hack.
Not at all; in fact I think that this is the better way to do it. But you should distinguish between cases here. Writing an iterator that assumes the array does not change during the life of the iterator is quite simple. Writing a so-called robust iterator that allows the underlying structure to be modified during iteration is considerably harder.
Charles Yeomans _______________________________________________ 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>
