bugGNU Octave - Bugs: bug #50541, which() should return non-empty...

 
 

bug #50541: which() should return non-empty string for existing built-in classes/functions

Submitted by:  Felipe G. Nievinski <fgnievinski>
Submitted on:  Tue 14 Mar 2017 05:08:45 AM UTC  
 
Category: Octave FunctionSeverity: 3 - Normal
Priority: 5 - NormalItem Group: Matlab Compatibility
Status: FixedAssigned to: None
Originator Name: Open/Closed: Closed
Release: devOperating System: Any

Add a New Comment(Rich Markup)
   

You are not logged in

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

 

Thu 16 Mar 2017 07:33:51 PM UTC, comment #4:

I change which to return the type field--for example, "built-in function"--whenever the path to the function is null (""). This makes more sense for command-line functions as well which previously returned "". See http://hg.savannah.gnu.org/hgweb/octave/rev/c1362a71fb0e.

Rik <rik5>
Project Administrator
Wed 15 Mar 2017 08:45:07 PM UTC, comment #3:

Okay. It seems like we should return the string

Rik <rik5>
Project Administrator
Wed 15 Mar 2017 07:26:41 PM UTC, comment #2:

ML r2017a prerelease:

The path in the output is nonexistent.
In ..\matlab\elfun, sin.m only contains a very short help text.

Philip Nienhuis <philipnienhuis>
Project Member
Tue 14 Mar 2017 03:57:54 PM UTC, comment #1:

So Matlab copies over the whole string. That's not a bad option.

According to the documentation for which, it is supposed to return the string "variable" if the argument is a variable, and a path to the file otherwise.

Could you test this code?

Rik <rik5>
Project Administrator
Tue 14 Mar 2017 05:08:45 AM UTC, original submission:

In Octave we have:

>> size(which('inputParser'))

ans =
0 0

>> tmp = which('inputParser')

tmp =

It may only be a matter of assigning to the output the message which is already displayed:

>> which('inputParser')

'inputParser' is a built-in function

For reference, in Matlab we have:

>> tmp = which('inputParser')

tmp =
inputParser is a built-in method

>> size(which('inputParser'))

ans =
1 32

Felipe G. Nievinski <fgnievinski>

 

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

Attach File(s):
   
   
Comment:
   

No files currently attached

 

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 fgnievinski (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 6 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Thu 16 Mar 2017 07:33:51 PM UTCrik5StatusConfirmed=>Fixed
      Open/ClosedOpen=>Closed
      Release4.2.1=>dev
    Wed 15 Mar 2017 08:45:07 PM UTCrik5StatusNeed Info=>Confirmed
    Tue 14 Mar 2017 03:57:54 PM UTCrik5StatusNone=>Need Info
      Operating SystemMicrosoft Windows=>Any

    Back to the top


    Powered by Savane 3.1-cleanup1