>-----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 syntax was extended to support delphi code
>
>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/properties.
>
>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?

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 the overlap area 
is a class function rather than an instance function/method of either of the 
two polygons.  Contrived, but imaginable.

>-- 
>Doug C.
>-----
>A: Because it messes up the order in which people normally read text.
>Q: Why is top-posting such a bad thing?
>A: Top-posting.
>Q: What is the most annoying thing in e-mail?
>_______________________________________________
>fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
>http://lists.freepascal.org/mailman/listinfo/fpc-pascal
_______________________________________________
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal

Reply via email to