Partager via


Req19: Allow statements to start with parentheses

[This post is part of a series, "wish-list for future versions of VB"]

 

IDEA: Allow statements to start with parentheses. Currently, every statement in VB must start with either an identifier or a keyword. We should allow statements to start with arbitrary expressions. At the very least, starting with "open parentheses" would be good. It would mean that we'd no longer need "Call" in the following statement:

  Call (New Threading.Thread(AddressOf ThreadProc)).Start()

 

Provisional evaluation from VB team: It'd be a surprisingly big change to the parser code to implement this! We see that it would be useful, but don't believe it would be worth the effort to fix.

Comments

  • Anonymous
    February 16, 2010
    It’s hardly worth changing if it’s difficult to do so – having to include the ‘Call’ keyword isn’t a big deal.

  • Anonymous
    January 11, 2011
    Actually I've just bumped into a case where the 'Call' keyword I would almost vote to remove it from road... And now realizing that there is a simple workaround (or call it whatever you want) to this thing that exists in C#, and didn't know how to do it inline, I always had to create a variable.

  • Anonymous
    January 11, 2011
    Actually I've just bumped into a case where the 'Call' keyword I would almost vote to remove it from road... And now realizing that there is a simple workaround (or call it whatever you want) to this thing that exists in C#, and didn't know how to do it inline, I always had to create a variable.