2008/7/16 Jonas Maebe <[EMAIL PROTECTED]>: >> >> 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/ _______________________________________________ fpc-devel maillist - fpc-devel@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-devel