octave-bug-tracker
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Octave-bug-tracker] [bug #65116] classdef display override populates an


From: John Donoghue
Subject: [Octave-bug-tracker] [bug #65116] classdef display override populates ans whith class when using inputname
Date: Wed, 3 Jan 2024 20:52:22 -0500 (EST)

URL:
  <https://savannah.gnu.org/bugs/?65116>

                 Summary: classdef display override populates ans whith class
when using inputname
                   Group: GNU Octave
               Submitter: lostbard
               Submitted: Thu 04 Jan 2024 01:52:22 AM UTC
                Category: Classdef
                Severity: 3 - Normal
                Priority: 5 - Normal
              Item Group: Regression
                  Status: None
             Assigned to: None
         Originator Name: lostbard
        Originator Email: 
             Open/Closed: Open
                 Release: 8.4.0
         Discussion Lock: Any
        Operating System: Any
           Fixed Release: None
         Planned Release: None


    _______________________________________________________

Follow-up Comments:


-------------------------------------------------------
Date: Thu 04 Jan 2024 01:52:22 AM UTC By: John Donoghue <lostbard>
I have a simple classdef:



classdef tc

  methods
    function a = tc()
      #nothing to do
    endfunction
    function display(a)
      printf(" %s = my test\n", inputname(1));
    endfunction
  endmethods
endclassdef



Then in octave create an instance of one:

a = tc

It is created ok, and displays 'a = my test' as expected.
But running whos, shows 2 variables


  Attr   Name        Size                     Bytes  Class
  ====   ====        ====                     =====  ===== 
         a           1x1                          0  tc
         ans         1x1                          0  tc


If I try in octave 5.2.0 or 6.2.0, it doesnt do it. I see it in octave 7.2.1
and up that I have installed.


If I change 

printf(" %s = my test\n", inputname(1));

to

printf(" %s = my test\n", "A");


It doesnt do it, so is because of something happening within inputname ?









    _______________________________________________________

Reply to this item at:

  <https://savannah.gnu.org/bugs/?65116>

_______________________________________________
Message sent via Savannah
https://savannah.gnu.org/




reply via email to

[Prev in Thread] Current Thread [Next in Thread]