bugGNU Octave - Bugs: bug #44981, strcat: allow call with empty...

 
 

bug #44981: strcat: allow call with empty argument list

Submitted by:  Mike Miller <mtmiller>
Submitted on:  Fri 01 May 2015 03:03:16 PM UTC  
 
Category: Octave FunctionSeverity: 1 - Wish
Priority: 5 - NormalItem Group: Feature Request
Status: FixedAssigned to: None
Originator Name: Open/Closed: Closed
Release: devOperating System: Any

Add a New Comment(Rich Markup)
   

You are not logged in

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

 

Wed 06 May 2015 11:33:28 AM UTC, comment #2:

Pushed since no one seems to oppose http://hg.savannah.gnu.org/hgweb/octave/rev/196871335aa8

Carnë Draug <carandraug>
Project Member
Fri 01 May 2015 03:27:14 PM UTC, comment #1:

Attached suggested changeset.

In strvcat the changes are mostly dropping the indentation one level. I simply dropped the check for nargin which automatically makes it loop zero times and return an empty string.

On the case of strcat and cstrcat because [cellstr{:}] returns an empty matrix of class double, I was more specific.

(file #33857)

Carnë Draug <carandraug>
Project Member
Fri 01 May 2015 03:03:16 PM UTC, original submission:

As noted in bug #44978, horzcat and vertcat both allow empty argument lists and return an empty matrix. Shouldn't strcat do the same?

This change will technically make strcat Matlab incompatible (in that it doesn't throw an error) but I think we've agreed that it's ok in general for Octave to do something different when it's fed something that would be an error in Matlab.

This should be an easy fix, but let's see if there are any strong opinions about whether this should be done or not.

Mike Miller <mtmiller>
Project Administrator

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach File(s):
   
   
Comment:
   

Attached Files
file #33857:  allow-empty-arguments-strcat.cset added by carandraug (6KiB - application/octet-stream)

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -unavailable- added by mtmiller (Submitted the item)
  •  

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

    Only project members can vote.

     

    Please enter the title of George Orwell's famous dystopian book (it's a date):

     

     

    Follow 3 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Wed 06 May 2015 11:33:28 AM UTCcarandraugStatusPostponed=>Fixed
      Open/ClosedOpen=>Closed
    Fri 01 May 2015 03:27:14 PM UTCcarandraugAttached File-=>Added allow-empty-arguments-strcat.cset, #33857

    Back to the top


    Powered by Savane 3.1-cleanup1