bugGNU Octave - Bugs: bug #50683, disp() for cell arrays should not...

 
 

bug #50683: disp() for cell arrays should not have initial newline

Submitter:  Rik <rik5>
Submitted:  Thu 30 Mar 2017 10:04:03 PM UTC
   
 
Category:  Interpreter Severity:  2 - Minor
Priority:  5 - Normal Item Group:  Feature Request
Status:  Fixed Assigned to:  siko1056
Originator Name:  Open/Closed:  * Closed
Release:  * dev Operating System:  * Any
Fixed Release:  None Planned Release:  None
* Mandatory Fields

Add a New Comment Rich Markup
   

Wed 05 Apr 2017 09:01:44 PM UTC, comment #2: 

Actually, I had to take a different approach and overload the function print_name_tag().  See this cset (http://hg.savannah.gnu.org/hgweb/octave/rev/0f18524973eb).


Rik <rik5>
Group administrator
Wed 05 Apr 2017 08:09:06 AM UTC, comment #1: 

Agree, can you confirm, that the cset https://hg.savannah.gnu.org/hgweb/octave/rev/7dc148266dca solves this issue?


>> x = {1;2;3}
x = {
  [1,1] =  1
  [2,1] =  2
  [3,1] =  3
}
>> disp (x)
{
  [1,1] =  1
  [2,1] =  2
  [3,1] =  3
}
>> display (x)
x = {
  [1,1] =  1
  [2,1] =  2
  [3,1] =  3
}
>> y = [1;2;3]
y =

   1
   2
   3

>> disp (y)
   1
   2
   3
>> display (y)
y =

   1
   2
   3


Kai Torben Ohlhus <siko1056>
Group Member
Thu 30 Mar 2017 10:04:03 PM UTC, original submission:  

There is a small inconsistency with the disp() routine and the built-in cell array type.  It always prints a newline before the cell array, unlike a regular array.

See the Octave session captured below:


octave:1> x = {1;2;3}
x =
{
  [1,1] =  1
  [2,1] =  2
  [3,1] =  3
}
octave:2> disp (x)

{
  [1,1] =  1
  [2,1] =  2
  [3,1] =  3
}
octave:3> y = [1;2;3]
y =

   1
   2
   3

octave:4> disp (y)
   1
   2
   3
octave:5>



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

Items that depend on this one: None found

 

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

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

    Date Changed by Updated Field Previous Value => Replaced by
    2017-04-05 rik5 StatusWorks For Me Fixed
        Open/ClosedOpen Closed
    2017-04-05 siko1056 StatusFixed Works For Me
    2017-04-05 siko1056 Assigned toNone siko1056
    2017-04-05 siko1056 StatusConfirmed Fixed
    2017-03-30 rik5 Carbon-Copy- Added jwe

    Back to the top

    Powered by Savane 3.13-02a9.
    Corresponding source code