Closures in VB Part 3: Scope
Posted by: The Visual Basic Team,
on 25 May 2007 |
View original | Bookmarked: 0 time(s)
Jared here again. For previous articles in this series please see
Part 1: Introduction
Part 2: Method Calls
Thus far in the series we've only lifted variables that are declared in the same block/scope. What happens if we lift variables in different scope? The answer is that one closure class will be created for every unique scope where a lifted variable is declared and all of the variables in that scope that are lifted will be placed in that closure. Once again, examples...