BT

Lambda Expression Improvements for VB

| by Jonathan Allen Follow 637 Followers on Jul 30, 2008. Estimated reading time: 1 minute |

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 Stage
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.

Tell us what you think

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

Email me replies to any of my messages in this thread
Community comments

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

Email me replies to any of my messages in this thread

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

Email me replies to any of my messages in this thread

Discuss
BT