[Oorexx-devel] Do Over Question
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#174; 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 Oorexx-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/oorexx-devel
Re: [Oorexx-devel] Do Over Question
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 gbarmwa...@alum.rpi.edu 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#174; 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 Oorexx-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/oorexx-devel -- Download Intel#174; 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 Oorexx-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/oorexx-devel
Re: [Oorexx-devel] Do Over Question
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 gbarmwa...@alum.rpi.edu 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#174; 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 Oorexx-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/oorexx-devel -- Download Intel#174; 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 Oorexx-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/oorexx-devel -- Gil Barmwater -- Download Intel#174; 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 Oorexx-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/oorexx-devel
Re: [Oorexx-devel] Do Over Question
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 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 gbarmwa...@alum.rpi.edu 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 gbarmwa...@alum.rpi.edu 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#174; 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 Oorexx-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/oorexx-devel -- Download Intel#174; 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 Oorexx-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/oorexx-devel -- Gil Barmwater -- Download Intel#174; 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 Oorexx-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/oorexx-devel -- Download Intel#174; 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 Oorexx-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/oorexx-devel
Re: [Oorexx-devel] Do Over Question
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 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. This imposes the knowledge of interpreter implementation details on to the shoulders of the ooRexx programmers. A solution that would make this aspect orthogonal would be: * define the methods/interfaces for an array/list (like at, [], items, put, []=), * if makeArray returns an instance of the built-in class .array use the optimized C++ execution path, else use the non-optimized path sending the appropriate messages. This would eradicate the astonishment factor and the programmer would be free to take full advantage of the polymorphicness/OO (where each subclass is always of the type of the specialized class). ---rony -- Download Intel#174; 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 Oorexx-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/oorexx-devel