Pragma syntax
Andrew Tween
amtween at hotmail.com
Fri Aug 18 10:05:39 UTC 2006
Hi,
I'll probably be shot down in flames for this suggestion, but...
Why isn't the syntax for pragmas something like this...
<pragma: A value: 10>
<pragma: a:b: value: {1. 2}>
or maybe, <pragma: a: 1 b: 2>
At present, if I compile a method containing
<primitive: 'a' module: 'b'>
I get a primitive.
But if I've made a typo...
<primitive: 'a' moduel: 'b'>
I get a pragma. Which is almost certainly not what I wanted.
Of course, the compiler could check that if the first part is primitive: then
the second part is module: , but what about...
<primitiv: 1> [sic]
Once again I get a pragma.
Now, <pragma: , can be used for REAL pragmas (ones that do not generate code).
And I can happily add code-generating angle bracket constructs, which have any
syntax I like e.g.
<sql: select * from mytable>
<javascript: ...>
Cheers,
Andy
More information about the Squeak-dev
mailing list
|