Trieste and Yugoslavia, a distinguished Yugoslav journalist wrote recently, are like two passionate lovers from different social backgrounds. After 30 years of life together, they pretend to have nothing in common. But their fates are inextricably linked: the successes of one make up for the shortcomings of the other.

Between this Italian port at the head of the Adriatic Sea and the communist country that coined the phrase "consumer socialism," there exists a complex love-hate relationship.

A child of the Austro-Hungarian empire, Trieste resembles the scion of a once-great family who has fallen on hard times and now makes money by trading in cheap trinkets.

For its upwardly mobile lover, Trieste represents glamour and affluence. Every day, tens of thousands of Yugoslav shoppers descend on the city, clutching wads of illegally exported dinars. They splash out for goods they cannot find at home. In the 1950s, it was nylon stockings and plastic raincoats. Then came blue jeans, jewels, and spare car parts. Today -- and this is a reflection of Yugoslavia's erratic economic development -- the most sought-after items are coffee and detergent.

The degree to which the economics of Trieste and Yugoslavia are interlocked was illustrated by the 30 percent devaluation of the dinar earlier this summer. Overnight, Yugoslavs found shopping in Italy a third more expensive. Their trade dropped off accordingly.

The shopkeepers certainly have good reason to be worried. According to a Triest University study, Yugoslav shoppers spend about $500 million in the city every year. That amounts to 47 percent of Trieste's total retrail trade, its main source of income. The Yugoslav market is so important that shops accept dinars as readily as lire, despite the fact that the dinar is not fully covertible currency. In Trieste streets, Serbo-Croat can be heard almost as frequently as Italian.

In its heyday, Trieste supplied not only Yugoslavia with jeans and other fashionable items of clothing, but much of Eastern Europe as well. The city is one of the great strating points for Yugoslav-oriented smuggling route that stretches across the Soviet bloc. A pair of cheap Trieste jeans can fetch two or three times its original price in Belgrade and three times as much again in Bulgaria or Romania.

The boom in the jeans trade has made up for Trieste's decline as a maritime port. Unde Austria-Hungary, the city was Eastern and Central Europe's main outlet to the Mediterranean: the solid, graceful buildings along the seafront are a reminder of the city's past prosperity. But stuck out on a disjointed limb of Italy, with its hinterland controlled by Yugoslavia, Trieste has lost its former status. Today, the Yugoslav prots of Koper and Rijecka take much of Austria's seaborne trade and Trieste is left with funneling Arab oil to West Germany.

The city's present dependence on Yugoslavia is one of the great ironies of postwar history. For it was here, 35 years ago, that the first confrontation took place in the Cold War between communism and capitalism. Marshall Tito's partisan army occupied the city for six weeks until forced to withdraw by an ultimatum from the Western allies. At the time, Tito was regarded as the most fanatical follower of Stalin.

For several years, Trieste remained a symbol of what Winston Churchill described a "an iron curtain drawn across Europe." Tensions began to ease in the 1950s only after Tito's break with Moscow when he needed to improve relations with the west. In the 1960s, Yugoslavia became the first communist country to open its borders in both directions. Trieste was transformed from an East-West crisis point into an increasingly Yugoslav-oriented city. What the Yugoslavs failed to achieve by force, they are rapidly gaining by the laws of economics.

One of the best places to find out what Yugoslavs are buying in Trieste is the city railway station. On a recent afternoon in midweek, the place was packed with Yugoslav shoppers waiting to return home. Many were furtively rearranging their belongings to escape detection by the customs. Some cases contained nothing but washing powder and coffee, unavailable in Yugoslavia for most of the last six months.

Despite all the rumors of a dramatic drop in jeans sales, there appeared to be enough of them here to stock a chain of department stores. Old peasants from the mountains of Bosnia were busily packing fake Levis inside each other, folding them carefully to make five pairs resemble one. A young small-time huskster was wearing so many pants on top of each other, his thighs looked like balloons, causing him considerable diffculty in walking.

When Ljublijana-bound train finally arrived, pandomonium broke out. The most experienced travelers climbed in through the windows. Those unable to find seats were left crushed against each other in the aisle.

It was only when we arrived at the frontier that I realized why securing a seat was so important. The Yugloslav customs officials ordered all the standing passengers off the train which left without them shortly afterwards. They were last seen on the platform waiting for their bags to be inspected.

Customs officials confess frankly that they discover only a fraction of the contraband. They have reached a kind of gentleman's understanding with the professional smugglers who cross the border every day: in return for delcaring a token number of jeans or kilos of coffee, they are left alone.

Like all long-lasting love affairs, Yugoslavia'a passion for Trieste has its mysteries as well. If invested at home, the money spent by Yugoslavs in the city would easily be enough to supply the entire country with coffee, detergent and jeans as well. Instead, an army of middlemen has been created on both sides of the border with a vested interest in the malfunctioning of the Yugoslav economy.

The relationship is illogical. But like many aging couples, Yugoslavia and Trieste do not seem to be able to imagine life in any other way.