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

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

[Octave-bug-tracker] [bug #58953] Error with 'end' in index expression w


From: Fernando
Subject: [Octave-bug-tracker] [bug #58953] Error with 'end' in index expression with nested function calls
Date: Sat, 15 Aug 2020 13:08:59 -0400 (EDT)
User-agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:79.0) Gecko/20100101 Firefox/79.0

Follow-up Comment #7, bug #58953 (project octave):

I found the stackoverflow thread very interesting. Thank you for the link. The
funny part is that I thought that expressions like x(min(2,end)) were
incorrect, until the other day I found they are used in one of the scripts in
the Octave source code repository:


./scripts/miscellaneous/parseparams.m:111:  fname = stack(min (2, end)).name;


I was experimenting with one of the bugs and I made a modification that caused
that end expression to fail. After the surprise, I thought it was a reasonable
behaviour. As one of the comments of the stackexchange thread puts it: "when
end occurs, I would assume it evaluates to an index (or dimension subscript)
for the array with the most immediate scope, looking "up" through nested
statements to make the determination."

In any case, since it is not a documented behaviour, I think it would be
better to avoid that kind of 'end' expressions in the scripts of the Octave
repository.


    _______________________________________________________

Reply to this item at:

  <https://savannah.gnu.org/bugs/?58953>

_______________________________________________
  Mensaje enviado vía Savannah
  https://savannah.gnu.org/




reply via email to

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