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: Wed, 9 Sep 2020 11:15:06 -0400 (EDT)
User-agent: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:80.0) Gecko/20100101 Firefox/80.0

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

This solves the example in comment #0, but there is still an issue when
evaluating an expression like:


object.data(func(expression_with_end))


For example, consider the following class (a modified version of the example
class for bug #50716:


classdef myclass < handle

  properties
    data
  endproperties

  methods
  
    function obj = myclass(data)
      obj.data = data;
    endfunction

    function r = methodA (obj, val)
      r = val;
    endfunction

  endmethods

endclassdef


and execute the following sentences:


octave:1> obj=myclass(1:10)
obj =
  myclass object with properties:
      data: [1x10 double]
octave:2> obj.data(minus(end,1))
error: obj(0): subscripts must be either integers 1 to (2^63)-1 or logicals


The problem seems to be that "minus(end,1)" is evaluated before evaluating
"obj.data", but should be evaluated after it in order to get the correct value
for "end".

    _______________________________________________________

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]