:= and friends are deliberately supported only in the parser, so they can be used inside macros in the context of DSLs for example. It might get some special meaning at some point in the future. There have been various proposals in the past, but so far there hasn’t been any definite decision or someone stepping forward and implementing it.
$= is just the updating version of $, which behaves like any other binary operator, e.g. you could write the following:
julia> x $ y = xor(x, y)
$ (generic function with 1 method)
julia> x = 0x01
julia> x $= 0x03
OK so they are some kind of “empty placeholder” ops, one has to fill them with user code before using them.
That may sound like a bit strange handshaking between core/user code.
F# allows customs operators thru operator overloading. you build what you want from allowed op chars.
Creating New Operators
You can overload all the standard operators, but you can also create new operators out of sequences of certain characters. Allowed operator characters are !, $, %, &, *, +, -, ., /, <, =, >, ?, @, ^, |, and ~. The ~ character has the special meaning of making an operator unary, and is not part of the operator character sequence. Not all operators can be made unary.
$= is just the updating version of $ , which behaves like any other binary operator, e.g. you could write the following:
Little addendum :
$ is so much associated with interpolation thru macro, and regex. I don’t know if it will be aliased so much ?! In those two contexts, $ is used as an unary op, while your example def it as a binary one.
I was able to define an unary variant
($)(x::Int) = 2x
But each custom unary call leads to a syntax error
OK. Since there are at least two differents interpo, the expr and the string (not the regex, sorry). Julia may have make it more multi-dispatchable as an unary op. But let’s admit the composite case is covered with expr and the litteral one is enough with string.
EX_OR/2 pops here and there in the frontend, the only other ref i have found about it was not at matlab, mathematica, latex, or apl but ahdl. There must be some very good fan of it somewhere but not so far to embed it here so deeply
Edited: three diff interpo: cmd too; futhermore the verbatim strings can may be blocked from reuse there. No interpo in md"…$foo…" AFAIK