Alyn Smith was excellent in the European Parliament yesterday. He was doing exactly what the SNP need to be doing – building sympathy in the European institutions for continuing Scottish membership of the EU.

The European Union is an institution which is based on treaties which have legal force. There is nothing whatsoever in any of those treaties, and nothing in any existing arrangement with any state, that makes it possible for part of a state, even a federal state, to be inside the EU, when the state itself is outside.

There is absolutely no way that Scotland can be inside both the UK and EU, if the UK is outside the EU. This question has been visited before by the EU in detail, in relation to Cyprus in particular . I understand that Nicola Sturgeon may feel a need to show that she explored all possibilities. But there is a serious danger of confusing the issue by asking for impossible things that will just exasperate people and lose sympathy.

It is very possible indeed to work out modalities for independent Scotland to join as an EU member at precisely the same moment the UK leaves. Indeed, the creation of a new doctrine of right to retain EU citizenship that makes it possible for recognised EU “regions”, of which Scotland is one, to achieve statehood and continue membership, only if the member state is leaving the EU, could alleviate potential Spanish opposition.

Such a solution can politically be stitched together. The reaction to Alyn Smith’s speech demonstrates that. Absolutely crucially – and I cannot emphasise the importance of this enough – no treaty changes would be required for Scotland as a newly independent state to continue membership. But any kind of special status for Scotland when it is not a state, would require treaty changes which we are just not going to get.

UPDATE – To answer a question three people have just asked me. The Greenland case is not in the least comparable because its relationship with the EU is based on the fact that it is an autonomous territory of an EU member state, Denmark. That is completely different from the situation of an autonomous territory of an EU non-member, which the UK will be.

UPDATING AGAIN Wow people are engaged in this one. The same is true of comparison with Monaco, Andorra, San Marino etc. They all belong to states INSIDE the EU. The UK will be OUTSIDE the EU. Scotland’s status will have no comparison at all to an autonomous territory of an EU member state.

I spent four years of my life as First Secretary (Political and Economic) in the British Embassy in Warsaw working specifically on Poland’s EU accession. I not only know this stuff backwards, I know a lot of key contacts. Alyn Smith shows that the SNP MEPs know what they are doing and are highly capable. I am consumed by desire to find a way to help my country at this crucial time. Having thought I had achieved some kind of acceptance that in the UK whistleblowers are forever excluded from public life, I today find it hurting more than ever.