- Why, I'd love to.
- Why, of course!
I get the concept of starting a sentence with a word not completely related to the overall response, but this one seems to be a particularly odd choice — is there any semantic meaning I'm missing?
According to the OED, the use of why as an interjection dates back to the 16th century:
The OED doesn't explain why it is used in that manner. I can only speculate. First it was just a question expressing doubt reduced to its essence:
This developed through rhetorical question into a mere interjection of surprise:
From there its function of calling attention (if that's what it is) to a following statement developed:
The OED notes that it is often used this way in opposition to a vague doubt or apprehension.
"why" can be compared to an old Latin form qui, an ablative form, meaning how. Today "why" is used as a question word to ask the reason or purpose of something. This use might be explained from a formula such as "How does it come that ...".
If you meet an old friend of yours, whom you never expected to meet in town, you can express your surprise by saying: Why, it's Jim!
This why in the meaning of "how", in Latin qui, can be explained as rest of a whole sentence: How is it possible? It's Jim, whom I never expected to see again!
This is my personal view of the matter. I don't suppose that everybody will agree.
Why, that's what it means!
It doesn't actually transform the sentence into a question; the question mark does that (see also: French).
We've just gotten used to always seeing it at the start of a question, but it's really there to draw attention.