Can you substitute whole cloves for ground cloves?

You can't really substitute whole cloves for ground cloves in most recipes. For example, in pumpkin pie, whole cloves wouldn't work with the dish.