[fpc-pascal] Understanding virtual methods
Xiangrong Fang
xrfang at gmail.com
Tue Aug 20 15:39:40 CEST 2013
Hi Sven,
Thank you for comment :) I am interested in a high level description of
how these concepts (virtual / reintroduce / overloading) differs and how
they affect programming, and I am currently not running into trouble, just
try to get a better understanding of the language.
I'll explain my question / confusions:
1) I didn't notice that my question are related to "modes" of fpc, i.e.
turbo-pascal/delphi/objfpc. If they are different, I would like to know
more details, and I am more interested in objfpc mode, not those
"compatibility" modes.
2) I know override / overload are completely different thing, I am not
trying to compare apple with orange. Also, I am clear about the
definition of virtual methods and their purpose. What I need help is to
explain the observations I found with my demo app (which is a bit different
than I expected). For example, why we need "reintroduce" while "overload"
does the same job and better (it makes both methods available)?
Thanks,
Shannon
2013/8/20 Sven Barth <pascaldragon at googlemail.com>
> Am 20.08.2013 14:39 schrieb "Antonio Fortuny" <a.fortuny at sitasoftware.lu>:
>
> >
> >
> > Le 20/08/2013 14:34, Sven Barth a écrit :
> >>
> >> >>
> >> >> This is not same as the description in:
> http://www.freepascal.org/docs-html/ref/refsu26.html
> >> >>
> >> >> BTW, the above documents are talking about objects, but I am using
> classes, is there any difference here?
> >> >
> >> > Yep: a class is a construct definig a collection of variables,
> properties and methods whilst an object is an instantiated class.
> >>
> >> You are aware that the link mentioned by Xiangrong Fang points to a
> part of the manual about Turbo Pascal style objects which are different in
> a different sense to Delphi style objects/classes?
> >
> > Yes, but as he posts a question in a FPC list I imagine he is looking
> for some general information. He looks not to be in trouble. Lest's wait
> and see
>
> That has nothing to do with FPC list or not. Xiangrong Fang asked about
> two different language features here and you told him something about a
> completely different difference related to one of the two language features.
> Your answer is simply not an answer to his question.
>
> Regards,
> Sven
>
> _______________________________________________
> fpc-pascal maillist - fpc-pascal at lists.freepascal.org
> http://lists.freepascal.org/mailman/listinfo/fpc-pascal
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freepascal.org/pipermail/fpc-pascal/attachments/20130820/62814cea/attachment.html>
More information about the fpc-pascal
mailing list