Note to self. If I’m ever in need of a public advocate see if Tony Marx has some free time. Yesterday morning at the Edinburgh International Book Festival, the president of the New York Public Library gave a persuasive, passionate and positive defence of the role of libraries in our culture.

Marx’s vision was inclusive (the digital divide is still a thing, he pointed out) and utopian, embracing the library’s role as a connector in an online age, while continuing to recognise the importance of the physical book as a source of knowledge.

In doing so he even promoted the idea of librarians as heroic figures. Post 9/11 in the US it was librarians who were the first to stand up to the Patriot Act by destroying library borrowing records. Libraries, he argued, were “the last institutions in the United States of America that believe in privacy.”

Up to a point, Richard Sennett, writer and professor of sociology countered. Sennett wondered if libraries sometimes forget how important privacy is within the library itself. “We have made a fetish of access and transparency,” he argued. But didn’t creativity need a private space? He didn’t say “quiet please” but I think it was implied.

Museum curator Clementine Deliss offered another take in this sparky, engaged debate about libraries and museums and their futures. Who, she wondered, had the right to organise knowledge? Shouldn’t our classification systems be shaken-up now and again? You could feel the librarians in the audience wince at that.

In an age of library closures and declining footfall and politicians who, in Sennett’s words, invariably applied “shopkeeper logic” to all questions of funding, there was some good news. Marx pointed out that people still believed in libraries. There are 40m library visits per year in New York, he said. More than the number of people who visit the city’s museums or sporting institutions. “It’s not meant as a dig,” he said, eyes sparkling.

Public space also came up in Alexander McCall Smith’s latest love-in cum stand-up (or should that be sit-down) act at the book festival. In between discussing reincarnation, Foreign Accent Syndrome (it exists; look it up) and how dangerous hippos are, he was moved to comment on the controversial plans to build a new “walnut whip” of a hotel on the edge of Edinburgh’s new town. “It would look really good in Las Vegas,” he said.

“I don’t know why they don’t build a pyramid or an Eiffel Tower. We don’t have an Eiffel Tower in Edinburgh,” he added (you can imagine the level of wither going on in those words even if you weren’t there).

In a way Alison Case is declaring the book a public space with her new novel Nelly Dean. The title character is, of course, the servant girl in Wuthering Heights. And so this new story is one that is created in the gaps Case, an academic specialising in 19th-century British literature, found in Emily Bronte’s novel.

“I really believe in the imagination as a collaborative space,” she said when fellow writer Tracey Chevalier asked her about the audacity of taking on Bronte. “It’s not the solitary genius creating art out of nothing. The Brontes had a collaborative imagination.”

That said, she admitted, “I would not like to be waiting to read Emily Bronte’s review.”