  We present a new semiclassical theory for describing pairing in finite Fermi
systems. It is based on taking the $\hbar \to 0$, i.e. Thomas-Fermi, limit of
the gap equation written in the basis of the mean field (weak coupling). In
addition to the position dependence of the Fermi momentum, the size dependence
of the pairing force is also taken into account in this theory. Along isotopic
chains the Thomas-Fermi gaps average the well known arch structure shown by the
quantal gaps. This structure can be almost recovered in our formalism if some
shell fluctuations are included in the level density. We point out that at the
drip line nuclear pairing is strongly reduced. This fact is illustrated with
the behavior of the gap in the inner crust of neutron stars.
