Alasdair Gray's discussion of his novel Lanark at the Guardian book club sometimes seemed more like performance art. After answering questions, Gray informed us that he was going to give us a reading - not from the novel itself (everyone in the room seemed to know that well enough already) and not even (as his publisher might have wished) from his new novel, Old Men in Love. No, he was going to try out some recently penned "rhymed verses".

We all waited while he rummaged in his rucksack, which disgorged sheets of paper, a passport, clothes - and finally a typescript. It was called "The Ballad of Anne Bonnie" - and before we knew it, Gray was orating a wonderful verse tale in a piratical West Country English. (Catch the podcast on the Guardian's website.) "Why did you write that?" "I haven't the faintest idea".

This is Gray's brand of slightly shambolic inspiration, relished by the readers who came to hear him. (From the evidence of their questions and battered copies of Lanark, many were Alasdair Gray buffs.) He answered questions in the very style of his fiction: great digressive, allusive paragraphs of rumination - punctuated by quotes from Milton or Horace and unexpected detonations of laughter. Just as he seemed to have wandered off into literary space he would elegantly return to clinch the point with which he began. His talk was as full of books as Lanark itself. A couple of readers asked him about his science-fiction sources for the novel. It being Gray, the answer gave us a bricolage of examples from Conan Doyle and HG Wells ("he really is the best") and Hans Christian Andersen. One member of the audience who had just begun Old Men in Love asked about what lay behind this latest book and got a mixture of Johnsonian candour ("I was short of money") and learning (he told us all about Socrates's relationship with the comic dramatist Aristophanes).

Lanark may have taken some 20 years to be finished and published, but it was his first novel and he was asked how it prepared him for the spate of fiction that followed. Gray thought it not a patch on his next work, 1982, Janine, which had the great advantage of not having as its central character "another bloody artist". "I think I made him quite a convincing electrical engineer". But the "bloody artist" in him delighted readers. "My whole sense of Lanark comes from your illustrations," was one typical verdict. At what stage are they conceived? Do they grow as he writes, or get added at the end? In the case of Lanark, the illustrations were engendered long before the book's completion, when the author visited the British Museum and saw, on postcards, the brilliant emblematic title pages of Walter Raleigh's History of the World and Francis Bacon's Novum Organum. Such illustrative frontispieces were used for works that were designedly erudite. "That's what I want for my book," Gray remembered thinking.

A few of the allusions in Lanark got unpicked. The names interested us, particularly "Unthank", the imaginary city, something like Glasgow, through which Lanark wanders. (Bloggers to the website also speculated about this.) A reader recalled an "Unthank Road" ("where the Orangemen lived") in the small Scottish town where he grew up. The sectarian association was not irrelevant. Gray told us he got the name from a large painted piece of graffiti he saw outside Glasgow at the time of Pope John XXIII's consecration. Some aggressive Protestant, celebrating the year of the Battle of the Boyne, had written "1690. UNTHANK WILL NEVER SURRENDER". Readers later told him that "unthank" is indeed a Saxon word meaning land too poor to be taxable, "It means you cannae get any money out of this place," glossed Gray, reducing himself to helpless hiccoughs of laughter.

Even fans sometimes confess that they find the naturalistic story of Duncan Thaw at the heart of Lanark easier to relish than the fantasy-tale of Lanark that enfolds it. The current paperback edition has an introduction by one such, the novelist William Boyd, who admits: "I prefer Thaw's story to Lanark's."

In the beautiful new four-volume hardback edition, the novel is split up into its constituent books. Would it be "criminally irresponsible", asked one member of the audience, to extract the books containing the Duncan Thaw narrative to give to a youthful reader? Lanark opens with Book Three. "How important is it to read Book Three first?" "I don't think it is important," answered Gray, confiding that he had ordered the Books three, one, two, four partly through "utter cheek", and partly in imitation of the epic habit of beginning in the middle of a story and recounting its earlier episodes in flashback. "Let's be classical!" he exclaimed. Not many contemporary novelists would issue such an imperative.

· John Mullan is professor of English at University College London. Next week he will be looking at Philip Pullman's His Dark Materials trilogy