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

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

[Octave-bug-tracker] [bug #58830] imprecise error message for "size(foo,


From: John W. Eaton
Subject: [Octave-bug-tracker] [bug #58830] imprecise error message for "size(foo, end)"
Date: Thu, 13 Aug 2020 15:51:34 -0400 (EDT)
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Firefox/68.0

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

I'm looking at this problem now.

I think I had "end" return NaN because I thought it could be detected later. 
Maybe there is a better way.

Given and expression like


foo (expr_that_uses_end)


we can look for "foo" in the current stack frame to see whether it is a
variable.  If it is, then we can cache that info somewhere so that when we
evaluate "expr_that_uses_end", we will be able to look up the dimensions so we
will know what value "end" should produce in this context.

If "foo" is not defined as a variable, then it might be a function, but we
have to evaluate "expr_that_uses_end" before we can search for the function
definition because we need the types of the arguments to do proper
dispatching.  So if we encounter "end", it's an error.  I guess the question
is just what the best way is to handle the error so that we can display
meaningful info.  I have some ideas but will need to experiment a bit more.

    _______________________________________________________

Reply to this item at:

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

_______________________________________________
  Message sent via Savannah
  https://savannah.gnu.org/




reply via email to

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