bugGNU Octave - Bugs: bug #40462, type does not display functions...

 
 

bug #40462: type does not display functions defined on the command line

Submitter:  None
Submitted:  Sun 03 Nov 2013 11:24:10 PM UTC
   
 
Category:  Interpreter Severity:  3 - Normal
Priority:  5 - Normal Item Group:  Feature Request
Status:  Fixed Assigned to:  None
Originator Name:  Adrian Originator Email:  -email is unavailable-
Open/Closed:  * Closed Release:  * dev
Operating System:  * GNU/Linux Fixed Release:  None
Planned Release:  None
* Mandatory Fields

Add a New Comment Rich Markup
   

Wed 20 May 2015 03:06:12 PM UTC, comment #5: 

I applied jwe's changes from 2013 since they work without modification on the current development branch (http://hg.savannah.gnu.org/hgweb/octave/rev/abf85f8cbd6c).

Rik <rik5>
Group administrator
Sun 28 Dec 2014 04:26:02 PM UTC, comment #4: 

@jwe: It is well past the 3.8. release which was the gating item for applying your contributed patch.  Do you want to apply it to the dev branch now?

Rik <rik5>
Group administrator
Thu 07 Nov 2013 08:54:47 AM UTC, comment #3: 

I'm attaching a possible patch.  I'm not sure this is appropriate for the 3.8 release.  It may need a little more testing.

(file #29556)

John W. Eaton <jwe>
Group administrator
Tue 05 Nov 2013 04:15:40 AM UTC, comment #2: 

It did work at one time by reconstructing the program text from the parse tree.  It would be easy to have it do that again.  Or we could maybe do better by using the exact text from the command line input instead.

John W. Eaton <jwe>
Group administrator
Tue 05 Nov 2013 01:43:13 AM UTC, comment #1: 

Confirmed on dev. Marking as a feature request for now, since I'm not sure if this ever worked in prior versions of Octave.

This would also allow functions defined in the interpreter to be edited and turned into function files, since edit uses type to extract the body of the function that it puts into a newly created m-file.

Mike Miller <mtmiller>
Group Member
Sun 03 Nov 2013 11:24:10 PM UTC, original submission:  

The following produces an error:


>> function y=foo y=42; endfunction
>> foo
42
>> type foo
error: type: 'foo' undefined


The help says that type will "Display the definition of each NAME that refers to a function", so I expected to see foo's definition.
It seems that "type" works properly for functions defined in a *.m file, but not for functions declared interactively.

I use octave 3.6.4 on Debian-GNU/Linux, but according to Philip Nienhuis this bug is still present in the development branch 3.7.7+ (see bug #40452 on clearing this type of functions), whence the 'dev' release tag on this bug.

cheers, Adrian

Anonymous

 

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

Attach Files:
   
   
Comment:
   

Attached Files
file #29556:  diffs.txt added by jwe (3KiB - text/plain)

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by rik5 (Posted a comment)
  • -email is unavailable- added by jwe (Posted a comment)
  • -email is unavailable- added by mtmiller (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 7 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2015-05-20 rik5 StatusPatch Submitted Fixed
        Open/ClosedOpen Closed
    2014-12-28 rik5 StatusConfirmed Patch Submitted
    2013-11-07 jwe Attached File- Added diffs.txt, #29556
    2013-11-05 mtmiller CategoryNone Interpreter
        Item GroupNone Feature Request
        StatusNone Confirmed

    Back to the top

    Powered by Savane 3.13-caa5.
    Corresponding source code