[M3devel] C-like syntax for Modula-3 [was Re: "target specific pragmas"?]

hendrik at topoi.pooq.com hendrik at topoi.pooq.com
Sun Feb 17 07:29:03 CET 2008


On Sat, Feb 16, 2008 at 09:43:38PM -0800, Mika Nystrom wrote:
> 
> 
> Well I used to be mostly a C programmer but I long since weaned
> myself off that syntax :)
> 
> Your point of the post- and pre-increment might be a bit difficult
> for C programmers to stomach, but... well it is probably hard to
> tell what programmers will hate and what they will love.
> 
> Wouldn't a way to go about it be to take the Modula-3 BNF and modify
> the rules as needed?  Would you like to be able to convert back and
> forth (why not), e.g., using m3tk (m3pp?)?  You have to lower-case
> all the keywords, convert the braces appropriately (a bit tricky
> since Modula-3 has abandoned the Pascal/Algol FOR i := 0 TO 10 DO
> BEGIN END, so braces map only to the ENDs, not BEGINs (for the most
> part)).
> 
> Type "attributes"(is that the right word?) are also an area where
> Modula-3 is significantly different from the C family.  In C, you
> write
> 
> int *a, *b, c;
> 
> we have
> 
> REF INTEGER a, b;
> INTEGER c;

The declarator syntax in C was a mistake.  Let's not perpetuate it.

-- hendrik




More information about the M3devel mailing list