title: Function is not being lazily evaluated
body: <p>In below code I'm testing my understanding of Scala lazy evaluation.</p>
  
  <p>I'm attempting process a collection just once within a function definition. But as can be seen below <code>processMap</code> is invoked multiple tiems. Should it not just be invoked once ?</p>
  
  <pre><code>  val a = Array( ("1" , "1") , ("2" , "2"))       //&gt; a  : Array[(String, String)] = Array((1,1), (2,2))
  
    def toLazyMapDef(aparam : Array[(String, String)]) = {
      lazy val toMap = processMap(aparam)
      toMap
    }                                               //&gt; toLazyMapDef: (aparam: Array[(String, String)])scala.collection.immutable.Ma
                                                    //| p[String,String]
    def processMap(aparam : Array[(String, String)]) = {
  
      println("in processMap")
      aparam.toMap
    }                                               //&gt; processMap: (aparam: Array[(String, String)])scala.collection.immutable.Map[
                                                    //| String,String]
  
    println(toLazyMapDef(a))                        //&gt; in processMap
                                                    //| Map(1 -&gt; 1, 2 -&gt; 2)
    println(toLazyMapDef(a))                        //&gt; in processMap
                                                    //| Map(1 -&gt; 1, 2 -&gt; 2)
    println(toLazyMapDef(a))                        //&gt; in processMap
                                                    //| Map(1 -&gt; 1, 2 -&gt; 2)
  </code></pre>