4 ms·
I have always liked ~ for string concatenation. Looks like a little string tying the strings together, and hardly likely to be confused with the bitwise not ope
by rm445 13y ago
I have always liked ~ for string concatenation. Looks like a little string tying the strings together, and hardly likely to be confused with the bitwise not operator.
- rattray 13y agoWhere is a ~ used for string concatenation?
- theOnliest 13y agoPerl 6 does...I can't recall anywhere else, though.
- alecrn 13y agoD uses it too. I think they use it for array concatenation as well.
- cameronkknight 13y agoI thought about it, but for the most part I used `~` as a way of referring to something in an unstrict way, e.g. `~+` doesn't typecheck, it just adds and auto-coerces both operands to a number. I didn't want to have `~` mean string concat because it overloads the semantic meaning of what `~` would represent. I actually stole `&` from VB, as well as `\` as floor division.