Linked Questions

25
votes
3answers
2k views

How is + as an infix operator associated with Plus?

How is + associated with Plus? Suppose I want to define a head FooBar and have it ...
33
votes
2answers
2k views

Going full functional (Haskell style)

I'm trying to define some notation so that Mathematica code would be more functional, similar to Haskell (just for fun): currying, lambdas, infix operator to function conversion, etc.. And I have some ...
14
votes
3answers
684 views
11
votes
2answers
146 views

Left-associative Apply

Often I want a version of @ that is left-associative (might not be using that term correctly). What I mean is I'd like some operator ...
7
votes
2answers
814 views

How to make a binary function associative? (Or define an n-ary function?)

Suppose I have a simple function that I assign to an operator f[a_, b_] := a + b CirclePlus = f Then I want to write ...
10
votes
2answers
394 views

Change associativity of the @ operator

The @ operator in Mathematica is right-associative by default, i.e. f@g@h evaluates as f@(g@h) Is it possible to make the ...
9
votes
2answers
259 views

Which operators are missing from the official precedence table?

I often use the Operator Input Forms page as a reference for operator precedence as well as which (used or unused) operators exist. However, I just noticed that at least one operator is missing from ...
5
votes
2answers
145 views

How to construct infix operator with usual behavior?

I am trying to define my own infix operator and having problems with strung-together evaluation. The code below is a simple example. What I would like is to have the operator treated associatively, ...
5
votes
2answers
180 views

How do I mimic the functionality of “<>”?

The Cell expression for: <> is Cell[BoxData["<>"], "Input"] However similar expressions are parsed into RowBox(...
2
votes
2answers
223 views

How to define a number of infix operators with predefined relative precedences

Reading a number of questions about infix operator notations I want to ask if somebody could reimplement the problem below in a simpler way, say modifying ...
10
votes
0answers
331 views

Create a new infix operator [duplicate]

It is well known that the infix operator @@ is used as a short form of Apply. For example, both ...
1
vote
0answers
145 views

Is there any way to define a new binary operator? [duplicate]

I am looking to define a new operator that would work similarly to the + or - operator. My end goal is to make a dice operator for calculating random distributions in the normal d20 fashion (e.g. 5d6 ...
2
votes
1answer
59 views

Getting all Unicode input forms with a certain property

I want to find all of the Unicode input forms with a certain property, (say, the Unicode input forms for infix operators). How can I do this?