CHICAGO -- "Take your hat off."

The way Gil Walker says that to the young man -- softly, politely -- it is more a reminder than an order. But when Walker speaks, many young men hear the voice of the commissioner. His rule against hats in the gym expresses both universal etiquette and Chicago prudence. Styles of hats and ways of wearing them often are trademarks of gangs, and that world stays outside, on the mean streets.

It is midnight. Do you know where your sons are? If you live on Chicago's West side -- what sociologists call "a challenging environment" -- and if your sons are 18 to 25 years old and if they, and you, are lucky, they are dribbling a basketball up court, executing a pick-and-roll. They are off the street and out of trouble, and at the end of the night, around 1 a.m., they will be picking up some pointers about getting on with life off the court.

Walker, a sinewy 41-year-old black man, works for the Chicago Housing Authority as commissioner of the Midnight Basketball League. His will (and $90,000 -- about what it costs to incarcerate three men for one year) is the driving force behind 16 10-man teams. And he is a scarce commodity in the lives of many of the young men: He is a male authority figure who is always there, 'round about midnight.

Walker was an Army brat whose travels took him from an Indiana boyhood to Japan, to college in Texas, to semipro basketball in Mexico to this cramped boys-club gym where the air is thick with the sounds of the city game -- the slap-slap-slap of basketballs and the squeak-squeak-squeak of sneakers.

The young men who play do not need to be taught much basketball, although this night there is on hand someone who could join Walker in teaching -- Andre Wakefield, formerly of the Phoenix Suns. He is a product of this neighborhood, which also has furnished two members of the NBA champion Detroit Pistons -- Mark Aguirre and Isiah Thomas.

"Basketball is our national sport," says Walker of black Americans. "I never met a black man who would admit he couldn't play." But of many young men who play in his league, Walker says, "No one ever sat down and taught them some things."

"Hold out your fingernails," he will tell new players. "If the nails are dirty, something else is dirty, and you're not putting my clean uniform on a dirty body." The league has uniforms, warmups, a player draft, an all-star game, an awards banquet, championship rings. The scoring and league standings appear in the Sun-Times. Coaches get $500. For the season. And responsibility for washing the uniforms.

To be eligible for all this a player must attend practice once a week and must be a "successful individual," which Walker defines simply: "anyone taking care of a family." There is a discussion at the end of each game, at which the players get "the gospel according to Gil Walker." It begins with basketball but ends with talk about "manhood." For example, he will say:

"How many babies you got?"

"Four."

"How many are you taking care of? Tell me their teachers' names. You don't know? What kind of man are you?"

Post-game topics include how to look for a job, how to get along with co-workers, how to deal with "a boss who is on your case."

About 80 percent of the players come from "the projects." If Chicago's public housing were a city, it would be Illinois' second largest. Before the league began, gangs -- there are more than 100 in the city, with about 30,000 members -- were the only structure many of these young men knew. Participation in the league for some is the only source of pride, and not just for players. One mother calls it "the first time I ever had a chance to cheer for my son."

Amidst today's urban tragedy of social regression stand some extraordinary people. There are women, such as high school principals, carving enclaves from the enveloping chaos. There are men like Walker who see the grace and discipline and self-taught skills of ghetto basketball players and see something more, an unmined lode of all sorts of talents.

Basketball is a game for big, fast men in a confined space, a game of controlled -- sometimes -- contact. There is a fine line between legitimate contact and a foul (a city playground saying is: "No autopsy, no foul"). And in some neighborhoods, there is a fine line between a foul and a casus belli.

Skeptics told Walker: Give these guys uniforms, you'll make matters worse -- create new gangs. Walker mixes members of rival gangs on teams and gets away with it. He remembers the night the gym lights went out. For seven minutes. His urban reflex was to get his back against a wall and wait for the worst. But for seven miraculous minutes no one moved. Then the lights, and the game, went on.

By such small victories are cities reclaimed.