Why is string concatenation done with * not +
https://groups.google.com/d/topic/julia-users/nQg_d_n0t1Q/discussion
peace,
s
On Tue, Jul 22, 2014 at 4:58 PM, Stefan Karpinski ste...@karpinski.org
wrote:
many threads: search string concatenation
On Tue, Jul 22, 2014 at 1:55 PM, Ben Arthur
Thanks for the link, Spencer. This obviously belongs in the FAQ for now.
On Tue, Jul 22, 2014 at 2:19 PM, Spencer Russell s...@mit.edu wrote:
Why is string concatenation done with * not +
https://groups.google.com/d/topic/julia-users/nQg_d_n0t1Q/discussion
peace,
s
On Tue, Jul 22, 2014
I was interested to define ++ as operator for concatenating strings. I
can define + for this purpose, but for ++ I get
julia function ++(x::String, y::String)
x * y
end
ERROR: syntax: expected ( in function definition
I looked up // in Rational.jl, but did not
It is not, look at julia-parser.scm for the list of operators you are able
to define.
On Monday, July 21, 2014 5:57:41 PM UTC-4, Steve Kelly wrote:
I think the issue is that ++ is not an operator in julia.
On Mon, Jul 21, 2014 at 5:51 PM, Hans W Borchers hwbor...@gmail.com
javascript:
It is not, look at julia-parser.scm for the list of operators you are
able to define.
And I thought Julia allows to define operators as users like.
Is there a special reason (inconsistency) why ++ would not not be allowed
while // is?
Could this be changed by an appropriate entry in
Julia does not allow user-defined operators. There are just a lot of
pre-defined operators. We could add ++ as an operator, but we'd have to
decide how it parses and what it's precedence is. In Haskell it's an infix
operator used for concatenation. In C it's a prefix and postfix operator
that