A cartoon in a recent issue of The New Yorker Magazine captures the popular attitude toward the stock market these days. A balding fiftyish man is standing in a crowded room, holding a drink in his hand and talking to a woman 20 to 25 years his junior. "Nine years ago, I quit the brokerage business to become a fulltime, professional partygoer," he says.

"I have never regretted that decision."

It's not quite nine years ago since anyone said anything good about the stock market, but maybe it's seven or eight. There's a snide streak in the conventional wisdom that says investing in anyting -- say, patchwork quilts -- is smarter than stocks.

Now comes the crowning blow: a cover story in Business Week magazine declaring "The Death of Equities -- How Inflation is Destroying the Stock Market." That peeved Wall Street. Then days later, the country's largest stock broker fired back in a series of major media advertisements: "Merrill Lynch says, bull."

To make sense of this argument, you should remember that the stock exchange is both a gambling house and a marketplace for raising capital. If you view the exchange as a gambling house, Merrill Lynch is almost certainly right. Even when the average stock isn't performing well, there are usually plenty of winners -- more than at the horse races or blackjack tables. Last year, for example, about half of the 1,500 stocks traded on the New York Stock Exchange rose in value and half went down; of the half that rose, the price of more than 160 jumped by 40 percent or more. In the past two years, some small companies have experienced spectacular stock price increases.

As a source of new capital, though, the stock exchange's future is more unsettled and more important. Although corporations meet most of their capital needs from reinvested profits and the cash flow from depreciation (the obsolescense rate for machinery, which is allowed as a tax deduction), there remains a vital residual need for some firms -- new companies or those with large or risky expansion plans -- to raise fresh funds by selling more stock.

But investors won't buy if they think that stocks won't match the returns of competing investments, never mind exceed them, which -- because stocks are riskier -- they should. And over the past decade, stocks clearly haven't kept up.

The New York Stock Exchange index for example, includes all the issues traded on the Big Board, weighted according to their importance which is why it is a better indicator than two other widely quoted (but incomplete) indicators. Standard & Poor's and the Dow Jones. On Dec. 31, 1965, the NYSE index stood at 50. In late August 1979, it hovered about 62 -- a 24 percent gain during a period when consumer prices rose about 125 per cent. During this period, dividends crawled up from about 3 percent of stock value to slightly less than 5 percent, which isn't as good as money in a passbook savings account.

Such arithmetic explains the widespread disillusionment with stocks -- a disillusionment exemplified by the sharp decline in individual ownership during the 1970s. People who got into stocks in the late 1960s were badly burned; the exchange's index today is actually lower than it was in 1973. Between 1970 and 1975, the number of individual shareholders dropped by nearly one-fifth, to 25.3 million.

But this sort of arithmetic is slightly unfair and somewhat silly, too. In any investment what happened yesterday is interesting, but what happens tomorrow is what counts. To a large extent, the real (after inflation) decline in stock values over the past decade occurred mostly in the early 1970s, reflecting a collective judgment that the prices in the go-go years simply had gotten too high.

In 1968, for example, the average stock in the Dow Jones index sold for about 16 times its profits: If the company earned$1 a share, the stock would sell for $16. Now, this price-earnings ratio is about 8; for a $16 stock price, profits would have to be $2 a share.

To judge the general outlook for stocks today, you need to know the answers to two questions. Will the price-earnings ratio sink any further? And what will happen to profits? Company profits average about 11 percent to 14 percent of stock values, which is about 2 per- cent to 5 percent better than long-term, high-quality bonds. If the price-earnings ratio doesn't keep dropping and inflation doesn't obliterate profits, stocks should be as good a hedge against inflation as many other investments and better than some.

Unfortunately, no one knows the answers to these questions. Since 1976, profits have kept pace with inflation, indicating, as Merrill Lynch says, that business has learned to adjust. In general, this is a good thing, because it means that inflation isn't creating an acute corporate cash squeeze which, by suffocating investment, simply would cause more problems later.

But this conclusion demands one important qualification. Through the tax system, inflation does funny things to corporate profits. Businesses can deduct depreciation expenses only on the basis of the original cost of machinery, not what it now costs to replace it -- which is the purpose of depreciation. This means that inflation imposes an extra tax burden that reduces the value of reported profits, which in turn may be discounted by the stock market in a lower price-earnings ratio. It isn't clear how much rising business profits have compensated for this effect since 1976.

Many Wall Street analysts now think stocks are poised for a large price rise, that they have been discounted to death, that the current economic slowdown won't reduce profits as much as it does interest rates and a huge tide of money -- now committed to short-term investments -- is ready to flood the market.

Maybe. But all such prognostications depend on the nature of the society being forged in today's inflationary climate. Rising profits occurred during a period of rapid economic growth, but what will be the relation of profits and interest rates in a period of slow growth and high inflation? How will the inflationary process -- and government -- divide the national pie between capital and labor? How will people's vision (and investment decisions) be distorted? Only the professional partygoer knows those answers.