bugGNU Octave - Bugs: bug #59532, string concatenation lacks some...

 
 

bug #59532: string concatenation lacks some syntax variants of Matlab

Submitter:  Hartmut <hardy>
Submitted:  Tue 24 Nov 2020 05:17:14 PM UTC
   
 
Category:  Octave Function Severity:  3 - Normal
Priority:  5 - Normal Item Group:  Feature Request
Status:  Duplicate Assigned to:  None
Originator Name:  Open/Closed:  * Closed
Release:  * 5.2.0 Operating System:  * Any
Fixed Release:  None Planned Release:  None
* Mandatory Fields

Add a New Comment Rich Markup
   

Tue 24 Nov 2020 07:32:12 PM UTC, comment #2: 

I AGREE that the second command in comment #0 is probably dealt with, once we implement the new string class in Octave. Probably the first command as well. THANKS for making this connection, I didn't know about this new string class before.

But it FEELS depressing, that such an easy looking thing, like appending strings, depend on such big challenges like implementing a totally new class in Octave (a task currently having "minor" / "later" priority in the "WTF matlab" category, that will probably take its time). I really met this syntax in "wild life", people are using it already, and then they perceive Octave as "incompatible". (This is just ment as an emotional personal comment, nothing more.)

Hartmut <hardy>
Tue 24 Nov 2020 07:08:21 PM UTC, comment #1: 

I'm closing this report because it doesn't make much sense to me to report individual problems with the new Matlab string class when Octave doesn't yet have it.  There is already a bug report for tracking the progress on the larger feature request:

https://savannah.gnu.org/bugs/index.php?50855

John W. Eaton <jwe>
Group administrator
Tue 24 Nov 2020 05:17:14 PM UTC, original submission:  

Here are two "new" ways to concatenate strings. Both do work in Matlab (tested with R2019b) but do not work currently in Octave (tested with version 5.2.0):


>> mystring = "asdf" + 1.234

mystring =

    "asdf1.234"

(Here the result in Octave is just "different", it is an array of 4 doubles.  Why not 5 by the way?)


>> mystring2 = ["asdf", 1.234]

mystring2 =

  1×2 string array

    "asdf"    "1.234"

(This just returns the first string "asdf" in Octave and skips the second part.)

I kind of like especially the first new syntax, because it makes the following code possible:

  a=5*6;
  disp("The result is:" + a);

This will probably look familiar to people using Python.

Maybe we should add those syntax variants to Octave as well?

Hartmut <hardy>

 

(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 hardy (Submitted the item)
  •  

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

    Date Changed by Updated Field Previous Value => Replaced by
    2020-11-24 jwe Item GroupMatlab Compatibility Feature Request
        StatusNone Duplicate
        Open/ClosedOpen Closed

    Back to the top

    Powered by Savane 3.13-4b48.
    Corresponding source code