William Joseph Hamilton is 80 and among the oldest inmates at the District of Columbia Correctional Facility at Lorton. He is a small, solitary figure who often spends his time walking the prison yard in a Navy blue pea coat and gray cap and carrying a well-polished brass trumpet on which he occasionally plays a few melodic runs and a whispery, almost breathless version of Taps.

Hamilton was 75 when he came to Lorton, sentenced to seven to 21 years for murder after he shot another man during a scuffle over a woman.

Today, he lives in a nine-man annex to "9 Dorm," one of three residences set aside for the prison's 49 senior citizens--the men over 43. His bed is neatly made with white sheets and a gray prison spread, its maintenance his only daily task. He keeps his trumpet in a leather, shotgun-style holster that another inmate made for him. Two years from now, he'll be eligible for parole.

"I'm not able to do anything but play this horn," Hamilton said last week. "You're not safe here. I want another chance at life. I don't want to pass away in a place like this. I'd like to get outside and wait on the Lord, if you know what I mean."

Among the 1,300 inmates in Lorton's medium security facility, where Hamilton is housed, 36 are between the ages 43 and 47, nine are between 48 and 53, three are over 54 and one does not know how old he is, according to the 1981 D.C. Department of Corrections population report.

Last week, a D.C. Superior Court judge placed William Lewis, a 57-year-old cabdriver, on probation for manslaughter, saying Lewis, who suffered from asthma, gout and other diseases, was too old and too sick to go to prison.

Retired Judge W. Byron Sorrell said during the court proceedings that if he believed only "a minuscule part of reports" about prison conditions, he was "satisfied that Lewis cannot reasonably survive a period in a penitentiary."

Last week at Lorton there was admiration among elderly inmates for the spirit of Sorrell's decision. They agreed that life at Lorton is hard. Most here are under 30. It is a young man's world dominated by those fast of foot and strong of mind, body and manner. Health care and living conditions leave much to be desired.

But the elders of Lorton, many of them young enough to be considered middle-aged on the outside, are proud to say that they have survived.

"The older fellows generally give the younger fellows the lead way," said Bronston Weldon, a 52-year-old man serving time for assault. "It appears to me that some younger fellows don't think in terms of age. They may walk across your feet and think that you should have pulled your feet back in time. There is no great fear that I have, probably because a certain amount of young men look up to you as a father figure."

In Lorton, as in other prisons around the nation, the combination of old age and illness breed special problems.

In opposing probation for Lewis, Assistant U.S. Attorney William Nussbaum, the prosecutor in the case, had argued that age and health should not have prevented incarceration. "If he was well enough to have a gun, run out of the house and shoot a man dead, then he is well enough to take responsibility for his actions," Nussbaum said of Lewis.

One criminal justice researcher said yesterday, however, that he agrees with Sorrell's decision.

"Most research shows that violent crimes decrease as a person reaches 40, so protection of society is not a question when it comes to incarcerating older men," said Jerome Miller, president of the National Center on Institutions and Alternatives, a prison reform group based in Alexandria.

"I don't believe that prison is a place for older men," Miller said. "It costs from $16,000 to $20,000 a year to house one inmate. I think that money could be better spent if alternatives to prisons for older men were found. It's nice to see a judge moving away from automatic prison sentences in Washington."

Salanda V. Whitfield, administrator of the medium security facility at Lorton, said special programs had been developed for older inmates, many of whom came to Lorton with drinking problems.

"We try to make certain kinds of recreational activities available for them such as table-top games," Whitfield said. "Many of them get involved in arts and crafts programs. They also tend to be ardent churchgoers and attend any church service available."

The dormitories where older inmates live are generally quieter and better kept than the others. Residents often spend a large part of their day reading and sleeping. There is not much loud radio playing and usually the youngest of the older inmates stands watch at the entrance to discourage the "riffraff," as troublemakers are called.

Some elderly inmates at Lorton spend considerable time in the prison infirmary, sometimes, when they can get out of bed, playing games of cards and dominoes.

It is here that much of the worst side of prison life is found--those who have gone blind, lost limbs or are chronically ill; those brought in for first aid, sometimes screaming from stabbings with homemade knives called "shanks" inside prison.

"I'm not afraid, but I stay out of the way," said James Hemphill, 77, who spent 13 of his last 15 years at Lorton in the prison infirmary. Like Lewis the cabdriver, Hemphill has asthma. Several years ago, doctors discovered a blood clot in his right foot and amputated his leg.

Hemphill has a prison record dating back to the 1950's, when he served time in New Jersey because of a fight following a dice game. "I knocked a man out with a ginger ale bottle," he recalled.

Before receiving his current sentence, Hemphill served six years at Lorton after being convicted in 1951 of shooting his wife to death in their Southeast Washington home on March 19, 1932--19 years earlier. In 1967, at the age of 61, he received his current prison sentence--15 years to life--following a conviction for the hammer-slaying of another Southeast Washington woman and her 10-year-old grandson.

Hemphill, who says he was born in Chester, S.C., had lived in and out of Washington since 1926. When he became eligible for parole two weeks ago, he still could not leave because he had no place to go.

Such problems are common, according to prison administrator Whitfield. "When an older man is released into the community, it is usually more difficult for him than the others," Whitfield said. "Many times, he won't have a wife left and his economic condition makes it necessary to work out special housing arrangements."

Yet Hemphill is ever ready. He keeps his life's possessions in two boxes and a brown bag neatly stacked in the corner of his hospital room. A pink artificial lower leg with black sock and shoe attachment is kept within reach.

"I'm not angry. I'm too old for that," Hemphill says. "I'm just waiting to get out on the streets. They looking for me a place and waiting for my 'get-free' papers to come through. My time is up."

There are hundreds of men in Lorton serving sentences that could include life imprisonment. While some lifers and others actually die in prison due to complications relating to age, most are paroled before then.

William Joseph Hamilton, the trumpeter, was sentenced to Lorton in July 1978. He would be over 100 years old if he did the maximum 21 years. But he will be eligible for parole in 1984.

"I don't feel so good about that," Hamilton said. "I feel I should get some kind of consideration."

So do some other inmates, who say Hamilton, like Lewis, could benefit from alternative sentencing.

"I can't see no reason for him being here," said Weldon, the 52-year-old inmate who lives in a dorm next to Hamilton. "It's nothing but a waste of taxpayers' money. You feel a sense of hopelessness. You know the guy doesn't have many more years left. I'm saying when a man reaches a certain age, quite a bit of aggression has left him."

Hamilton was convicted of shooting a man to death during a scuffle over a woman with whom Hamilton was having a drink at a card table in front of an abandoned house near Eighth and M streets NW in 1976.

He was born in St. Augustine, Fla., in 1902. He says he started playing trumpet at 9, but put his horn down seven years later, in 1918, to job hunt in ammunitions plants along the industrial East Coast. For several years, he said, he worked as a chauffeur and houseman for developer Jerry Wolman, former owner of the Philadelphia Eagles.

With four years to go before he's eligible for parole, Hamilton says he just tries to take it easy, staying in bed a lot and studying music and practicing when he has the energy.

Hamilton says he has high blood pressure and a troubled stomach. He says there is not much for an old man to do at Lorton, but he says he has a woman waiting for him on the outside.

As for Judge Sorrell's decision to make Lewis do 20 hours a week of community service, Hamilton chimed in, "I could teach little children music if I could be free."

But Hamilton had no such luck, something that many at Lorton understand. Whitfield noted that the Lewis case was decided on April 7.

"Lucky Seven: It was the right judge on the right day," he said.