It was the revenge of the nerd. Walter F. Mondale, the teacher's favorite, the kid with the books, the one who studied the issues and believed that leadership is linked to competency, finally got Ronald Reagan away from the campaign sound stage and onto the debate stage -- and whomped him. He won one against the Gipper.

There is sweet irony in that. Mondale was underestimated, billed as the patsy, the wimp who would be going up against the Great Communicator. As it was once with Reagan, the man had been turned into a caricature -- a bumper sticker with a voice like chalk on the blackboard. The Great Communicator would communicate and Mondale would be finished.

But the Great Communicator turned out to have little to say, and what he said often did not scan. He said, for instance, that devout as he was he could not risk attending church because of the danger of terrorist attack. He did not say why he did not invite a minister to the White House or why he felt secure enough to campaign. After all, any terrorist with access to a newspaper knew the president would be debating Mondale here. He excused it all by saying that he thought "the Lord understands." That may or may not be the case, but if it is, He is the only one who does.

Reagan also hit a logical low point on the issue of abortion. His belief that it is tantamount to murder is evidently sincerely held, but when he likened the "personal choice" Mondale demanded to the one "a murderer is insisting on -- his or her right to kill someone because of whatever fault they think justifies that," a painful moral dilemma was trivialized. Few killers think they're morally justified -- and if they do, they're usually insane.

Experience in office -- and maybe age -- has taken a toll on the president. He no longer has the comic-book convictions he once had. The magic prescriptions for the economy may have worked, but not in the way he said. He described the sudden blooming of a massive deficit as a virtual act of God, and not as an economic plan gone awry. He kind of hoped it would go the way it came -- however that was.

As for Reagan's closing statement, it was a meandering stroll through fragmented themes -- a bramble of economic statistics, a paean to the military, a reference to things not mentioned ($500 hammers) and an evocation of the spirit of Thomas Paine. Sweet youth is gone and with it the innocent convictions that government can do no good. The welfare queen was retired, Social Security was exalted and the wisdom of the kitchen cabinet junked.

Still, debating is not the country's national sport -- not an Olympic event. Mondale's command of the facts, his unexpected poise, his agility at balancing respect for the presidency with not a lot for the man, does not blunt the effect of the economic recovery or tarnish the cheap glitter of the Grenada invasion. It does not put more people on the unemployment lines or raise the rate of inflation.

All these are Reagan triumphs, real or perceived, planned or lucky. They fuel the Republican juggernaut, and a nation addicted to buying on credit likes its politics the way it does its shopping: immediate gratification, please. Mondale's specter of the bill collector coming to repossess the recovery may be prescient, but it's hardly compelling.

Mondale won on points, but Reagan committed no major gaffe -- unless it was to resurrect his "There you go again line" -- sort of like Judy Garland resorting to "Over the Rainbow," when her act was flagging. Mondale, though, proved he is the smarter man, the more competent one, the one who hits the books, who does not have to be told that missiles once launched cannot be called back.

But after the debate was over, the women who were serving food in a lounge near the press section, abandoned their steam tables and ran into the street to see the president leave the hall. It could be that Ronald Reagan lost the debate but won the girl anyway. Or it just could be they were saying goodbye. In life, as in the movies, the nerd sometimes gets revenge.