News for hackers. Stuff that matters.
Re:C++14 lambda tutorial by TillE on Thursday August 28, 2014 @10:04AM (#8237223)
Not shown in this article are all the things you can do within the [] (typically just [&] or [=]), which turns a simple lambda into a closure.

The syntax is a bit arcane, but it does what it needs to. They could've stuck a "lambda" keyword in front of it all, but it's not necessary, and making a new keyword always has the potential to break old code.

Re:C++14 lambda tutorial by guidopallemans on Thursday August 28, 2014 @10:58AM (#8237493)
is it possible to do

#define lambda []

?

Re:C++14 lambda tutorial by Kronopath on Thursday August 28, 2014 @11:16AM (#8237600)
I think that's possible, but I would strangle anyone who actually did that. At that point, not only are you pointlessly redefining the language just so it can feel slightly more familiar to people who are more comfortable with Python and the like, but you also completely lose the ability to enclose variables in the square brackets to make a closure.

If you're going to write C++, then write C++. Don't redefine language constructs to fit the patterns of your other favourite language.

Re:C++14 lambda tutorial by leni536 on Thursday August 28, 2014 @11:56AM (#8237845)
I think you can

  #define begin {
  #define end   }
too. I would not suggest it though.
Re:C++14 lambda tutorial by kps on Thursday August 28, 2014 @01:49PM (#8238651)