Marc Weustink wrote:
Can we have a virtual version too like described here
http://hallvards.blogspot.com/2007/05/hack17-virtual-class-variables-part-i.html
Well, I suppose we can if someone will implement ;)
Best regards,
Paul Ishenin.
___
fpc-pasca
Paul Ishenin wrote:
David Emerson wrote:
d. What happens with inheritance?
d.1. wrt class constants and class vars-- are there separate
"instances" (for lack of a better word) of these, one instance for
each descendant? Or is the class var/const only stored once for the
ancestor that declare
I think they come in very handy for the Singleton OOP concept. You need to
have a "factory" that handles the object query/instantiation. If no instance
is available, it creates a new one (and stores it) and if one is already
available, it just returns that.
Naturally that looks better to have TS
David Emerson wrote:
a. 'var' sections -- I assume that 'var' is optional when declaring
fields that occur first (i.e. directly after "private", "public", etc)
Yes.
b. What does "strict private" mean, as opposed to private without
strict? (My best guess is that it would be accessible only wi
Cox, Stuart TRAN:EX wrote:
Some operations (procedures/functions) just go naturally with Classes but don't belong to any particular instance of that class.
An example might be calculating the area of overlap between two geographic polygons (instances of the class) where the function returning th
dmitry boyarintsev wrote:
Are these features available for {$mode delphi} only?
No. For objfpc too.
Best regards,
Paul Ishenin.
___
fpc-pascal maillist - fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal
>-Original Message-
>From: fpc-pascal-boun...@lists.freepascal.org
>[mailto:fpc-pascal-boun...@lists.freepascal.org] On Behalf Of Doug Chamberlin
>Sent: Wednesday, January 13, 2010 11:21 AM
>To: FPC-Pascal users discussions
>Subject: Re: [fpc-pascal] FPC class synt
On Wed, Jan 13, 2010 at 19:13, David Emerson wrote:
>
> d.2. wrt class methods, can they be virtual? (This strikes me as being
> closely related to d.1)
>
Definitely, yes! (and I believe that was available before class
vars/consts) I use this great feature for (de)serialization of
messages in my
>
> Yup!
>
> Of course, there are pros and cons to all this. Our once simple,
> straightforward language is not littered with "convenience" features that
> are not necessary at all. For example, what is the big advantage of class
> methods over simple functions and procedures?
>
Class methods can
David Emerson wrote:
Doug Chamberlin wrote:
Class methods allow you to call the method without instantiating the
class first. For example, Result := TMyClass.MyClassFunction;
Oh, that is so cool! I suppose that probably means that class methods
can only reference class variables/methods/prope
Doug Chamberlin wrote:
> Class methods allow you to call the method without instantiating the
> class first. For example, Result := TMyClass.MyClassFunction;
Oh, that is so cool! I suppose that probably means that class methods
can only reference class variables/methods/properties.
Cheers,
Davi
David Emerson wrote:
b. What does "strict private" mean, as opposed to private without
strict? (My best guess is that it would be accessible only within the
methods+properties of that class within the unit, as opposed to being
available anywhere in the same unit where the class is declared...??
Thank you for this message! This stuff sounds really cool. In
particular, I have been itching for class constants.
A few questions come to mind:
a. 'var' sections -- I assume that 'var' is optional when declaring
fields that occur first (i.e. directly after "private", "public", etc)
b. What do
Are these features available for {$mode delphi} only?
thanks,
dmitry
___
fpc-pascal maillist - fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal
14 matches
Mail list logo