[fpc-devel] The usage of Include() doesn't work any more in 2.3.1
Martin Friebe
fpc at mfriebe.de
Wed Jul 16 12:16:11 CEST 2008
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
>> <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_______________________________________________
> fpc-devel maillist - fpc-devel at lists.freepascal.org
> http://lists.freepascal.org/mailman/listinfo/fpc-devel
More information about the fpc-devel
mailing list