The 102-year-old pregnant corpse.

Chris Carter, creator of The X-Files, gave him the premise. It was a challenge, a dare, and he was responsible for the rest. One by one, the pages went up in the window. They were immaculately typed, spaced, and edited in his head long before his fingers hit the keys.

He started at 1 p.m., craning the necks of passerby outside the shop. They wondered about the man sitting in the window, hunched over a typewriter. It was like a piece of glass that allowed you to see the gears and pistons of a machine.

When the Dangerous Visions bookstore in Sherman Oaks, Calif., closed that day, Harlan Ellison had completed “Objects of Desire in the Mirror Are Closer Than They Appear," a short story that, yes, included a pregnant corpse and added three suspects.

By this time in 1998, Ellison had already been writing for 40-plus years, collected virtually every award a writer of speculative fiction could receive, and bolstered the reputation of the original Star Trek series by writing the seminal episode, “The City on the Edge of Forever.” He had marched in Selma, sued James Cameron for appropriating his ideas in The Terminator, and mouthed off to a posturing Frank Sinatra.

He was also prolific, and that meant buying less into the idea of writing as a mystical art. To help discourage that notion, Ellison began public compositions in bookstore windows in the 1970s, inspired by French author Georges Simenon, who was rumored to have written an entire novel while sitting in a glass cage. (He didn’t, but Ellison didn’t know that until years later.)

“I do it because I think particularly in this country people are so distanced from literature, the way it’s taught in schools, that they think that people who write are magicians on a mountaintop somewhere,” he told NBC after one such performance in 1981. “And I think that’s one of the reasons why there’s so much illiteracy in this country. So by doing it in public, I show people it’s a job … like being a plumber or an electrician.”

Amid distractions, gaping pedestrians, and breaks to entertain autograph seekers, Ellison churned out stories in bookstore windows overlooking Washington, London, Boston, and New York. Good ones, too. The five days he spent in the window of A Change of Hobbit in Santa Monica in 1977 resulted in work that garnered three awards.

Sometimes he would play music. In one of his foreign appearances, tourists kept asking him where they could find certain titles, believing he worked there. On one of his days in the Hobbit, he conveyor-belted 26 very short stories, which Stephen King later compared to a beat poem. If he needed to research a subject, he'd simply get up and browse the aisles. When people grew suspicious he was plotting out the stories in advance, he began soliciting starting points.

Carter's was one. Four years later, at the Booksmith in San Francisco, Robin Williams gave him the springboard “Computer Vampyre.” Ellison, who disliked working with computers, grunted but wrote a story, “Keyboard,” anyway.

By rejecting the notion of writers as introverts, Ellison raised some charitable funds, brought attention to independent booksellers, and intensified his own reputation as an author who never once considered the act of writing as a mechanical exercise. The author is now 81 and still writes, though no longer while on display.