Mathematica Stack Exchange is a question and answer site for users of Mathematica. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

According to a Mathematica textbook, we can write N[x,n] by using infix notation as x ~ N ~ n. How about other functions with one argument or more than 2 arguments, is it possible?

share|improve this question
up vote 12 down vote accepted

One can use Sequence for such purposes




x1~f~Sequence[x2, x3]

f[x1, x2, x3]

share|improve this answer

If, in an input cell, you type the expression,

x1 ~ f ~ x2 ~ f ~ x3

it will evaluate to


UNLESS the symbol f has the attribute Flat in which case it will evaluate to

share|improve this answer

From the Infix[] documentation page, you can:

x1 ~ f ~ x2 ~ f ~ x3 ~ ... === Infix[f[x1,x2,x3,...]]
share|improve this answer
How about functions with one argument? – kiss my armpit Dec 28 '13 at 22:11
Did you actually try what you wrote above? This is wrong. Infix notation is primarily for 2 argument functions and works for multiple arguments when the function is Flat. The Infix function that you refer to is only a typesetting function. – R. M. Dec 28 '13 at 22:13
@StiffJokes I'd use @. edit: @rm -rf: Is the documentation wrong? – shrx Dec 28 '13 at 22:13
@shrx It's confusing, especially since F1 on ~ takes you there... the Infix function is more for typesetting than the function calls notation. For instance, Prefix[f[x]] will give you f@x, but this f@x is not equivalent to typing out f@x (try evaluating the two). Check out the full forms: Infix[f[x1, x2, x3]] // FullForm and x1~f~x2~f~x3 // FullForm – R. M. Dec 28 '13 at 22:19
@rm-rf Oh! I miss the times when those were hot themes here .) – Dr. belisarius Dec 29 '13 at 5:50

Your Answer


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.