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

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

[Octave-bug-tracker] [bug #46136] error messages for stacks of anonymous


From: Olaf Till
Subject: [Octave-bug-tracker] [bug #46136] error messages for stacks of anonymous functions not informative enough
Date: Tue, 06 Oct 2015 10:10:51 +0000
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Firefox/38.0 Iceweasel/38.2.1

URL:
  <http://savannah.gnu.org/bugs/?46136>

                 Summary: error messages for stacks of anonymous functions not
informative enough
                 Project: GNU Octave
            Submitted by: i7tiol
            Submitted on: Tue 06 Oct 2015 10:10:49 AM GMT
                Category: Interpreter
                Severity: 3 - Normal
                Priority: 5 - Normal
              Item Group: None
                  Status: None
             Assigned to: None
         Originator Name: Olaf Till
        Originator Email: 
             Open/Closed: Open
         Discussion Lock: Any
                 Release: dev
        Operating System: GNU/Linux

    _______________________________________________________

Details:

With the attached example functions 'f1.m' and 'f2.m' in the path, I'd expect
something like the following error message for calling 'f1 ();':


error: operator /: nonconformant arguments (op1 is 1x1, op2 is 1x2)
error: called from
    f1>@<anonymous> at line 3 column 20
    f1>@<anonymous> at line 5 column 32
    f1>@<anonymous> at line 9 column 34
    f2>@<anonymous> at line 3 column 26
    f2 at line 5 column 3
    f1 at line 11 column 3


But what I currently get is:


error: operator /: nonconformant arguments (op1 is 1x1, op2 is 1x2)
error: called from
    f1> at line -1 column -1
    f2> at line -1 column -1
    f2 at line 5 column 3
    f1 at line 11 column 3


I.e. the chief point is that line and column information is lacking. (The
reduced number of messages is probably due to the fact that the error function
eats messages which appear to be equal; this will cause no problems anymore if
the line information is present, so that the messages are not equal anymore.)

With the changeset (attached as soon as I have the bug number), the messages
are as shown above as those I'd expect.

Notes to the changeset:

- Matlab prints e.g.

Error in f1>@(x,y)x/y ...

instead of

    f1>@<anonymous> ...

but I don't think this is necessary as long as the line information is present
to allow looking up the function definition in the user code.

- I didn't check for

tree_evaluator::statement_context == tree_evaluator::other

in the calling context, so if both the anonymous function definition and the
anonymous function call are from the command line, always 1 is printed for the
line number, and the column number is correct. But this seems better to me
than printing line=-1 and column=-1 in this case.

- I don't know if it is good or necessary to make a test for this bug.




    _______________________________________________________

File Attachments:


-------------------------------------------------------
Date: Tue 06 Oct 2015 10:10:49 AM GMT  Name: f1.m  Size: 169B   By: i7tiol

<http://savannah.gnu.org/bugs/download.php?file_id=35082>
-------------------------------------------------------
Date: Tue 06 Oct 2015 10:10:49 AM GMT  Name: f2.m  Size: 95B   By: i7tiol

<http://savannah.gnu.org/bugs/download.php?file_id=35083>

    _______________________________________________________

Reply to this item at:

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

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




reply via email to

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