[Issue 8634] Anonymous function parameters

d-bugmail at puremagic.com d-bugmail at puremagic.com
Sun Sep 9 06:52:38 PDT 2012


http://d.puremagic.com/issues/show_bug.cgi?id=8634


bearophile_hugs at eml.cc changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |bearophile_hugs at eml.cc


--- Comment #1 from bearophile_hugs at eml.cc 2012-09-09 06:53:14 PDT ---
(In reply to comment #0)
> void foo(int)
> {
> 
> }
> 
> void main()
> {
>     foo(5);
> }
> 
> Although anonymous function parameters may be used in function declarations, it
> seems that dmd doesn't check whether a function declaration is a definition
> too.

What's the problem here?

foo() not giving a name to its first argument means the programmer is stating
foo() never uses its first argument, and the D language allows the programmer
to enforce this desire.

This feature also allows to avoid "unused argument warnings" once/where such
warning is available.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------


More information about the Digitalmars-d-bugs mailing list