There was not much doubt in many ministers' minds that when the final decision on gay clergy came before the General Assembly last weekend the yeas would have it.

And lo, they were proved right, the motion being carried by 309 votes to 182. Not that there weren't some vocal protests, but the birth of a new-look church happened without too much blood on the carpet, and champagne corks could probably have been heard popping before the Moderator had even finished his concluding placatory remarks.

Six years after the rammy caused by the appointment of Reverend Scott Rennie in Aberdeen, who was in a civil partnership, the Church of Scotland has at last entered the third millennium. In embracing what it calls "openly gay" clergy and deacons it has shown the compassion and commonsense that ought to be a hallmark of any Christian movement, but rarely is. It is only one of the anomalies of this tortoise of an institution that the inclusion of gay marriage is too recent a development to be part of the legal ratification, although that, we are told, will be rectified in time.

Time, though, lies at the very heart of this decision. As physicists know, it is an elastic concept, and never more so than when in the hands of those for whom eternal life hereafter is not a platitude but a certainty. When I worked for the Kirk, I recall mentioning on my first day a list of changes I wanted to make. "There's no rush," I was told. Indeed, some employees took such pride in moving like glaciers, either in thought or act, that time lapse photography could not have captured so much as a flicker of life.

Yet compared with some historic decisions - allowing women to become deaconesses, for instance, or the introduction of a hymn book - the acceptance of gay clergy has been fast to the point of giddy. So much so, in fact, that you could be forgiven for wondering if the unusual haste in reaching this juncture has been dictated less by the need to care for those gay ministers and members left in limbo all these years, who have felt unloved and unwanted, and more by the awareness that as the unhappy affair dragged on, the church was shrivelling before their eyes. While 21 indignant ministers have left in protest, a great many more ordinary churchgoers also have walked away, dismayed by an organisation that had to be frogmarched into taking a decision. In the years since the debate began, the Kirk's membership has fallen by about 65,000 to around 380,000. By far the most pressing matter now is how to save the Kirk, which is melting like a lolly in the sun.

One cannot help wondering if the recent vote has been expedited - consciously or not - to help halt this decline. Certainly, now that the rancour and wrangling are over, the church can and must concentrate on preserving itself from extinction. The question is, will this belated new mood of tolerance and openness help win fresh followers and recruits, or has it come too late? After showing itself to be less concerned with the spiritual well-being of its members than with trading biblical texts and insults with those of a different view, the Kirk has indubitably alienated many on whom it once depended to fill pews and pulpits.

Can those who left in disgust be tempted back, or will the future belong to the diehards who kept the faith, and those for whom the gay shibboleth will be ancient history before they ever step over the threshold?

I suspect that a few of the disillusioned will return, mollified that compassion and decency have won the day. But hope for the Kirk's survival lies most heavily upon younger generations. While sexual apartheid endured, there was little chance of winning them over and earning their trust. Now the Kirk is a place where officially anyone is welcome, and that conceptual gulf has been bridged. Only in a few parishes will gay clergy be shunned (as still are women), even if that will not be expressed in as many words.

Falling membership will no doubt continue, but less rapidly, perhaps. As with the Labour Party, the Kirk has found itself increasingly irrelevant in recent years, failing to meet people's needs. But unlike a political party, it cannot change its manifesto, or adapt to contemporary views if they are against its founding principles. Or so goes the theory. I would not be at all surprised, however, to find the Kirk being modified and mellowed by the secular world. As it battles for its life and throws its doors wide, the once forbidding, unforgiving Kirk is already changing out of all recognition. Praise be!