Breaking ";" rule with lambda functions

Ali Çehreli acehreli at yahoo.com
Tue Aug 9 18:10:25 UTC 2022


On 8/2/22 09:40, pascal111 wrote:

 > Maybe I'd wrong beliefs about lambda function. It's already in C++, so
 > it's a traditional feature

Lambdas are a common feature of many programming languages. C++ got 
lambdas in their C++11 release, many years after D and many other 
languages had them. (It is not common for the C++ community to give 
credit. Most of their features are presented as C++ inventions when they 
are not. For example, almost the entirety of the C++11 features already 
existed in D (and other languages before D).)

 > but the problem is that I didn't use it
 > before because I didn't study C++ yet.

C++ is the new-kid-in-the-block when it comes to lambdas.

Getting back to lambda syntax, you don't have to use the shorthand => 
syntax. I try to explain how various syntaxes relate to each other:

   http://ddili.org/ders/d.en/lambda.html#ix_lambda.function,%20lambda

My book is freely available and I think is better than the documentation 
you've shown earlier, which apparently included copies of my text:

   http://ddili.org/ders/d.en/index.html

You can find most of your questions about keywords and syntax in the 
index section:

   http://ddili.org/ders/d.en/ix.html

Ali



More information about the Digitalmars-d-learn mailing list