[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: purpose of 10486:4e64fbbd5c58
From: |
John W. Eaton |
Subject: |
Re: purpose of 10486:4e64fbbd5c58 |
Date: |
Tue, 6 Apr 2010 12:07:46 -0400 |
On 6-Apr-2010, Jaroslav Hajek wrote:
| I figured out a slightly better solution, that doesn't pollute the
| other functions using index_vector,
What do you mean by "pollute the other functions..."?
| so I reverted the previous change
| and suggest the attached one as a replacement. This time the change is
| done in the interpreter so does not leak to other contexts and is
| controlled by a variable, which is on in the maximum braindamage mode.
Why shouldn't we just allow this by default? I agree that indexing
with non-integer values is sloppy and should not happen without a
warning, but I don't see how allowing it (with a warning) can cause
trouble, so why not allow it by default?
| Note that this still is not quite Matlab compatible (neither is your
| previous change), because Matlab (2007a) allows this:
| a(1.1:4)
| with a warning, yet disallows this:
| i = 1.1:4;
| a(i)
|
| Apparently Matlab treats the ranges differently than we do, hence the
| difference.
OK, that is surprising.
| The behavior seems undocumented and IMHO likely to be
| removed (the warning even says that integers are *required*) in the
| future. I suggest you rethink whether you really want Octave to
| support this nonsense at all.
At least until I understand more clearly why it causes so much
trouble, I think I do want to allow it.
jwe
purpose of 10486:4e64fbbd5c58, John W. Eaton, 2010/04/06