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

 
 

bug #61521: help syntax for class objects is incomplete

Submitted by:  Rik <rik5>
Submitted on:  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

Add a New Comment (Rich Markup)
   

You are not logged in

Please log in, so followups can be emailed to you.

 

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>
Project 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>
Project 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>
Project 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

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by jwe (Posted a comment)
  • -email is unavailable- added by rik5 (Submitted the item)
  •  

    Do you think this task is very important?
    If so, you can add your encouragement to it.
    This task has 0 encouragements so far.

    Only project members can vote.

     

     

     

    Follow 2 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    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.7