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

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

[Octave-bug-tracker] [bug #64286] `type` misidentifies things as user-de


From: Arun Giridhar
Subject: [Octave-bug-tracker] [bug #64286] `type` misidentifies things as user-defined functions
Date: Thu, 8 Jun 2023 20:09:17 -0400 (EDT)

URL:
  <https://savannah.gnu.org/bugs/?64286>

                 Summary: `type` misidentifies things as user-defined
functions
                   Group: GNU Octave
               Submitter: arungiridhar
               Submitted: Thu 08 Jun 2023 08:09:15 PM EDT
                Category: Octave Function
                Severity: 2 - Minor
                Priority: 5 - Normal
              Item Group: Inaccurate Result
                  Status: None
             Assigned to: None
         Originator Name: 
        Originator Email: 
             Open/Closed: Open
                 Release: dev
         Discussion Lock: Any
        Operating System: Any
           Fixed Release: None
         Planned Release: None


    _______________________________________________________

Follow-up Comments:


-------------------------------------------------------
Date: Thu 08 Jun 2023 08:09:15 PM EDT By: Arun Giridhar <arungiridhar>
The `type` command misidentifies scripts as functions and Octave functions as
user-defined functions.


octave:1> which foo
'foo' is a script from the file /tmp/foo.m
octave:2> type foo
foo is the user-defined function defined from: /tmp/foo.m

a = 1
b = 2

octave:3> 


`foo` is not a function though. It is a script.


octave:3> which ls
'ls' is a function from the file
/usr/local/share/octave/9.0.0/m/miscellaneous/ls.m
octave:4> type ls
ls is the user-defined function defined from:
/usr/local/share/octave/9.0.0/m/miscellaneous/ls.m



Not a user-defined function though.

It seems `type.m` has the hard-coded string "user-defined function" to
introduce everything.

Should type.m just call which.m before printing the file?







    _______________________________________________________

Reply to this item at:

  <https://savannah.gnu.org/bugs/?64286>

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




reply via email to

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