title: What are the precise rules for when you can omit parenthesis, dots, braces, = (functions), etc.?
body: <p>What are the precise rules for when you can omit (omit) parentheses, dots, braces, = (functions), etc.?</p>
  
  <p>For example, </p>
  
  <pre><code>(service.findAllPresentations.get.first.votes.size) must be equalTo(2).
  </code></pre>
  
  <ul>
  <li><code>service</code> is my object</li>
  <li><code>def findAllPresentations: Option[List[Presentation]]</code></li>
  <li><code>votes</code> returns <code>List[Vote]</code></li>
  <li><em>must</em> and <em>be</em> are both functions of specs</li>
  </ul>
  
  <p>Why can't I go:</p>
  
  <pre><code>(service findAllPresentations get first votes size) must be equalTo(2)
  </code></pre>
  
  <p>?</p>
  
  <p>The compiler error is:</p>
  
  <blockquote>
    <p>"RestServicesSpecTest.this.service.findAllPresentations
    of type
    Option[List[com.sharca.Presentation]]
    does not take parameters"</p>
  </blockquote>
  
  <p>Why does it think I'm trying to pass in a parameter? Why must I use dots for every method call?</p>
  
  <p>Why must <code>(service.findAllPresentations get first votes size)</code> be equalTo(2) result in:</p>
  
  <blockquote>
    <p>"not found: value first"</p>
  </blockquote>
  
  <p>Yet, the "must be equalTo 2" of
  <code>(service.findAllPresentations.get.first.votes.size)</code> must be equalTo 2, that is, method chaining works fine? - object chain chain chain param.</p>
  
  <p>I've looked through the Scala book and website and can't really find a comprehensive explanation.</p>
  
  <p>Is it in fact, as Rob H explains in Stack Overflow question <em><a href="https://stackoverflow.com/questions/1006967/scala-which-characters-can-i-omit">Which characters can I omit in Scala?</a></em>, that the only valid use-case for omitting the '.' is for "operand operator operand" style operations, and not for method chaining?</p>