[Oorexx-devel] Do Over Question

2010-03-11 Thread Gil Barmwater
I've been playing with the Do ... Over ... construct, attempting to use it on my own collection object. From the descriptions in the reference manual, it would appear that the collection object needs to implement 1) a MakeArray method, 2) an Items method, and 3) a '[]'method. My code does

Re: [Oorexx-devel] Do Over Question

2010-03-11 Thread Rick McGuire
You're going to have to provide more information on what you're doing. The only method that's required is makeArray, which is responsible for returning a single dimension array containing the elements you wish to iterate over. The value returned *must* be a real array implementation, not a

Re: [Oorexx-devel] Do Over Question

2010-03-11 Thread Gil Barmwater
How is that enforced - *must* be a real array? Is the diagram in Appendix A that shows the array that is returned only conceptual? It implies a ~items and [] method being sent to the array. So an object that implements those two methods, even if not a real array, ought to work in my mind.

Re: [Oorexx-devel] Do Over Question

2010-03-11 Thread Rick McGuire
The rules behind the entire MAKE process is that the value returned must be of the type requested. That is obj~class == .array in the case of makearray. A lot of this is based on the internal engine taking advantage of the fact the returned object is absolutely of the type indicated so that

Re: [Oorexx-devel] Do Over Question

2010-03-11 Thread Rony G. Flatscher
On 12.03.2010 01:42, Gil Barmwater wrote: OK, thanks for the explanation. I understand now why my test code failed. Rick McGuire wrote: The rules behind the entire MAKE process is that the value returned must be of the type requested. That is obj~class == .array in the case of