pass comp-spec as parameter to head-by-comps rather than computing each time, since it depends only on the first parameter head which is invariant with respect to the other params.