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

Graeme Geldenhuys graemeg.lists at gmail.com
Wed Jul 16 11:58:04 CEST 2008


2008/7/16 Jonas Maebe <jonas.maebe at elis.ugent.be>:
>>
>> 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


OK, I understand you point over the long term.  So would the following
still be okay?

  set += [member];

Not that I ever use the C style operators like '+=', but it does act
as nice shorthand for code - replacing the need for Include().

BTW:
  Is C style operator '+=' available by default in compiler mode
objfpc?  Or must I explicitly add -Sc ?


Regards,
 - Graeme -


_______________________________________________
fpGUI - a cross-platform Free Pascal GUI toolkit
http://opensoft.homeip.net/fpgui/



More information about the fpc-devel mailing list