class operator in record

classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

class operator in record

noreply
How come:

   class operator Initialize(var aFoo: TFoo);
   class operator Finalize(var aFoo: TFoo);

in a record are called class operator..

why not "record operator"?

Are these advanced neo-records considered classes?

Again, sorry I'm new to all this new record stuff (neo records ;-))

If they really are just classes, shouldn't it be called a class instead
of record.

This also reminds me of the confusion between what an object is versus a
class.
_______________________________________________
fpc-pascal maillist  -  [hidden email]
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: class operator in record

Graeme Geldenhuys-6
On 2017-03-01 02:39, [hidden email] wrote:
> How come:
>
>    class operator Initialize(var aFoo: TFoo);
>    class operator Finalize(var aFoo: TFoo);
>
> in a record are called class operator..
>
> why not "record operator"?


hahaha... You are asking all the questions I've been meaning to ask too.
From your question, just goes to show how rubbish Delphi is being
designed these days. Mixing concepts of class and record
interchangeably. And now we have "records" with constructors and
destructors! WTF. EMBT/Delphi are seriously polluting the Object Pascal
with all this rubbish. Unfortunately FPC feels like they need to follow
them like lemmings.

Regards,
  Graeme

--
fpGUI Toolkit - a cross-platform GUI toolkit using Free Pascal
http://fpgui.sourceforge.net/

My public PGP key:  http://tinyurl.com/graeme-pgp
_______________________________________________
fpc-pascal maillist  -  [hidden email]
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: class operator in record

Sven Barth-2
In reply to this post by noreply

Am 01.03.2017 03:39 schrieb <[hidden email]>:
>
> How come:
>
>   class operator Initialize(var aFoo: TFoo);
>   class operator Finalize(var aFoo: TFoo);
>
> in a record are called class operator..
>
> why not "record operator"?
>
> Are these advanced neo-records considered classes?

It's simply that Delphi introduced static methods to records using the same syntax as for classes and operators followed along.

We've simply followed that along as we would have needed to do so at least for mode Delphi anyway and the implementor of advanced records decided not to deviate from that.

Regards,
Sven


_______________________________________________
fpc-pascal maillist  -  [hidden email]
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: class operator in record

Sven Barth-2
In reply to this post by Graeme Geldenhuys-6

Am 01.03.2017 10:06 schrieb "Graeme Geldenhuys" <[hidden email]>:
>
> On 2017-03-01 02:39, [hidden email] wrote:
> > How come:
> >
> >    class operator Initialize(var aFoo: TFoo);
> >    class operator Finalize(var aFoo: TFoo);
> >
> > in a record are called class operator..
> >
> > why not "record operator"?
>
>
> hahaha... You are asking all the questions I've been meaning to ask too.
> From your question, just goes to show how rubbish Delphi is being
> designed these days. Mixing concepts of class and record
> interchangeably. And now we have "records" with constructors and
> destructors! WTF. EMBT/Delphi are seriously polluting the Object Pascal
> with all this rubbish. Unfortunately FPC feels like they need to follow
> them like lemmings.

Records don't allow destructors, only constructors. Also they allow to more tightly couple initialization functions for some record with the record they belong to. Same for operators by the way: without them you couldn't use a record's operators in generics. Also I personally prefer to have routines that deal explicitly with a given records type as part of said record.

Regards,
Sven


_______________________________________________
fpc-pascal maillist  -  [hidden email]
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: class operator in record

Marco van de Voort
In reply to this post by Sven Barth-2
In our previous episode, Sven Barth said:

> >
> > why not "record operator"?
> >
> > Are these advanced neo-records considered classes?
>
> It's simply that Delphi introduced static methods to records using the same
> syntax as for classes and operators followed along.
>
> We've simply followed that along as we would have needed to do so at least
> for mode Delphi anyway and the implementor of advanced records decided not
> to deviate from that.

Moreover it doesn't add anything and it only means an extra requirement for
editing to change a record to a class and viceversa.
_______________________________________________
fpc-pascal maillist  -  [hidden email]
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: class operator in record

noreply
In reply to this post by Graeme Geldenhuys-6
On 2017-03-01 03:06, Graeme Geldenhuys wrote:

> On 2017-03-01 02:39, [hidden email] wrote:
>> How come:
>>
>>    class operator Initialize(var aFoo: TFoo);
>>    class operator Finalize(var aFoo: TFoo);
>>
>> in a record are called class operator..
>>
>> why not "record operator"?
>
>
> hahaha... You are asking all the questions I've been meaning to ask
> too.
> From your question, just goes to show how rubbish Delphi is being
> designed these days. Mixing concepts of class and record
> interchangeably. And now we have "records" with constructors and
> destructors! WTF. EMBT/Delphi are seriously polluting the Object Pascal
> with all this rubbish. Unfortunately FPC feels like they need to follow
> them like lemmings.
>

I don't blame FPC for following them in some respects because it enables
compatible code to be shared between FPC and delphi, but I get what you
mean..

Oberon is a fresh new start without all this rubbish but look where
oberon is: no where.
Almost no one uses it, nor cares about it..

so if fpc does things right and diverges from delphi, you have
incompatibility ...

But I see what you mean and understand your point
_______________________________________________
fpc-pascal maillist  -  [hidden email]
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
Loading...