This is the complaint from a Soviet Bloc foreigner in Vietnam: "You know, they save their best restaurants for themselves. That means restricted to all foreigners, Soviets included. It doesn't matter who you are, you are foreign and that is something in this country."

Both sides of the foreign community in Vietnam--divided along familiar cold war lines--feel imprisoned behind a high cultural wall. While Vietnam may not be as closed off as China was during the Cultural Revolution, the resident foreigners in Hanoi despair that all they come to know in this country are "Vietnamese shadows," not people.

But the barriers are slowly coming down. A foreigner who teaches Vietnamese students described how life has improved: "At first I had security officers sitting in on the class. They went, but the students still wouldn't talk to me at breaks. Now they do, and they're allowed to read the novels I lend them."

Foreigners are allowed to travel more often through the country and to more places. The diplomats in Hanoi today are not as frustrated or nervous as I found them in August 1979, shortly after the Chinese invasion and the imposition of the American-led sanctions program against Vietnam, when a number of embassies were unsure of their future here.

Those days are past. The foreign community is a settled fixture here.

Single-handedly the embassies are "gentrifying" the otherwise graying city of Hanoi. They are repairing and painting their chancelleries and residences, some of the most majestic buildings in this former colonial city. Nowhere is this effort more pronounced than in the French Embassy compound, once the headquarters of Brasseries et Glasseries d'Indochine, the former French beverage and ice cream monopoly here.

The French are the rising favorites in the foreign community. The French foreign minister received the Vietnamese foreign minister last year in Paris, not only at his office but in his home. The French offered the Vietnamese a $29.8 million credit line and appear willing to ignore Vietnam's outstanding debts. They are improving the instruction of the French language in Vietnam. All these actions are seen here as clear rebuttals to the American sanctions program, and Vietnam has returned the favors.

Last winter the French reopened their cultural center in Ho Chi Minh City, formerly Saigon. At France's insistence, the Vietnamese freed some prisoners from their reeducation camps. Diplomats here contend that the French get better briefings from the Vietnamese than other westerners, and they are granted appointments promptly.

The French tend to downplay their own significance. "We just want the Vietnamese to know there is a way out if they want to pull away from total dependence on the Soviet Union," one diplomat said.

Another French official added: "We can be a window for them on the West, for science and technology."

In fact, the French are also the window for the West into Vietnam. Agence France-Presse is the only noncommunist western news company with a correspondent based in Vietnam, and western governments as well as newspapers have come to rely on its reporting. Air France is the only noncommunist airline allowed to fly into Ho Chi Minh City; its Thursday flight arrives filled with mail and parcels for Vietnamese from abroad and departs just as full with refugees and travelers to the West.

It is in Ho Chi Minh City that the French presence is most startling. The French language is back to its former prominence; English is rarely heard. In the French consulate, the only noncommunist mission allowed in the city, officials are besieged by about 24,000 letters each year requesting the right to emigrate. The French can take up to 150 refugees each month and they follow certain priority lists that include mixed-blood progeny of the old Indochinese Army metis who have waited 27 years for a visa to France.

At the newly opened cultural center, renamed the Institute of Cultural Exchange with France, Vietnamese are signing up for language courses in hopes that they will be accepted for French universities when a program opens in the near future. Yet the cultural affinity of the French and Vietnamese has not been translated into strong commercial ties. The French business community remains more cautious than the Japanese.

Even though Tokyo officially supports the American sanctions program, its private businessmen have made Japan Vietnam's chief nongovernment trading partner in the past year. According to Agence France-Presse figures, Japan did $150 million in trade with Vietnam in 1982, mostly with Ho Chi Minh City.

But all western presences pale next to the Soviet influence in Vietnam.Like Americans in South Vietnam during the war, Soviet Bloc experts here complain of the difficulty of persuading the Vietnamese how to run their country, of their attitude that foreign aid is their right, of their impudence.

Here is one story, slightly altered to protect a source, that is told within the Soviet Bloc community: A minister from a bloc country reportedly came to Hanoi for ministerial-level meetings on economic cooperation. When the Vietnamese minister realized the bloc country was not giving Hanoi the aid it had asked for, he exploded in anger, saying: "We got rid of the French, we fought the Americans and we'll get rid of you, too." The visiting minister picked up his papers and left the room.

In the south, Vietnamese shopkeepers complain about the Soviets and call them "Americans without dollars." But Soviets are not treated like ogres--just the new foreign patrons.

Touring a few cafes in Ho Chi Minh City with a Soviet who spoke Vietnamese, and naturally being mistaken for a Russian, I found our reception much the same as Americans used to get before 1975. In a simple soup shop, the Vietnamese sent over a bottle of local rice alcohol to the Soviet diner, and then plagued him with endless toasts to "Vietnamese-Soviet friendship." But in a private night club crowded with wealthy young Vietnamese, the Soviet was no more than a curiosity, allowed to drink his whiskey in peace.

Most distinctions within the foreign community melt when it comes to the question of settling accounts. Vietnam demands dollars. All foreigners from capitalist countries must pay official accounts in dollars. Vietnam has become such a dollar economy that many Soviet Bloc countries pay their resident employes in Hanoi part of their salaries in the U.S. currency.

The race for the greenback heightens the sense that one major foreign presence is missing in Vietnam--the American. About the only exception is found in Ho Chi Minh City, where once a week two tables at Tansonnhut Airport become a momentary outpost of the U.S. government.

Every Thursday two Foreign Service officers arrive on the morning Air France flight from Bangkok, process about 100 Vietnamese already accepted for emigration to the United States, then board the same airplane that returns to Bangkok in the afternoon with the refugees.

The refugees wait in line. A Vietnamese air hostess calls out their names over a megaphone and a family moves up to a table. A Foreign Service officer asks the woman a routine question in Vietnamese so he can certify her travel documents. But neither she nor her two young sons speaks Vietnamese. The American switches to French but has no luck. Finally he tries his limited Cantonese and it works. She is a Sino-Khmer married to a Vietnamese who long ago emigrated to the United States. The problem is solved.