On 23-Sep-2008, David Bateman wrote:
| David Bateman wrote:
| > John W. Eaton wrote:
| > >
| > > args(2) = num_indices;
| > > args(1) = index_position;
| > > args(0) = *indexed_object;
| >
| >
| > shouldn't args(1) be
| >
| > args(1) = index_position + 1;
| >
| > due to the 1-based indexing of Octave?
Yes, I've fixed this now. Thanks.
| Also shouldn't we subtract one from the return value of the feval call?
I don't think so, because the result is not used directly in C++, but
it replaces the value in the expression where the "end" keyword
appears. So in your example, for a(2:end) and a(2:4) to be
equivalent, the value returned from the __end__ function must be 4
(== numel(obj.x), I think), not 3.