A few pages ago, we wrote the blocks

list all pandigital numbers between min and max list all factorions between min and max

The functionality of these blocks (and, probably, your implementations of them) bear a striking resemblance to one another. Computer scientists love generalization, so let's make a block that can accomplish the duties of both of the above blocks. Since the main difference between the two is what predicate they use, we'll add that as in input. Hint: when writing the block below, call will be quite useful.

list all numbers with property between min and max

Once you've written this block, try running it like this:

list all numbers with property pandigital between min and max

list all numbers with property factorion etween min and max

Does the output match the "list all" blocks from earlier?

Now, imagine you're given a new predicate, such as:

is number even?

and want to write the block

list all even numbers between min and max

Wait! Doesn't this sound pretty familiar? This problem can be easily solved using the general block we just created (you don't actually have to solve this one)

The beauty of abstraction: build once, use over and over again! When we wrote the list all numbers with property block, we didn't know that we'd ever want to list even numbers! But since we generalized properly, we were able to use the block to solve a future problem.