modern_perl_book
modern_perl_book copied to clipboard
pg 82 (pdf ) Closures and partial Application - why anonymous subroutine?
On pg 82 of the pdf version, Closures and Partial Application applies default arguments to a routine by invoking it from another routine. But making it an anonymous routine assigned to a variable is irrelevant to the topic. If anything, the addition of a de-referencing arrow between variable name and argument list confuses the topic
I'm not sure how to explain partial application without using higher-order functions. Certainly you can perform partial application and install the results in a namespace, but you lose some genericity that way.
By this point in the chapter, I hope people understand closures well enough that closing over parameters to another function is sufficiently clear.
I wonder if I'm missing your point though (or if my edits to the second edition have rendered it moot). If so, can you clarify?