Home > Microsoft .Net Development Tips > Visual Basic and Visual Basic .NET > Visual Basic 2008 and closures
Win Development Tips:
EMAIL THIS
 TIPS & NEWSLETTERS TOPICS 

VISUAL BASIC AND VISUAL BASIC .NET

Visual Basic 2008 and closures


Brian Eastwood, Site Editor
09.13.2007
Rating: --- (out of 5)


Digg This!    StumbleUpon Toolbar StumbleUpon    Bookmark with Delicious Del.icio.us   


Among Visual Basic 2008's new features is the concept of closures. These allow programmers to access environments like locals, parameters and methods from more than one function. As Jared Parsons, a developer on the Visual Basic compiler and debugger, put it in a recent blog entry, "Closures are the underpinnings for several new features in Visual Basic [2008] They are part of the guts of Lambda and Query expressions."
More on Visual Basic 2008
LINQ and XML programming in Visual Basic 2008

How Visual Basic 2008, Windows Vista appeal to the Visual Basic 6 developer

Parsons recently penned a five-part series that introduces programmers to closures in Visual Basic 2008.

Closures in VB, Part 1 explains how the compiler is able to make a variable available to more than one function. It is a process called "lifting the variable," Parsons notes.

Closures in VB, Part 2: Method Calls looks at the two types of method calls that closures tend to handle -- those that share a method or methods on a module and those that instantiate members of a class.

Closures in VB, Part 3: Scope discusses what happens when variables are lifted from different scopes. "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," Parsons indicates.

Closures in VB, Part 4: Variable Lifetime shows how, and why, the lifetime of a variable is tied to its scope. This was done so Visual Basic 2008 could support lambda expressions, he states.

Closures in VB, Part 5: Looping goes into some of the "unintended consequences" programmers may encounter when simultaneously using looping structures and lambda expressions and explains how to combat these problems.

Finally, for more insight into the new features of VB 2008, check out the Visual Basic 2008 tag on the VB Team blog.

Rate this Tip
To rate tips, you must be a member of SearchWinDevelopment.com.
Register now to start rating these tips. Log in if you are already a member.




Digg This!    StumbleUpon Toolbar StumbleUpon    Bookmark with Delicious Del.icio.us   



RELATED CONTENT
.NET Framework 3.5 and Visual Studio 2008 development
Microsoft's message at TechEd: make the most of what you have
How to speed up Visual Studio 2008's slow WPF designer
How to list fonts in WPF using markup extensions and data templates
How to convince management to buy Microsoft Visual Studio 2008
Moonlight 1.0 release brings Silverlight to Linux
Microsoft cuts Visual Studio 2008 upgrade prices as VS 2010 looms
User Account Control (UAC): How to develop code for standard users
How to write installers in Vista that work correctly under UAC
How to elevate programs' privileges correctly using Vista's UAC
Introduction to Vista's user account control (UAC) for developers

Visual Basic and Visual Basic .NET
Compose XML more quickly using Visual Basic 9
Virtualization keeps Legacy Apps alive
VB 9 Anonymous Types help create flexible objects
Visual Studio Team System Add-ins: Conchango Scrum for Team System and Scrum Dashboard
Book Excerpt: Sams Teach Yourself Visual Basic 2008 in 24 Hours -- Complete Starter Kit
Check out CodePlex for a ton of interesting .NET projects
Book excerpt: Murach's VB 2008
Book excerpt: Printing in Visual Basic 2005
WinForms development using SQL Server 2005 and Visual Basic 2005
Visual Basic 2005 and objects: Building a business object layer

RELATED GLOSSARY TERMS
Terms from Whatis.com − the technology online dictionary
Cosmos  (SearchWinDevelopment.com)
IronRuby  (SearchWinDevelopment.com)
Visual Studio Express (VSE)  (SearchWinDevelopment.com)

RELATED RESOURCES
2020software.com, trial software downloads for accounting software, ERP software, CRM software and business software systems
Search Bitpipe.com for the latest white papers and business webcasts
Whatis.com, the online computer dictionary

DISCLAIMER: Our Tips Exchange is a forum for you to share technical advice and expertise with your peers and to learn from other enterprise IT professionals. TechTarget provides the infrastructure to facilitate this sharing of information. However, we cannot guarantee the accuracy or validity of the material submitted. You agree that your use of the Ask The Expert services and your reliance on any questions, answers, information or other materials received through this Web site is at your own risk.



Database Programming Solutions - .NET XML, Visual Studio LINQ, ORM .NET
About Us  |  Contact Us  |  For Advertisers  |  For Business Partners  |  Site Index  |  RSS
SEARCH 
TechTarget provides technology professionals with the information they need to perform their jobs - from developing strategy, to making cost-effective purchase decisions and managing their organizations' technology projects - with its network of technology-specific websites, events and online magazines.

TechTarget Corporate Web Site  |  Media Kits  |  Site Map




All Rights Reserved, Copyright 2000 - 2009, TechTarget | Read our Privacy Policy
  TechTarget - The IT Media ROI Experts