I think the '+' is not as prevalent as you might think. MATLAB: ['foo' 'bar'] R: paste('foo', 'bar', sep="") Python/C++/Ruby: "foo" + "bar" Perl/PHP: "foo" . "bar" C: strcat(bufcontainingfoo, "bar") Mathematica: "foo" <> "bar"
People coming from MATLAB and R (probably a very large portion of those trying Julia) are already used to something else. There may be a lot of Python programmers as well, but Julia isn't trying to target Python users specifically. I think having a +(String, String) defined with a helpful error would be a good idea, and I don't think it needs to be confined to the REPL (unless something in the language depends on seeing method missing errors). On Thursday, 3 July 2014 08:11:43 UTC-5, Samuel Colvin wrote: > > Fundamentally I don't think it matters which mathematical operator we use > for an operation that's not strictly mathematical (or at least most users > don't think of as mathematical), everyone is quite happy with "x = 4" not > having it's rigorous meaning of "x == 4". As long as there's a compact and > clear way of doing string concatenation I'm happy. > > If most people want * that's fine especially as there would need to be a > very good reason to change it now. > > The point is that we should make it as easy as possible for people to > transition to Julia from other languages, and this is one potential > stumbling block. > > I agree with Tobias's suggestion of a REPL, IJulia only +(s1::String, > s2::String) that throws an informative error. > > For my part I've updated Julia By Example > <http://www.scolvin.com/juliabyexample/#Strings-Basics> to give an > example and a link to this discussion. >