What is the purpose of Lambda expressions?

Perhaps I’m mistaken, but I had the impression that mainframe performance was primarily bottlenecked by the limited bandwidth of the card punch machines used to input COBOL programs, the switching speed of the vacuum tubes and the pages per minute of the line printer used for output /s :stuck_out_tongue:

(In all seriousness, I am aware of the extremely performance-critical transaction processing application for which the dwindling but still considerable number of s390x and similar type machines handle daily; as a NASA researcher used to working with HPC clusters, I’m obligated to take a dig at my stuffy buisness colleagues, heh)

Performance wise, yeah; I don’t imagine working memory size (as opposed to latency, and to a lesser extent bandwidth) will be particularly critical for that application, and even that is minor, vastly less than that for using Python in the first place and many other tricks; for almost all real applications the choice between def and lambdas should be predicated on maintaining idiomatic usage, i.e. whether the function will be named and used elsewhere, or simply created and immediately passed to another function/method.

1 Like