# Define operator with special characters [duplicate]

I have looked here which describes how to define operators. I was wondering whether there was a way to assign thes operators to special characters? eg Let $\odot:=(a+b)(ab),$ so 4\[CircleDot]3 would yield 84? It is really a stylistic / display issue - of course the same could be achieved with cd[a_,b_]:=(a+b) a b, implemented with cd[a,b].

• Take a look at this question, see if my answer there might help you along: How to assign symbols to functions – MarcoB Jun 19 '15 at 12:32
• @MarcoB I have taken a look at the link, but usure on syntax when it comes to applying it to the example above – martin Jun 19 '15 at 12:38
• I think Karsten took care of that below :-) – MarcoB Jun 19 '15 at 12:46

CircleDot[a_, b_] := (a + b) a b


Now

4⊙3

84

• ha! I didn't think it would be that simple - I thought the operator would have to preceed the arguments - thank you! :) – martin Jun 19 '15 at 12:47
• @martin 4⊙3//FullForm may shed some light on your confusion. Some operators are infix, meaning ⊙ is the same as ~CircleDot~ and we know, that a~CircleDot~b is the same as CircleDot[a,b]. But in fact, you could just as easily set like so: a_⊙b_:=(a + b) a b, MMA would interpret this just like the full form that Karsten showed in this answer. – LLlAMnYP Jun 19 '15 at 13:06
• @LLlAMnYP ah, I see - much like ~Join~ – martin Jun 19 '15 at 13:07
• @martin precisely. When in doubt, always check the FullForm :) – LLlAMnYP Jun 19 '15 at 13:08