modern_perl_book icon indicating copy to clipboard operation
modern_perl_book copied to clipboard

pg 82 (pdf ) Closures and partial Application - why anonymous subroutine?

Open legrady opened this issue 13 years ago • 1 comments

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

legrady avatar Feb 28 '11 22:02 legrady

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?

chromatic avatar Nov 14 '11 21:11 chromatic