{"action":"created","issue":{"url":"https://api.github.com/repos/JuliaLang/julia/issues/11030","labels_url":"https://api.github.com/repos/JuliaLang/julia/issues/11030/labels{/name}","comments_url":"https://api.github.com/repos/JuliaLang/julia/issues/11030/comments","events_url":"https://api.github.com/repos/JuliaLang/julia/issues/11030/events","html_url":"https://github.com/JuliaLang/julia/issues/11030","id":71328866,"number":11030,"title":"Taking string concatenation seriously, or, a proposal to deprecate *, ^ for string concatenation and repetition","user":{"login":"quinnj","id":2896623,"avatar_url":"https://avatars.githubusercontent.com/u/2896623?v=3","gravatar_id":"","url":"https://api.github.com/users/quinnj","html_url":"https://github.com/quinnj","followers_url":"https://api.github.com/users/quinnj/followers","following_url":"https://api.github.com/users/quinnj/following{/other_user}","gists_url":"https://api.github.com/users/quinnj/gists{/gist_id}","starred_url":"https://api.github.com/users/quinnj/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/quinnj/subscriptions","organizations_url":"https://api.github.com/users/quinnj/orgs","repos_url":"https://api.github.com/users/quinnj/repos","events_url":"https://api.github.com/users/quinnj/events{/privacy}","received_events_url":"https://api.github.com/users/quinnj/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":166,"created_at":"2015-04-27T15:58:50Z","updated_at":"2015-06-13T00:34:09Z","closed_at":null,"body":"The frequency and vehemency of discussions around this subject beg for a change. `*` and `^` were introduced for strings back when the language wasn't as strict on operator punning and overall meaning.\r\n\r\nAs a first, step, I propose we deprecate these two methods for string operations.\r\n\r\nAs a next discussion, we can talk about the possibility of using a different operator(s) for concatenation/repetition. Just using `repeat`, with no operator, has been suggested, as well as the following for string concatenation:\r\n\r\n* `++`, as a general sequence concatenation operator\r\n* `..`, similar to Lua\r\n\r\nThings to consider:\r\n* Would the same operator apply to other concatenation operations like vectors or multi-dimensional arrays? In that case, how would it interact with `vcat`/`hcat`?"},"comment":{"url":"https://api.github.com/repos/JuliaLang/julia/issues/comments/111646713","html_url":"https://github.com/JuliaLang/julia/issues/11030#issuecomment-111646713","issue_url":"https://api.github.com/repos/JuliaLang/julia/issues/11030","id":111646713,"user":{"login":"ScottPJones","id":11798751,"avatar_url":"https://avatars.githubusercontent.com/u/11798751?v=3","gravatar_id":"","url":"https://api.github.com/users/ScottPJones","html_url":"https://github.com/ScottPJones","followers_url":"https://api.github.com/users/ScottPJones/followers","following_url":"https://api.github.com/users/ScottPJones/following{/other_user}","gists_url":"https://api.github.com/users/ScottPJones/gists{/gist_id}","starred_url":"https://api.github.com/users/ScottPJones/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ScottPJones/subscriptions","organizations_url":"https://api.github.com/users/ScottPJones/orgs","repos_url":"https://api.github.com/users/ScottPJones/repos","events_url":"https://api.github.com/users/ScottPJones/events{/privacy}","received_events_url":"https://api.github.com/users/ScottPJones/received_events","type":"User","site_admin":false},"created_at":"2015-06-13T00:34:09Z","updated_at":"2015-06-13T00:34:09Z","body":"@PallHaraldsson As I said, I wanted a general concatenation operator for strings and vectors (i.e. like `vcat`). I never said that I wanted that operator to be used for scalars (I think it would not be a good idea,\r\nit just makes things more potentially confusable).\r\n\r\nThere are a number of consistency problems right now, such as:\r\n```julia\r\njulia> b\"a\" * b\"b\"\r\nERROR: MethodError: `*` has no method matching *(::Array{UInt8,1}, ::Array{UInt8,1})\r\nClosest candidates are:\r\n  *(::Any, ::Any, ::Any)\r\n  *(::Any, ::Any, ::Any, ::Any...)\r\n  *{T<:Union(Float64,Complex{Float32},Complex{Float64},Float32),S}(::Union(SubArray{T<:Union(Float64,Complex{Float32},Complex{Float64},Float32),2,A<:DenseArray{T,N},I<:Tuple{Vararg{Union(Range{Int64},Int64,Colon)}},LD},DenseArray{T<:Union(Float64,Complex{Float32},Complex{Float64},Float32),2}), ::Union(SubArray{S,1,A<:DenseArray{T,N},I<:Tuple{Vararg{Union(Range{Int64},Int64,Colon)}},LD},DenseArray{S,1}))\r\n  ...\r\n\r\njulia> vcat(b\"a\", b\"b\")\r\n2-element Array{UInt8,1}:\r\n 0x61\r\n 0x62\r\n```\r\n\r\nA general concatenation operator, as I've been proposing, whether `++` or `..` or anything else, would eliminate that sort of inconsistent behavior."}}