Take the 2-minute tour ×
Mathematica Stack Exchange is a question and answer site for users of Mathematica. It's 100% free, no registration required.

I defined a binary operator in as the first statement in a new Mathematica notebook.

{x1_, y1_} ⊕ {x2_, y2_} := Module[{}, Print["do anything"];]

where the code in the Module is somewhat more meaningful. My questions:

  1. Why does this not show up in a ?Global`* query?

  2. How can I set the Attributes for this operation to be Flat so it is associative?

  3. Do I need to use the Notations Package to do this "properly"?

share|improve this question

1 Answer 1

  1. Why does this not show up in a ?Global`* query?

    Because you set a definition to CirclePlus which is in the System` context

  2. How can I set the Attributes for this operation to be Flat so it is associative?

    SetAttributes[CirclePlus, Flat]
    

    But now redefine your function so it can take any number of arguments

    CirclePlus[stuff___] := Print@{stuff}
    
  3. Do I need to use the Notations Package to do this "properly"?

    I don't see why, no

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.