3 ms·
is it possible to do #define lambda [] ?
by guidopallemans 12y ago
is it possible to do
#define lambda []
?
- Kronopath 12y agoI 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.
- leni536 12y agoI think you can #define begin { #define end } too. I would not suggest it though.
- kps 12y agoThat way lies http://minnie.tuhs.org/cgi-bin/utree.pl?file=V7/usr/src/cmd/sh/mac.h http://minnie.tuhs.org/cgi-bin/utree.pl?file=V7/usr/src/cmd/...