[fpc-devel] Some compiler changes...

Bram Kuijvenhoven kuifwaremailinglists at xs4all.nl
Tue Jan 23 11:15:03 CET 2007


Michael Van Canneyt wrote:
> But, the 'importing identifiers' from another language is a false argument;
> With a simple rule (prepend with _) you have this too. It can even be
> automated. You don't need to butcher the language for it; 

The _ trick is widely used indeed, but imho those underscores make code slightly less readable and also less aesthetic. 

Though I understand it's not top class priority to add this to FPC, I like the feature. Not only imports from other languages need adaptation, also names like 'class', 'type' and 'unit' naturally arise as identifier names in certain contexts. I see this for example in a parser I wrote, where I had to rename the very natural 'type' and 'class' to '_type' and '_class' respectively.

A small disadvantage is that code highlighters will need to be adapted, and not all code highlighters might support the requirement that keywords are not to be recognized/highlighted as keywords when they follow a . or & directly.

BTW, I'd welcome the foreach loop, in particular in combination with generics and some standard set of container classes. These are just user wishes of course, you guys are doing a great job already!

Regards,

Bram



More information about the fpc-devel mailing list