Op Wed, 16 Jul 2008, schreef Graeme Geldenhuys:

On Wed, Jul 16, 2008 at 9:40 AM, Daniël Mantione
<[EMAIL PROTECTED]> 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.

It's easy for me (from a developers point of view <wink>) to say, but
I think that it's up to the compiler to resolve the issue at hand.
It's not the job of the developer to change all existing code.  Surely
the compiler must be able to detect if set is a property or field
variable. If it's a property, resolve the call to set := set +
[member]

This is argumentation for transparantly calling any procedure; it does not hold as an argument to handle it transparently for "include" only.

As it stands now, FPC 2.3.1 is going to break a LOT of code. Yes I
know it was maybe a unsafe way of using Include(), but surely the
compiler can handle it better.  Thoughts?

We are aware it breaks a lot of code, and the fact that "include" is also affected does not change this, it is just a procedure that has a var parameter. Any procedure that passes properties to var parameters is affected.

The reason 2.2 still accepts it is that while the old behaviour is incorrect, many code may appear to work correctly and we do not want to break it during a stable series.

Daniël
_______________________________________________
fpc-devel maillist  -  fpc-devel@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-devel

Reply via email to