title: pass existing function as parameter to another function in Swift 3
body: <p>Im new to swift and was trying to find way to pass function as a parameter to another. My code structure is like below</p>
  
  <pre><code>func createDictionaryFromParams(param1: [String:String], param2: String, param3: String) -&gt; [String:String] {
     param1["name"] = "John"
     param1["university"] = param2
     return [:]
  }
  func toPassAsParam() -&gt; [String:String] {
     //doStuff
     return [:]
  }
  
  public struct passFunction {
     let dict = createDictionaryFromParams(param1: toPassAsParam(), param2: "Texas", param3: "Florida")
  }
  </code></pre>
  
  <p>When I execute above code in playground/in my application i get error as "cannot assign through subscript: param1 is a let constant"</p>
  
  <p>Not sure where Im going wrong. Please guide me. Please refer screenshot of exact code in playground<a href="https://i.stack.imgur.com/vrBEn.png" rel="noreferrer"><img src="https://i.stack.imgur.com/vrBEn.png" alt="enter image description here"></a></p>