"one of the benefits of closures/lambdas/whatever you want to call thems is how ...
Lynnesbian :bune_ylw: @lynnesbian@fedi.lynnesbian.space
"one of the benefits of closures/lambdas/whatever you want to call thems is how compact they are. the syntax for the identity closure could be as simple as a = x -> x, whereas an equivalent function might look like fn a(T x) -> T { return x }".
rust: well, we're known for being pretty verbose... how does |x| x sound?
python: got it. we love concise code so much that we made else if into elif. let's use a five-letter keyword for closures. the identity closure is lambda x: x
c++: got it. the identity closure is [](auto x){return x;}