bugGNU Octave - Bugs: bug #49006, doc-string of edit.m: command call...

 
 

bug #49006: doc-string of edit.m: command call cannot assign return value to variable

Submitter:  None
Submitted:  Mon 05 Sep 2016 09:07:13 AM UTC
   
 
Category:  Documentation Severity:  3 - Normal
Priority:  5 - Normal Item Group:  Documentation
Status:  Fixed Assigned to:  None
Originator Name:  Originator Email:  -email is unavailable-
Open/Closed:  * Closed Release:  * 4.0.3
Operating System:  * Any Fixed Release:  None
Planned Release:  None
* Mandatory Fields

Add a New Comment Rich Markup
   

Tue 06 Sep 2016 10:16:21 PM UTC, comment #2: 

Happily, this has already been fixed in the development branch which is about to become 4.2.  The text there reads


 -- edit NAME
 -- edit FIELD VALUE
 -- VALUE = edit ("get", FIELD)
 -- VALUE = edit ("get", "all")
     Edit the named function, or change editor settings.


Rik <rik5>
Group administrator
Tue 06 Sep 2016 09:26:07 PM UTC, comment #1: 

Thanks for your detailed bug report. Fortunately, the doc string of edit.m has already been fixed on the default branch for the upcoming 4.2 release.

Mike Miller <mtmiller>
Group Member
Mon 05 Sep 2016 09:07:13 AM UTC, original submission:  


>>  help edit

 -- Command: edit NAME
 -- Command: edit FIELD VALUE
 -- Command: VALUE = edit get FIELD


But the form of command call cannot assign its return value to variable:

>>  edit get mode
ans = async
>>  a = edit get mode
parse error:

  syntax error

>>>  a = edit get mode
                ^

In this case we have to use the form of function call:

>>  a = edit('get','mode')
a = async


So the doc-string of edit.m should be:

>>  help edit

 -- Command: edit NAME
 -- Command: edit FIELD VALUE
 -- Command: VALUE = edit ("get", "FIELD")

(See also the doc-string of "prefdir" "load" "who" which are correct:

 -- Command: DIR = prefdir
 -- Command: S = load ("options", "file", "v1", "v2", ...)
 -- Command: S = load ("file", "options", "v1", "v2", ...)
 -- Command: C = who ("pattern", ...)

)

Possible solution:

--- /usr/share/octave/4.0.3/m/miscellaneous/edit.m
+++ edit.m
@@ -19,7 +19,7 @@
 ## -*- texinfo -*-
 ## @deftypefn  {Command} {} edit @var{name}
 ## @deftypefnx {Command} {} edit @var{field} @var{value}
-## @deftypefnx {Command} {@var{value} =} edit get @var{field}
+## @deftypefnx {Command} {@var{value} =} edit ("get", "@var{field}")
 ## Edit the named function, or change editor settings.
 ##
 ## If @code{edit} is called with the name of a file or function as its


Anonymous

 

(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

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 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 2 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2016-09-06 mtmiller StatusNone Fixed
        Open/ClosedOpen Closed

    Back to the top

    Powered by Savane 3.13-d3ae.
    Corresponding source code