From 8986b9d1bc19c68fa114c913b8747736ffd244e7 Mon Sep 17 00:00:00 2001 From: Goran Rakic Date: Fri, 13 Jul 2012 21:11:09 +0200 Subject: [PATCH] Closures and variable scope --- _posts/03-02-01-Programming-Paradigms.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/_posts/03-02-01-Programming-Paradigms.md b/_posts/03-02-01-Programming-Paradigms.md index 8fbee17..338de7c 100644 --- a/_posts/03-02-01-Programming-Paradigms.md +++ b/_posts/03-02-01-Programming-Paradigms.md @@ -53,7 +53,7 @@ print_r($output); Closure is an anonymous function that can access variables imported from the outside scope without using any global variables. Theoretically, a closure is a function with some arguments closed (e.g. fixed) by the environment when it is -defined. This is used to cross variable scope restrictions in a very clean way. +defined. Closures can work around variable scope restrictions in a clean way. In the next example we use closures to define a function returning a single filter function for `array_filter`, out of a family of filter functions.