It is important for Singapore to keep reinventing itself, and for its leaders to be prepared to do so, Prime Minister Lee Hsien Loong said yesterday as he spoke about what he would teach his younger self after having gone through many transitions in his career.

He was answering a question from Mr Dominic Barton, the global managing partner emeritus of consulting firm McKinsey & Co, who was moderating the closing dialogue at the Smart Nation Summit.

Mr Barton had asked PM Lee what leadership skills he would want to have, with the world on the brink of a technological revolution.

PM Lee said: "It's the non-tech part of it which is difficult, which is to be able to accept the new way of doing things and to be able to change our organisations and our processes in order to take full advantage of what has now become possible. That is very, very hard."

Citing the example of Microsoft, which he said is one of the "best companies in the world", PM Lee said that it first made computers using MS-DOS systems, then moved on to Microsoft Windows, and later reinvented itself as an Internet company.

Even then, Microsoft "didn't capture all the apples on the tree", and missed the opportunity to make its phone operating system the standard non-Apple phone platform, he added, referring to recent remarks by Microsoft founder Bill Gates, who lamented losing the mobile phone operating system market to Google's Android platform.

Going back to Singapore, he said: "In our case, if we don't reinvent ourselves and somebody else comes along and takes the apple off our tree, we won't have lunch.

Related Story 3 ingredients necessary to succeed in smart nation vision: PM Lee

Related Story Behavioural change key to Smart Nation lifestyle

Related Story Whether Singapore can be a vibrant Smart Nation depends on a strong digital defence: Iswaran

"I think that's a lesson which... we ourselves, not just the population, need to know and to remind ourselves every morning that we have to keep on being prepared to reinvent ourselves, and sometimes to cannibalise ourselves, because otherwise somebody else will do it."

During the session, the Prime Minister was also asked by an audience member if the country's regulations would support a diverse workforce, including lesbian, gay, bisexual, transgender and questioning (LGBTQ) people, with the annual pro-LGBTQ Pink Dot rally happening on Saturday.

"On inclusiveness, I think we are open," he answered. "You know our rules in Singapore, whatever your sexual orientation, you're welcome to come and work in Singapore."

He acknowledged that for some people, Section 377A of the Penal Code, which penalises sex between men, is an issue.

But he said the clause "remains on our legislation, and it will for some time", adding that it has not prevented LGBTQ people from living here, or prevented the annual Pink Dot event from taking place.

"We are not like San Francisco, neither are we like certain countries in the Middle East," he added.

"It's something in between. It's the way this society is. And I think in this framework, it is completely possible for us to have a vibrant tech and cultural scene."

Correction note: This article has been edited for clarity.