4 ms·
To those who find "that all those brackets in Lisp were off-putting and weird", look no further than C++: [](){} is valid syntax for a lambda. (I think in
by Koshkin 5y ago
To those who find "that all those brackets in Lisp were off-putting and weird", look no further than C++:
[](){}
is valid syntax for a lambda. (I think in C++20 you can also stick in < > somewhere in between.)
Lisp's S-expressions are just acquired taste (like coffee of a particular blend).
- kccqzy 5y agoThe following are all valid too: []{} []{}() [](){}()
- opportune 5y agoDoesn’t look weird to me, that’s just an empty lambda. Pretty recognizable for anybody who works with lambdas, IMO - it’s just an empty capture with no parameters and no body. Not something you would ever see in real code unless doing something very weird.
- owl57 5y agoStrange in fact that we don't recall seeing this in real code. An empty callback smells a bit sloppy but not really weird.
- owl57 5y agoSee? Lispers sneaked in, distracted everyone with all these lambdas and closures and put their brackets all over the place.
- fishmaster 5y agoOpen and shut case, Johnson!