bugGNU Octave - Bugs: bug #52585, Functions in namespace directories...

 
 

bug #52585: Functions in namespace directories are not recognized by path functions such as which() or type()

Submitted by:  A.R. Burgers <arb>
Submitted on:  Mon 04 Dec 2017 07:34:34 PM UTC  
 
Category:  Octave Function Severity:  3 - Normal
Priority:  5 - Normal Item Group:  Incorrect Result
Status:  Confirmed Assigned to:  None
Originator Name:  Open/Closed:  Open
Release:  dev Operating System:  Any

Add a New Comment(Rich Markup)
   

You are not logged in

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

 

Thu 07 Dec 2017 07:00:26 PM UTC, comment #5:

As another workaround, can also give the namespace and the m-file name.

The root problem is that which() should be able to find

when the parent directory to +containers is on the the path.

As yet another workaround, adding the namespace to the path explicitly makes things work.

This is probably a clue as to the eventual solution. When directories are added using addpath, they should probably be scanned for +namespace directories and those might be added to the internal path variable, although not displayed if someone calls path().

Rik <rik5>
Project Administrator
Thu 07 Dec 2017 04:32:49 PM UTC, comment #4:

Seems pretty clear that Octave should be able handle this.

Rik <rik5>
Project Administrator
Thu 07 Dec 2017 04:25:54 PM UTC, comment #3:

In MATLAB:

This also seems relevant:
https://www.mathworks.com/help/matlab/matlab_env/specify-file-names.html#br8pz72-1

Amro <amro_octave>
Wed 06 Dec 2017 07:19:02 AM UTC, comment #2:

suppose there is a function foo.m in dir +pkg.

On matlab (R2015B) these two both work

both when the current working directory is the parentdir of +pkg and when the current working directory is different, but the parentdir of +pkg is present in the path.

A.R. Burgers <arb>
Tue 05 Dec 2017 12:00:50 AM UTC, comment #1:

As a workaround, you can give the full path to the file. For example, if you are at the top of a development tree.

But in general, you're right that there should be a way to do this by either using

For reference, does this work with Matlab?

Rik <rik5>
Project Administrator
Mon 04 Dec 2017 07:34:34 PM UTC, original submission:

I haven't found a way yet to type the source of e.g. containers.Map from the command line.

all of "type containers.Map", "type Map" or "type +containers.Map" fail.

A.R. Burgers <arb>

 

(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

Digest:
   bug dependencies.

 

Carbon-Copy List
  • -email is unavailable- added by amro_octave (Posted a comment)
  • -email is unavailable- added by rik5 (Posted a comment)
  • -email is unavailable- added by arb (Submitted the item)
  •  

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

    Only project members can vote.

     

     

     

    Follow 5 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2018-05-14 mtmiller Dependencies- => bugs #53900 is dependent
    2017-12-07 rik5 Summarytype cannot list the source of a function in a namespace => Functions in namespace directories are not recognized by path functions such as which() or type()
    2017-12-05 rik5 Item GroupUnexpected Error => Incorrect Result
        StatusNone => Confirmed
        Summarytype cannot list source of functions in namespace => type cannot list the source of a function in a namespace

    Back to the top


    Powered by Savane 3.3