[fpc-devel] The usage of Include() doesn't work any more in 2.3.1

Jonas Maebe jonas.maebe at elis.ugent.be
Wed Jul 16 11:31:17 CEST 2008


On 16 Jul 2008, at 10:01, Graeme Geldenhuys wrote:

> On Wed, Jul 16, 2008 at 9:40 AM, Daniƫl Mantione
> <daniel.mantione at freepascal.org> wrote:
>> I think there can be two visions here:
>> - Include is not a real procedure, so this internal implementation  
>> detail
>> should be hidden and this can/should be allowed; the
>> compiler internally should convert it into set:=set+[member].
>
> I think this would be ideal.  Using Include() is much cleaner than set
> := set + [member].  And yes I understand that as it was implement, you
> could circumvent the getter/setter, but I believe it's something the
> compiler must handle correctly.

Adding such exceptions complicates both the compiler sources (special  
cases have to be added for particular constructs in particular  
circumstances) and the language ("x is not allowed, except in cases a,  
b and c"). Over time, such exceptions (even if initially added for  
convenience reasons) actually make things harder rather than easier  
for most developers, because they keep adding up and you create a  
completely inconsistent set of rules.

The reason is that you end up in a situation where people have to be  
aware which routines are compiler-internal and thus can be magically  
changed to do "the right thing", and which are plain rtl routines  
which abide by the normal language rules (other exampleq would be inc/ 
dec). Such differences in behaviour actually already exist nowadays,  
e.g. regarding overloading, causing confusion: http://bugs.freepascal.org/view.php?id=8399


Jonas


More information about the fpc-devel mailing list