Also, this would be a whole lot easier if D got a full built-in tuple support, because then all functions would always take a single argument. :-)
On Thu, Oct 6, 2011 at 10:56 PM, Steven Schveighoffer <[email protected]> wrote: > On Thu, 06 Oct 2011 12:27:16 -0400, Gor Gyolchanyan > <[email protected]> wrote: > >> I see. Thanks for the detailed answer. > > I should clarify one point, I realized I am somewhat inaccurate on the > reason the type is set to immutable(dchar). In fact, nobody actually wrote > the immutable(dchar) function, it's just that the element type is > immutable(dchar). However, the reasons why someone would want to create a > function that takes an immutable(dchar) function are as I stated -- so you > don't accidentally change the value. > > Still no excuse that delegates cannot be implicitly cast to compatible > versions. > >> I just looked up Wikipedia for lambdas in different languages and >> found out, that C# has an awesome syntax for that: >> >> x => x * x >> (x, y) => x == y >> (int x, string s) => s.Length > x >> () => SomeMethod() >> n => { string s = n + " " + "World"; Console.WriteLine(s); } > > In the not so distant past, Walter explored different ways to improve the > lambda syntax on this news group (which included similarities to the above). > This usually means he is considering adding that change, let's hope so :) > > -Steve >
