octave-bug-tracker
[Top][All Lists]
Advanced

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

[Octave-bug-tracker] [bug #43470] in place operation gives error: index


From: John W. Eaton
Subject: [Octave-bug-tracker] [bug #43470] in place operation gives error: index out of bounds
Date: Tue, 28 Oct 2014 18:05:24 +0000
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Firefox/31.0 Iceweasel/31.0

Follow-up Comment #6, bug #43470 (project octave):

I believe I've fixed the immediate problem with this changeset:

http://hg.savannah.gnu.org/hgweb/octave/rev/a3eead909bf9

There will still be a cryptic error message if the script (or a function)
contains the lines


load x.mat
x +=...


This happens because the script (or function) is parsed completely prior to
evaluation.  At that point, X is not known to be a variable, so the statement
"x +=..." looks like a command so it is transformed to an indexing expression.
 Later when it is evaluated, X is a variable, so the indexing expression
succeeds, but the "+=" argument is transformed to a numeric argument to
perform the indexing and the cryptic message about the index being out of
range is generated.

One "solution" to this problem would be to change Octave so that the parser
generates a "function call" in this instance instead of an "index expression"
(which can be either a function call or a variable index).  Then the message
would be something to the effect of "undefined function 'x'".

    _______________________________________________________

Reply to this item at:

  <http://savannah.gnu.org/bugs/?43470>

_______________________________________________
  Message sent via/by Savannah
  http://savannah.gnu.org/




reply via email to

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