The rules behind the entire MAKExxxx 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 the internal C++ methods can be used directly rather than have to go through the late-bound dynamic method look that would be required for a more general object. There are serious performance implications to opening this up for other types of objects to be provided.
Rick On Thu, Mar 11, 2010 at 2:21 PM, Gil Barmwater <[email protected]> wrote: > 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. And if not, how come? > > Rick McGuire wrote: >> 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 polymorphic substitute. >> >> Rick >> >> On Thu, Mar 11, 2010 at 1:05 PM, Gil Barmwater <[email protected]> >> wrote: >> >>>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 that but I get message "Error 98.913: Unable >>>to convert object "an ITERATOR" to a single-dimensional array value". >>>Is there another check on the class of the object returned by MakeArray >>>or have I done something else wrong? I can post the code if needed. >>>-- >>>Gil Barmwater >>> >>>------------------------------------------------------------------------------ >>>Download Intel® Parallel Studio Eval >>>Try the new software tools for yourself. Speed compiling, find bugs >>>proactively, and fine-tune applications for parallel performance. >>>See why Intel Parallel Studio got high marks during beta. >>>http://p.sf.net/sfu/intel-sw-dev >>>_______________________________________________ >>>Oorexx-devel mailing list >>>[email protected] >>>https://lists.sourceforge.net/lists/listinfo/oorexx-devel >>> >> >> >> ------------------------------------------------------------------------------ >> Download Intel® Parallel Studio Eval >> Try the new software tools for yourself. Speed compiling, find bugs >> proactively, and fine-tune applications for parallel performance. >> See why Intel Parallel Studio got high marks during beta. >> http://p.sf.net/sfu/intel-sw-dev >> _______________________________________________ >> Oorexx-devel mailing list >> [email protected] >> https://lists.sourceforge.net/lists/listinfo/oorexx-devel >> > > -- > Gil Barmwater > > ------------------------------------------------------------------------------ > Download Intel® Parallel Studio Eval > Try the new software tools for yourself. Speed compiling, find bugs > proactively, and fine-tune applications for parallel performance. > See why Intel Parallel Studio got high marks during beta. > http://p.sf.net/sfu/intel-sw-dev > _______________________________________________ > Oorexx-devel mailing list > [email protected] > https://lists.sourceforge.net/lists/listinfo/oorexx-devel > ------------------------------------------------------------------------------ Download Intel® Parallel Studio Eval Try the new software tools for yourself. Speed compiling, find bugs proactively, and fine-tune applications for parallel performance. See why Intel Parallel Studio got high marks during beta. http://p.sf.net/sfu/intel-sw-dev _______________________________________________ Oorexx-devel mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/oorexx-devel
