bugGNU Octave - Bugs: bug #46136, error messages for stacks of...

 
 

bug #46136: error messages for stacks of anonymous functions not informative enough

Submitted by:  Olaf Till <i7tiol>
Submitted on:  Tue 06 Oct 2015 10:10:49 AM UTC  
 
Category: InterpreterSeverity: 3 - Normal
Priority: 5 - NormalItem Group: None
Status: FixedAssigned to: Lachlan Andrew <lachlan>
Originator Name: Olaf TillOpen/Closed: Closed
Release: devOperating System: GNU/Linux

Add a New Comment(Rich Markup)
   

You are not logged in

Please log in, so followups can be emailed to you.

 

Wed 10 Aug 2016 04:08:53 PM UTC, comment #4:

I applied the refreshed patch here (http://hg.savannah.gnu.org/hgweb/octave/rev/dbf7fd79e391). Fixed, closing report.

Rik <rik5>
Project Administrator
Tue 09 Aug 2016 02:37:42 PM UTC, comment #3:

I've uploaded the refreshed original patch.

What regards the addition of printing the anonymous function definition, I didn't leave it out because it was too difficult for me to implement, but because I thought leaving it out is better. I would have added it if a discussion of this would have come to a different end. If you really want to add it yourself, I'd think the correct way is to first apply the original patch and afterwards make a change with a patch of yourself. I don't think it's correct to make a patch of yourself by changing the original patch.

(file #38156)

Olaf Till <i7tiol>
Project Member
Mon 08 Aug 2016 11:59:11 PM UTC, comment #2:

@Lachlan: Can you update Olaf's patch? It no longer applies cleanly to the tip.

Why is a header file removed with a comment rather than leaving in or just deleting the line entirely?

Rik <rik5>
Project Administrator
Mon 04 Jul 2016 12:33:21 PM UTC, comment #1:

Olaf's patch still applies.

The attached patch displays the text of the anonymous function, like Matlab does. In general, I like giving users as much information as possible, as explicitly as possible.

(file #37703)

Lachlan Andrew <lachlan>
Project MemberIn charge of this item.
Tue 06 Oct 2015 10:10:49 AM UTC, original submission:

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 ();':

But what I currently get is:

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.
instead of
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
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.

Olaf Till <i7tiol>
Project Member

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach File(s):
   
   
Comment:
   

Attached Files
file #38156:  anon-func-error-stack-2.cset added by i7tiol (2KiB - application/octet-stream)
file #35084:  anon-func-error-stack.cset added by i7tiol (2KiB - application/octet-stream)
file #35082:  f1.m added by i7tiol (169B - text/x-objcsrc)
file #35083:  f2.m added by i7tiol (95B - text/x-objcsrc)

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -unavailable- added by rik5 (Posted a comment)
  • -unavailable- added by lachlan (Updated the item)
  • -unavailable- added by mtmiller (Updated the item)
  • -unavailable- added by i7tiol (Submitted the item)
  •  

    Do you think this task is very important?
    If so, you can click here to add your encouragement to it.
    This task has 0 encouragements so far.

    Only project members can vote.

     

    Please enter the title of George Orwell's famous dystopian book (it's a date):

     

     

    Follow 9 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Wed 10 Aug 2016 04:08:53 PM UTCrik5StatusPatch Submitted=>Fixed
      Open/ClosedOpen=>Closed
    Tue 09 Aug 2016 02:37:42 PM UTCi7tiolAttached File-=>Added anon-func-error-stack-2.cset, #38156
    Mon 04 Jul 2016 12:33:21 PM UTClachlanAssigned toNone=>lachlan
    Mon 04 Jul 2016 12:33:20 PM UTClachlanAttached File-=>Added bug_46136_anon_func_error_stack.cset, #37703
    Thu 08 Oct 2015 01:31:18 AM UTCmtmillerStatusNone=>Patch Submitted
    Tue 06 Oct 2015 10:14:43 AM UTCi7tiolAttached File-=>Added anon-func-error-stack.cset, #35084
    Tue 06 Oct 2015 10:10:49 AM UTCi7tiolAttached File-=>Added f1.m, #35082
      Attached File-=>Added f2.m, #35083

    Back to the top


    Powered by Savane 3.1-cleanup1