Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions src/main/scala/stdlib/HigherOrderFunctions.scala
Original file line number Diff line number Diff line change
Expand Up @@ -46,11 +46,13 @@ object HigherOrderFunctions extends FlatSpec with Matchers with org.scalaexercis
result should be(res0)
}

/** {{{
/** Here the only variable used in the function body, `i * 10`, is `i`, which is defined as a parameter to the function.
*
*{{{
* val multiplier = (i:Int) => i * 10
* }}}
*
* Here the only variable used in the function body, `i * 10`, is `i`, which is defined as a parameter to the function.
* A closure is a function which maintains a reference to one or more variables outside of the function scope (it "closes over" the variables). Scala will detect that you are using variables outside of scope and create an object instance to hold the shared variables.
*/
def meetClosureHigherOrderFunctions(res0: Int, res1: Int) {
var incrementer = 1
Expand Down