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

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

[Octave-bug-tracker] [bug #53900] which does not work for functions in p


From: Richard
Subject: [Octave-bug-tracker] [bug #53900] which does not work for functions in packages (+package directories)
Date: Mon, 14 May 2018 10:51:46 -0400 (EDT)
User-agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Ubuntu Chromium/65.0.3325.181 Chrome/65.0.3325.181 Safari/537.36

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

                 Summary: which does not work for functions in packages
(+package directories)
                 Project: GNU Octave
            Submitted by: crobar
            Submitted on: Mon 14 May 2018 02:51:44 PM UTC
                Category: Octave Function
                Severity: 3 - Normal
                Priority: 5 - Normal
              Item Group: Matlab Compatibility
                  Status: None
             Assigned to: None
         Originator Name: Richard Crozier
        Originator Email: 
             Open/Closed: Open
         Discussion Lock: Any
                 Release: dev
        Operating System: GNU/Linux

    _______________________________________________________

Details:


On matlab you can get the file containing a function in a namespace (i.e. in a
package directory) using 'which' like below. Here I've created a directory
'+example_pkg' and put the m-file 'example_pkg_fcn.m' in it. This is a valid
mfile, just prints 'hello' which can be run in both matlab and octave. I've
attached it.

Matlab returns the following:


>> which example_pkg.example_pkg_fcn
/home/rcrozier/Sync/work/mfiles/octave_tests/+example_pkg/example_pkg_fcn.m  %
static method or package function


on Octave, 'which' returns nothing


>> x = which ('example_pkg.example_pkg_fcn')
x =

>>


actually, if you try to do the exact same as in matlab you get a syntax
error:


>> which example_pkg.example_pkg_fcn
>> x = which example_pkg.example_pkg_fcn
parse error:

  syntax error

>>> x = which example_pkg.example_pkg_fcn
                        ^


Octave doesn't seem to treat it as a string, but that's for another bug report
I guess!

For completeness, using function syntax on matlab gives


>> x = which ('example_pkg.example_pkg_fcn')

x =

   
'/home/rcrozier/Sync/work/mfiles/octave_tests/+example_pkg/example_pkg_fcn.m'




    _______________________________________________________

File Attachments:


-------------------------------------------------------
Date: Mon 14 May 2018 02:51:44 PM UTC  Name: example_pkg_fcn.m  Size: 54B  
By: crobar

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

    _______________________________________________________

Reply to this item at:

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

_______________________________________________
  Message sent via Savannah
  https://savannah.gnu.org/




reply via email to

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