[Issue 7176] Lambda => syntax for function and methods too

d-bugmail at puremagic.com d-bugmail at puremagic.com
Wed Mar 20 08:21:45 PDT 2013


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



--- Comment #17 from Kenji Hara <k.hara.pg at gmail.com> 2013-03-20 08:21:44 PDT ---
I don't like this feature. Because:

1. it would reduce code readability.

   class LibClass {
     int foo() { return 1; }
     string bar() => "hi";
   }

   Mixing lambda syntax and normal function syntax looks messy.

2. Just only reducing 7 character is too small benefit.

   auto foo()=>expr;
   auto foo(){return expr;}

   With more complex function signature:

   ComplexReturnType!(..) foo(T, U, V)(T t, U u, V v) if (...)=>expr;
   ComplexReturnType!(..) foo(T, U, V)(T t, U u, V v) if (...){return expr;}

   Ratio will fall further.

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