Bug 13553 – allow to omit parenthesis for nullary lambdas

Status
RESOLVED
Resolution
WONTFIX
Severity
enhancement
Priority
P1
Component
dmd
Product
D
Version
D2
Platform
x86_64
OS
Linux
Creation time
2014-09-29T00:29:00Z
Last change time
2014-09-29T21:01:20Z
Assigned to
nobody
Creator
code

Comments

Comment #0 by code — 2014-09-29T00:29:31Z
Requiring empty parenthesis for lambda expressions without arguments is superfluous syntax. onEvent(() => doSomething()); onEvent(=> doSomething());
Comment #1 by bearophile_hugs — 2014-09-29T02:16:15Z
This saves only two chars and decreases readability.
Comment #2 by code — 2014-09-29T21:01:20Z
> This saves only two chars and decreases readability. It's probably more a question of taste. Some languages require the parenthesis, others don't. I have a pull for it, but don't want to start a pointless debate.