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

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

[Octave-patch-tracker] [patch #8066] speedup of strjoin


From: Ben Abbott
Subject: [Octave-patch-tracker] [patch #8066] speedup of strjoin
Date: Sun, 16 Jun 2013 03:04:23 +0000
User-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_7_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/27.0.1453.110 Safari/537.36

Follow-up Comment #3, patch #8066 (project octave):

A problem

>From Matlab


strjoin({'Octave','Scilab'}, '\n')

ans =

Octave
Scilab


>From Octave


strjoin({'Octave','Scilab'}, '\n')
ans = Octave\nScilab


If double-quotes are used, the Octave work correctly because the parser
handles the conversion of escaped characters.

Thus, single-quoted delimiters need to be escaped by strjoin().   The first
input does not, Matlab again


strjoin({'Octave\n','Scilab\n'}, 'foo')

ans =

Octave\nfooScilab\n


Unless I'm missing something, a patch is needed that runs do_string_escapes()
on the second input.  For the example above,


strjoin({'Octave','Scilab'}, do_string_escapes ('\n'))


However, since the second input may be a cell-string a proper solution is a
bit more complicated.

    _______________________________________________________

Reply to this item at:

  <http://savannah.gnu.org/patch/?8066>

_______________________________________________
  Message sent via/by Savannah
  http://savannah.gnu.org/




reply via email to

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