Initialize a vector with map-into

Novices who want an array of distinct things sometimes write something like this, where make-foo returns a fresh object of some sort:

(make-array 42 :initial-element (make-foo))

This actually creates a vector containing the same identical (eq) object at all 42 indexes. The initial-element argument is evaluated only once to produce the result, and the result is used 42 times to initialize the vector.

42 distinct things can be obtained like this:

(map-into (make-array 42) #'make-foo)

map-into calls make-foo 42 times and returns the initialized array as its result.