Possible Duplicate:
Where does the word “pragma” come from?
I know that pragma
commands are used to pass compiler specific directives to a compiler implementation, but why was the keyword pragma
chosen? What is its etymology? Most language keywords are taken from real words, but pragma
seems only to be defined within the context of programming.
I don't know exactly what the thought processes were behind it, but "pragma" comes from the ancient Greek word πραγμα, which means something like "action". It's also the root of the English words "pragmatic" and "practical". In other words, a #pragma directive is an action that the compiler should take, but it's also "pragmatic" and "practical", i.e., the sort of practical, pragmatic violation of the purity of the standard that you kind of need in the real world.
(I suppose this off-the-cuff etymology is close enough? Kinda makes sense to me, at any rate.)
精彩评论