Hi,
just to add another opinion. Personally, I would thing that it was nice
to allow (write-able) Properties to any var-param (even out-param).
Write-able include properties with a setter-procedure.
IMHO the way it could be done would be for the compiler to create a
temporary variable. This could be passed in as var/out-param, and then
be assigned to the property, using the proper setter-procedure.
I do of course understand, that this is extra work on the compiler. And
I can not judge if it has enough value for anyone to implement it.
Best Regards
Martin
Jonas Maebe wrote:
On 16 Jul 2008, at 10:01, Graeme Geldenhuys wrote:
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.
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_______________________________________________
fpc-devel maillist - fpc-devel@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-devel
_______________________________________________
fpc-devel maillist - fpc-devel@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-devel