Pragma syntax

Bert Freudenberg bert at impara.de
Sun Aug 20 13:03:12 UTC 2006


Ha, I almost missed a syntax discussion while on vacation! Seems as  
religious as always ;-)

Am 20.08.2006 um 14:17 schrieb Lukas Renggli:

> To summarize, these are basically two different views:
>
> (1) Pragmas as a syntax extension, where on can put almost anything
> between the angle brackets after an initial keyword selector defining
> the syntax.

Not quite - primitives and FFI calls are not pragmas, but all three  
are syntactical extensions with possibly different rules.

Maybe this is just a difficulty in naming - you seem to call  
everything inside angle brackets a "pragma".

Anyway, for sake of discussion I'll stay with your meaning.

> (2) Pragmas as a message send with literal arguments.
>
> I am for the simple and powerful. And this is (2) in my opinion.

Slightly paraphrasing Andrew's suggestion, how about this:

(3) "Pragmas" are method annotations parsed as literal array.

Under this definition, current FFI syntax is entirely legal (just  
take an FFI declaration and replace <> with #()). Extension modules  
can hook into the compiler to process those "pragmas".

As simple and even more powerful than (2), I'd argue.

This is not a final concept, agreed, but somehow it feels odd to  
reduce everything to strings, as in your "unified" FFI pragma.

- Bert -




More information about the Squeak-dev mailing list