4 ms·
> The only feature of lambdas that a proper nested function would miss is the "copy capture". Yeah, reference by default would fit with what people probably ex
by xscott 6y ago
> The only feature of lambdas that a proper nested function would miss is the "copy capture".
Yeah, reference by default would fit with what people probably expect from other languages, but without a garbage collector (or similar) that's only valid for downward passed functions. Copying allows your nested function to escape the lifetime of the calling function, which might require some other/additional syntax.