BT

InfoQ Homepage News Lambda Expression Improvements for VB

Lambda Expression Improvements for VB

Bookmarks

For VB developers it is a toss-up for the most frustrating thing about anonymous functions. In no particular order they are:

There is no way to create an anonymous subroutine, i.e. a function that doesn’t return a value. This means VB developers cannot directly use any method requiring an Action(Of T) such as IEnumerable.ForEach.

Next up is the lack of multi-line anonymous functions. While merely frustrating at this point, it will become downright critical in the near future. Several of the coding patterns needed to use Parallel FX, including the very promising Parallel.For loop, all but require the use of multi-line anonymous functions.

Finally there is the syntax. When you have to use several anonymous functions in a single line the syntax just feel clumsy.

Well for two of these the solution is at hand. While Paul Vick made no promises, the next version of VB is all but certain to have anonymous subroutines and multi-line functions.

As for the syntax, who knows? C# changed theirs when they moved from 2.0 to 3.0, so it wouldn’t be completely unreasonable for VB to do the same. But then again, there are no obvious candidates and VB traditionally solves this type of issue with IDE enhancements.

Rate this Article

Adoption
Style

Hello stranger!

You need to Register an InfoQ account or or login to post comments. But there's so much more behind being registered.

Get the most out of the InfoQ experience.

Allowed html: a,b,br,blockquote,i,li,pre,u,ul,p

Community comments

Allowed html: a,b,br,blockquote,i,li,pre,u,ul,p

Allowed html: a,b,br,blockquote,i,li,pre,u,ul,p

BT

Is your profile up-to-date? Please take a moment to review and update.

Note: If updating/changing your email, a validation request will be sent

Company name:
Company role:
Company size:
Country/Zone:
State/Province/Region:
You will be sent an email to validate the new email address. This pop-up will close itself in a few moments.