On Mon, Apr 26, 2010 at 12:05 PM, Andreas Raab
<andreas.raab@gmx.de> wrote:
On 4/26/2010 11:48 AM, Eliot Miranda wrote:
OK, so Pragma is bad; its historical from "primitive pragma". But
Annotation doesn't capture the potentially executable flavour of
pragmas. How about MethodMetaMessage? (mmm, yum :) ) We could talk
about meta-messages for short. "Add a meta-message that does ..." etc...
But "primitive pragma" is every bit as wrong. A pragma is something that gives the compiler information about the code without being code itself. Primitives are't pragmas, primitives are *code* (if you don't believe me, just remove all of them and see how that goes).
I know, but within ParcPlace a <primitive: 123> mark was /called/ a primitive pragma, and so "pragma" was the term we used (without sufficient thought) when we did the menu and exception "pragma" work in vw3.0.
By definition, a "pragma" is an interface between the code and the compiler, something where the code conveys meta-information to the compiler. For example, this is a pragma (assuming the compiler understands it):
foo
<inline: true>
bar
<tailcut: true>
The first one might instruct the compiler to generate the code for this method inline, the second one to eliminate tail recursion.
None of these, however, are pragmas:
foo
"Not a pragma since it's not for the compiler"
<preference: 'Foo Preference'
...
>
apiGetWindowFocus
"Not a pragma since it's code"
<apicall: ulong 'GetWindowFocus' (void)>
etc. I should also add that before the introduction of the so-called "pragmas" there was only *code* used in the <> syntax (primitives and FFI calls) and the change to allow non-code entities is something that, although useful, still worries me because of the conceptual issues associated with mixing code and non-code entities. We wouldn't even have that discussion if <> just meant "code".
Cheers,
- Andreas