What's the name of the <> operator?

Sheer curiosity.

I’ve asked this question on StackOverflow and I got some answers assuming that this operator is the same one that is used in Java, thus it is probably called the same.

I know. Who cares?

I do.

Is there a proper way to mention the <> (binary concat) operator specific to Elixir? Should I call it the “diamond” operator?

1 Like

elixir-lang.org: Binaries (and bitstrings)

The string concatenation operation is actually a binary concatenation operator

elixir-lang.org: Binaries, strings and char lists:

Similar results can be achieved with the string concatenation operator <>

Elixir In Action p.46

Because strings are binaries, you can concatenate them with the <> operator

3 Likes

What’s wrong with “binary concatenation” operator? It makes it explicit and leaves no room for confusion.

9 Likes

Sounds good to me :blush:

2 Likes

Can I call it the mini spaceship operator?

3 Likes

As far as I know… the community has the upper hand :slight_smile:

+1 for the spaceship operator.

Maybe the spaceship that concatenates strings

Playfulness aside, “spaceship operator” has already been taken in general by three-way comparison - overloading terms like this rarely enhances clarity (and needlessly further contaminates search engine results).
[If web site content is search engine optimized then maybe technical documentation should be too.]

True. I like the binary concatenation operator, once it is used basically for that.

What’s wrong with binary concatenation operator?