bugGNU Octave - Bugs: bug #39441, SQP return variable 'info'...

 
 

bug #39441: SQP return variable 'info' conflicts with info().

Submitter:  None
Submitted:  Mon 08 Jul 2013 11:44:57 PM UTC
   
 
Category:  Libraries Severity:  3 - Normal
Priority:  5 - Normal Item Group:  None
Status:  Invalid / Not an Octave Bug Assigned to:  None
Originator Name:  Charlie Hagedorn Originator Email:  -email is unavailable-
Open/Closed:  * Closed Release:  * 3.6.4
Operating System:  * GNU/Linux Fixed Release:  None
Planned Release:  None
* Mandatory Fields

Add a New Comment Rich Markup
   

Tue 09 Jul 2013 01:33:55 PM UTC, comment #1: 

I really don't think this is a bug nor that anything should be done about it.

Namespace collisions are something of a conscious design decision of the Matlab language. I think it's the stupidest thing of the language, but it's built-in. We have to mimic them in Octave.

The most common namespace collision is for the i or j variables, which by default are built-in functions. Do you really want to get a warning every time you do for i = 1:10? Do you also want us to change the documentation and track down every instance of where we used i or j for variables in the documentation and we didn't mean the built-in functions?

When your code started spewing Octave documentation, I suppose you would have preferred it to error out saying undefined variable?

I am tentatively closing this bug report as invalid. If you disagree, we may reopen it.

Jordi GutiƩrrez Hermoso <jordigh>
Group Member
Mon 08 Jul 2013 11:44:57 PM UTC, original submission:  

Severity: Low/Minor

In the documentation (and help page) for sqp, the function prototype is

[x, obj, info, iter, nf, lambda] = sqp (x0, phi)


Blindly copying that suggestion overloads the octave native function 'info()'


octave:1> info

  Additional information about GNU Octave is available at
  http://www.octave.org

  Links to the mailing list and other resources for getting help with
  Octave are available at
  http://www.octave.org/support.html

  You may also find some information in the Octave Wiki at
  http://wiki.octave.org

  Additional functionality can be enabled by using packages from
  the Octave Forge project, which may be found at
  http://octave.sourceforge.net

  Report bugs to the bug tracker at
  http://bugs.octave.org
  But first, please read the guidelines to writing a helpful report at
  http://www.octave.org/bugs.html
octave:2> info = 2
info =  2
octave:3> info
info =  2
octave:4>


Would suggest a different naming convention for the function (and any others like it). It was quite a surprise to see optimization code start spewing Octave information when I switched to nmsmax where I had previously used sqp.

Is there a warning variable that can be enabled to prevent accidental overloads?

Thanks!

Anonymous

 

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

Attach Files:
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by jordigh (Posted a comment)
  • -email is unavailable- added by None (Submitted the item)
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

    Only group members can vote.

     

    Follow 2 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2013-07-09 jordigh StatusNone Invalid / Not an Octave Bug
        Open/ClosedOpen Closed

    Back to the top

    Powered by Savane 3.13-4b48.
    Corresponding source code