The grammar of lying

If you have promised to do something while never intending to do it at all, but then in fact you do it, were you lying or not when you gave the promise?

I read a newspaper article many years ago, recounting a job interview. The writer had answered ‘yes’ to the question

Would you be prepared to bend the truth for the sake of the Corporation?

while keeping a mental reservation to the effect that, in the event, he would not lie, even if the company asked him to.

He wasn’t hired, but some time later he realised that although he thought he had given a deliberately false answer in the interview, in fact he had told the truth. He was prepared to lie, in order to get the job.