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
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
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.
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
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