title: Scala how to use defaults without redefining them
body: <p>I have a function defined as:</p>
  
  <pre><code>def par(min: Int = -1, exact: Int = -1, auto: Boolean = false) = {
    require(min &gt; 0 || exact &gt; 0 || auto, "Invalid argument")
    OpPar(drm, minSplits = min, exactSplits = exact)
  }
  </code></pre>
  
  <p>In another function that uses this I pass in Options for the <code>par</code> params. I would like to allow <code>par</code> to use it's own defaults but don't see how to do that in Scala (without ugly logic) so I have to redefine, in effect, the defaults like this.</p>
  
  <pre><code>drmARaw.par(
    min = minPar.getOrElse(-1),// if par changes this may the be wrong default
    exact = exactPar.getOrElse(-1),// if par changes this may the be wrong default
    auto = autoPar.getOrElse(true))
  </code></pre>
  
  <p>If the defaults ever change this will pass the wrong defaults to <code>min</code> and <code>exact</code>. Using complicated logic I can decide which version of <code>par</code> to call based on which <code>Option</code> params are <code>nonEmpty</code> for <code>minPar</code> and <code>exactPar</code> but this is pretty ugly and would have to be written differently for every function with default params. This situation occurs with virtually every Scala lib out there. If they change the defaults and I don't notice it, my code will break.</p>
  
  <p>The example above illustrates the problem but I'm looking for a Scala idiom that would cover <em>every</em> case where a function has defaults that could change. I want to write code that is independent of default param changes in lib functions.</p>