Post by Eliot MirandaI don't buy this. I think of C: being a pragma and the implementation
not having caught up.
Call me a language lawyer, but in that case I am waiting to see BNF of
our syntax that describes things like
<C: DWORD CommDlgExtendedError(void) >
:)
Post by Eliot Miranda#exception is a pragma (and implemented as such)
and affects the semantics. The fact that the implementation hasn't
caught up is simply historical. CPOK was introduced before we hit on a
regular implementation scheme for pragmas, at a time when for example
the primitive: pragma was implemented by bits in a method header or
specific bytecodes. If we had to do it over I think we'd be much more
regular, and all primitive: C: et al methods would answer pragma
messages, and we'd write <primitive: 123 errorCode: aTemp> as
<primitive: 123 errorCode: #aTemp>
or
<primitive: 123 errorCode: 'aTemp'>.
At least that's my take on it.
We _would_ be regular, but we are not. primitive: is still implemented
by specific bytecodes, produces a regular CompiledMethod, and is not
visible when asking for a method's #attributes. Ditto for C:.
The disagreement is about terminology (or separating intention from
implementation :-). I see how much more attractive it would be to
consider C: and primitive: as pragmas like others, and say pragmas are
anything within angle brackets. Indeed I would prefer to have them that
way. But I can't seriously consider them as such until I can do
Pragma allNamed: #primitive:errorCode: from: Foo to: Object
and use the usual interface of Pragma to reflect on the results.
#primitive: wouldn't be that hard to fit into this common Pragma scheme,
but #primitive:errorCode: might be trickier, and C: even more so with
its silly pseudo-C syntax.
--
Vassili Bykov
Tools Technical Lead, VisualWorks Engineering
v b y k o v A T c i n c o m D O T c o m
http://www.cincomsmalltalk.com/userblogs/vbykov