Re: matrix and unique index

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view

Re: matrix and unique index

John W. Eaton-6
On  7-Jan-2003, in response to a question posted to the help-octave
mailing list about how to make Octave allow a single index for a
matrix, other than the special x(:) form, Paul Kienzle
<[hidden email]> wrote:

| Either:
|     octave --traditional
| OR
|     octave
|     octave:1> do_fortran_indexing = 1;

Does anyone have a strong opinion *against* making this the default,
and changing do_fortran_indexing from a preference to a warning
option, so that you would specify

  warn_single_index = true

(or similar) if you wanted to be warned about indexing arrays with 2
or more dimensions with a single index (other than the special x(:)
style index)?  The default for this warning would also be false.  But
in any case, it would only be a warning, not something that would
cause a program to fail.

I think in most cases, people expect the Matlab-compatible behavior,
and probably all settings of do_fortran_indexing are there to enable
the feature, not set it to 0.  So we could eliminate some of those
things in Octave scripts and probably get rid of some unwind_protect
blocks in the process.