bugGNU Octave - Bugs: bug #48041, classdef: `help myclass` messes up...

 
 

bug #48041: classdef: `help myclass` messes up `help @myclass/method`

Submitter:  Colin Macdonald <cbm>
Submitted:  Fri 27 May 2016 08:48:30 PM UTC
   
 
Category:  Classdef Severity:  1 - Wish
Priority:  3 - Low Item Group:  Feature Request
Status:  Fixed Assigned to:  None
Originator Name:  Open/Closed:  * Closed
Release:  * dev Operating System:  * Any
Fixed Release:  9.1.0 Planned Release:  None
* Mandatory Fields

Add a New Comment Rich Markup
   

Jump to the original submission

Fri 09 Feb 2024 04:50:09 PM UTC, comment #10: 

I'll close this report since this particular issue is solved, although there are definitely remaining issues.  In particular, see bug #61521.

Rik <rik5>
Group administrator
Fri 09 Feb 2024 04:47:52 PM UTC, comment #9: 


> But Rik, I disagree with this statement:


>> Mixing old and new class syntax seems like a very bad idea if that is indeed the case.


> I believe its common practice (Chebfun does this, so does Pythonic) to build classdef classes that live in a `@foo`
> directory structures:
>  - some methods defined in `@foo/foo.m`
>  - other methods defined in other `@foo/bar.m` files.
> But maybe this is not what you mean by "mixing old and new"...


Matlab's first attempt at object oriented programming was a bit of a disaster, and while not formally deprecated, is definitely not recommended for new code.  Mixing that old system, which doesn't get a lot of support or maintenance in Octave, with classdef might cause problems.  If it doesn't, then great.  But if it does, there isn't going to be anyone around to fix the problems.

Rik <rik5>
Group administrator
Fri 09 Feb 2024 08:04:00 AM UTC, comment #8: 

hxxps://www.m*thw*rks.com/help/matlab/matlab_oop/methods-in-separate-files.html

> Class Folders
>
> You can define class methods in files that are separate from the class definition file, with certain exceptions


(I know their docs don't define our behaviour but one reasonable goal is to be able to write classdef code that works on both Octave and M*tl*b.

Colin Macdonald <cbm>
Fri 09 Feb 2024 07:58:07 AM UTC, comment #7: 

Original poster here... it does seem to be improved!  I think there are still related problems but the particular one mentioned seems to be fixed on the latest `default` branch.  Feel free to close; I'll file new issues for other cases I find.

But Rik, I disagree with this statement:

> Mixing old and new class syntax seems like a very bad idea if that is indeed the case.


I believe its common practice (Chebfun does this, so does Pythonic) to build classdef classes that live in a `@foo` directory structures:
  - some methods defined in `@foo/foo.m`
  - other methods defined in other `@foo/bar.m` files.
But maybe this is not what you mean by "mixing old and new"...

Colin Macdonald <cbm>
Thu 08 Feb 2024 09:52:05 PM UTC, comment #6: 

I can't tell what the original situation is either.  It may be that pyobject is a classdef m-file within an old-style class directory @pyobject which also contains old style functions such as @pyobject/display.m.

Mixing old and new class syntax seems like a very bad idea if that is indeed the case.

Let's see if there is a response in the next few days, and otherwise close this report.

Rik <rik5>
Group administrator
Thu 08 Feb 2024 08:50:48 PM UTC, comment #5: 

the comment #0 examples don't seem to work with classdef, as classdef methods can't use help with 'help @class/method', as was recently mentioned over in bug #62804.

trying it on an old style class, i can't reproduce the error. calling for help class or help class/meth in either order doesn't seem to cause later problems.  but maybe i'm not reproducing the test right?

Nicholas Jankowski <nrjank>
Group Member
Thu 08 Feb 2024 08:18:50 PM UTC, comment #4: 

Lots of work has recently been done on the function get_help_text() in preparation for the 9.1 release of Octave. Is this bug still present?

Rik <rik5>
Group administrator
Sun 24 Jul 2022 06:16:49 AM UTC, comment #3: 


> the alternate syntax 'help myclass.method' works universally now


I'm not sure this is so.  Not for old-style (https://savannah.gnu.org/bugs/?62804). I also found this summary: https://savannah.gnu.org/bugs/index.php?61521


Colin Macdonald <cbm>
Fri 04 Jun 2021 07:46:29 PM UTC, comment #2: 

It's still true that calling 'help myclass' makes 'help @myclass/method' not work, unless it has already been called before. However, the alternate syntax 'help myclass.method' works universally now, so that's a useful workaround.

It's not clear to me whether the '@myclass/method' form should only work for methods actually defined in a subdirectory, or should it also work for methods defined and documented inline in the classdef block?

Mike Miller <mtmiller>
Group Member
Sun 29 May 2016 04:44:11 PM UTC, comment #1: 

Confirmed here, calling the class constructor, as opposed to `help foo`, also masks the help on any other methods.

Mike Miller <mtmiller>
Group Member
Fri 27 May 2016 08:48:30 PM UTC, original submission:  

`help` interacts badly with classdef-style classes.  After I do `help classname`, I cannot access the help of any methods (except ones I accessed before `help classname`.


>> help pyobject
error: help: 'pyobject' is not documented
>> help @pyobject/display
error: help: '@pyobject/display' is not documented
>> help @pyobject/dummy
error: help: '@pyobject/dummy' is not documented

("@pyobject/dummy" is documented).

But if I restart Octave and try the commands in a different order:


>> help @pyobject/display
'@pyobject/display' is a function from the file /home/cbm/src/pytave.hg.mine/@pyobject/display.m

 -- Method on @pyobject: display (X)
     Custom display for pyobjects.

  ---- 8< -----

>> help pyobject
error: help: 'pyobject' is not documented
>> help @pyobject/dummy
error: help: '@pyobject/dummy' is not documented


Colin Macdonald <cbm>

 

(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 rik5 (Posted a comment)
  • -email is unavailable- added by nrjank (Updated the item)
  • -email is unavailable- added by mtmiller (Posted a comment)
  • -email is unavailable- added by cbm (Submitted the item)
  • -email is unavailable- added by cbm
  • -email is unavailable- added by cbm
  •  

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

    Date Changed by Updated Field Previous Value => Replaced by
    2024-02-09 rik5 StatusNeed Info Fixed
        Open/ClosedOpen Closed
        Fixed ReleaseNone 9.1.0
    2024-02-08 rik5 StatusConfirmed Need Info
    2024-01-23 nrjank CategoryInterpreter Classdef
    2021-06-04 mtmiller Severity3 - Normal 1 - Wish
        Priority5 - Normal 3 - Low
        Item GroupIncorrect Result Feature Request
    2017-09-19 pantxo Dependencies- bugs #52058 is dependent
    2016-05-29 mtmiller StatusNone Confirmed
    2016-05-27 cbm Carbon-Copy- Added mtmiller
        Carbon-Copy- Added goffioul

    Back to the top

    Powered by Savane 3.13-ee12.
    Corresponding source code