octave-maintainers
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: How to use the OO features of Octave


From: John W. Eaton
Subject: Re: How to use the OO features of Octave
Date: Tue, 23 Sep 2008 17:14:42 -0400

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.

jwe


reply via email to

[Prev in Thread] Current Thread [Next in Thread]