bugGNU Octave - Bugs: bug #61521, help syntax for class objects is...

 
 

bug #61521: help syntax for class objects is incomplete

Submitter:  Rik <rik5>
Submitted:  Mon 22 Nov 2021 02:46:52 AM UTC
   
 
Category:  Interpreter 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
Fixed Release:  None Planned Release:  None
* Mandatory Fields

Add a New Comment Rich Markup
   

Thu 08 Feb 2024 10:08:33 PM UTC, comment #3: 

A lot of work has recently (January 2024) been done on get_help_text() which has improved classdef documentation.  Nevertheless, the issues in the original submission remain.  In terms of priority, getting dot notation working for old-style classes would be useful so that programmers wouldn't have to switch syntaxes whenever they write object oriented code in one or the other styles.  Next most important would be supporting slash notation as an alternative to dot notation.

Rik <rik5>
Group administrator
Tue 23 Nov 2021 03:44:28 PM UTC, comment #2: 

The conflict I was trying to describe is for the case of


help foopkg.m


when both of the following files exist in the loadpath:


foopkg.m
+foopkg/m.m


I suspect that Matlab will find package functions first, then literal filenames, but I don't think we can know for sure without asking for someone to test the behavior.

Whatever we do, it seems that the logic for looking up files internally for execution or with the "which" command or with "exist" should all be the same and handled in one place.

John W. Eaton <jwe>
Group administrator
Mon 22 Nov 2021 02:50:14 AM UTC, comment #1: 

Another incorrect behavior is that if the method name is the same as a regular function then the class is ignored and help from the regular function is returned.  For example, inputParser has a delete method.  Executing


help inputParser.delete
'inputParser.delete' is a function from the file /home/rik/wip/Projects_Mine/octave-dev/scripts/miscellaneous/delete.m

 -- delete (FILE)
 -- delete (FILE1, FILE2, ...)
 -- delete (HANDLE)
     Delete the named file or graphics handle.

     FILE may contain globbing patterns such as '*'.  Multiple files to
     be deleted may be specified in the same function call.

     HANDLE may be a scalar or vector of graphic handles to delete.

     Programming Note: Deleting graphics objects is the proper way to
     remove features from a plot without clearing the entire figure.

     See also: clf, cla, unlink, rmdir.


which shows that the help text is coming from the wrong file.

Rik <rik5>
Group administrator
Mon 22 Nov 2021 02:46:52 AM UTC, original submission:  

The most generic syntax


help methodname


does not work for old-style classes (@class) or new-style classes (classdef).  In Matlab, the syntax above will search both regular help and class help files.  For example,


help parse


will return help from inputParser.parse.

Dot notation works for new-style classes, but not for old-style classes.  Syntax:


help class.method


Example:


help inputParser.parse


Slash notation does not work for new-style or old-style classes

Syntax:


help class/method


Examples:


help inputParser/parse
help ftp/dir


But extended slash notation does work for old style-classes.

Syntax:


help @class/method


Example:


help @ftp/dir



Rik <rik5>
Group administrator

 

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

    Date Changed by Updated Field Previous Value => Replaced by
    2024-02-08 rik5 Dependencies- bugs #62804 is dependent
    2021-11-23 jwe Item GroupMatlab Compatibility Incorrect Result
        Summaryhelp syntax for class objects is not fully Matlab compatible help syntax for class objects is incomplete

    Back to the top

    Powered by Savane 3.13-d3ae.
    Corresponding source code