We define some new polynomials associated to a linear binary code and a har
monic function of degree k. The case k=0 is the usual weight enumerator of
the code. When divided by (xy)(k), they satisfy a MacWilliams type equality
. When applied to certain harmonic functions constructed from Hahn polynomi
als, they can compute some information on the intersection numbers of the c
ode. As an application, we classify the extremal even formally self-dual co
des of length 12.