[fpc-pascal] Re: How to avoid namespace name clashes after USES ?

Jonas Maebe jonas.maebe at elis.ugent.be
Wed Aug 22 14:22:40 CEST 2012


Jürgen Hestermann wrote on Wed, 22 Aug 2012:

> Am 2012-08-22 13:45, schrieb Lukasz Sokol:
>> Recompilation when one of units/libraries was upgraded, almost  
>> always implies
>> rebuild. Who on Earth is so trigger-happy to upgrade, rebuild and  
>> not test for
>> regressions? This is the only sane way to get the process going -  
>> document it
>> *as MML said below*;
>
> That's not the point. Why on earth should a programmer *not* get as  
> much help as possible
> from a programming language/compiler? That's the genuine purpose of  
> a programming language.

Indeed.

> Though I don't know whether it can be implemented easily (if at all).

There are definitely some practical problems:
* class/record helpers. The last class/record helper for a particular  
type that has come into scope automatically adds its methods to the  
helped class/record. If symbols can only be accessed by explicitly  
qualifying them with a separately specified unit alias, I don't see  
how you would "activate" class helpers from aliased units. Would these  
be an exception to the rule? Or would this require a new language  
construct to import all desired helper types explicitly?
* Objective-Pascal categories are the same as class helpers, except  
that there an unlimited number of categories can be active for a  
single class at the same time. In the end, it's the same problem as  
above though.
* Objective-Pascal also has the special "id" type. It is possible to  
call any method of any class type (and associated categories) in scope  
on a variable of this type. Again, I don't see a way how the proposed  
mechanism could be used to tell the compiler which classes it should  
search and which not if it should only search fully qualified  
identifiers from aliased units.

There may be more issues, but these are the ones I can immediately think of.


Jonas



More information about the fpc-pascal mailing list