Imagine the scariest writing teacher you’ve ever had—disparaging, unpredictable, merciless—and you’ve got Leonard, the character played by Alan Rickman in the new Broadway play “Seminar,” by Theresa Rebeck. A veteran of stage and television (she is the creator of the upcoming NBC show “Smash”), Rebeck has an ear for writer-on-writer brutality. The play follows a private workshop at an Upper West Side apartment, where Leonard, a disgraced novelist turned literary editor, terrorizes his students. He calls one story “perfect, in a kind of whorish way.” Of another, he says, “I don’t have to go past the first five words because I already know enough and I don’t give a shit.”

“It’s interesting to me how many people are shocked by what Leonard says,” Rebeck told me, “because many of those things have been said to me over the years by one person or another.” One of those people is David Milch, the creator of “Deadwood” and the co-creator of “NYPD Blue,” where Rebeck was on the writing staff for three seasons. By all accounts, Milch is a force of nature: a former compulsive gambler and heroin addict, he withdrew from Yale Law School after an incident involving a shotgun and the New Haven police. “There’s a restlessness and drive that you learn from that guy,” she said. “It was the hard-knock school of learning. But there was a lot of charm in it.” One scene in “Seminar” is lifted from an encounter with Milch. “I had to go and talk to him about one of my scripts,” Rebeck recalled. “I sat in his office and he went off on it. I realized in the middle that he was talking about somebody else’s script. I just sat there, waiting to tell him, ‘That’s David Mills’s script.’ Then he said, ‘What am I doing? This isn’t your script, it’s Mills’s script.’ And then he continued to give me notes on Mills’s script.”

Like the students in “Seminar,” Rebeck occasionally pushed back. One time, Milch was lecturing her in the hallway, with about eight people looking on. “I said, ‘Can we take this into my office or is the public humiliation important to you?’ Everyone was dead silent. And then he said, ‘She’s fantastic, isn’t she?’ ” Despite her bravado, Rebeck said, “He made me cry three times. I’m not a cryer. It took me so long to get his hand out of my brain that I think I erased most of it. It took me two years.”

Reached in Los Angeles, Milch said he hadn’t seen or read “Seminar,” but he remembered Rebeck fondly. “She was an enormous asset to the company of writers working on the show,” he said. He didn’t regard himself as an annihilator—“I would regret to learn that the parts based on me were the ones in which the author gets torn down”—but the David Mills story about struck him as plausible. “I’m capable of that solipsism and worse, on occasion. I hope I was right about the script!”

Asked about his own mentors, Milch spoke of Robert Penn Warren, who taught him at Yale and whom he assisted for seven years on an anthology of American literature. “I guess his most important lesson—I gather I may not have learned it completely—was the lesson of civility,” he said. “It’s absolutely crucial to maintain a level of respect for the materials in question and the author in question.”

But in Mark Singer’s 2005 Profile, Milch recounted a distinctly Leonard-like exchange when he was despairing about his writing and brought a chapter of his novel-in-progress to Warren’s home: “Now, I’ve interrupted his dinner, he’s been very gracious, and I say that, and he looks me in the eye and says, ‘Understand, David. I don’t give a shit who writes and who doesn’t.’ In other words: If you, David, are soliciting from me ‘Oh, you must,’ I ain’t gonna say that, because that’s up to you.” In “Seminar,” Leonard recalls being taught by Warren at Yale: “He was ruthless and religious about sound.” Was that another Milch reference? Rebeck said yes. “It was my little homage to both great men.”

Illustration by Gerald Scarfe.