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
 In[1] := Hold[a.b] // FullForm
Out[1] := Hold[Dot[a,b]]

So far so good.

 In[2] := Hold[a_.b_] // FullForm
Out[2] := Hold[Times[Optional[Pattern[a,Blank[]]],Pattern[b,Blank[]]]]

Why does the Dot become Times? I have a feeling it has something to do with the Optional that also appears, but I can't find anything that explains what's going on in the documentation.

share|improve this question
up vote 7 down vote accepted

See the documentation for Optional:

The special form s_. is equivalent to Optional[s_] and can be used to represent function arguments which, if omitted, should be replaced by default values globally specified for the functions in which they occur.

This explains the result your are receiving.

Thus, it seems you have a precedence problem, and a possible workaround is:

Hold[(a_).(b_)] // FullForm

and get

Hold[Dot[Pattern[a, Blank[]], Pattern[b, Blank[]]]
share|improve this answer
Even FullForm[Hold[(a_).b_]] is enough since now there are no special forms related to . in the expression. +1. – Kuba Jan 14 '14 at 9:04
I have never seen an application of Optional... – Murta Jan 14 '14 at 10:31
Don't know how I missed that in the docs! Thanks. – Dan Jan 14 '14 at 16:51
A single space will also work: Hold[a_ .b_] // FullForm. @Murta Optional is quite useful. A few examples from my own answers: (17498), (20715), (29366), (30591), (30919), (47844), (51670). – Mr.Wizard Oct 25 '14 at 1:37

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.