Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / fpc-pascal / 2014-02

Generics and key words

4 messages · 3 people ·

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

silvioprog

Hello,

Can I use it:

TBrookAction<TBrookEntity> = class(TBrookObject)
...

instead of?:

generic TBrookAction<TBrookEntity> = class(TBrookObject) ...

And, can I use it:

TPersonAction = class(TBrookAction<TPerson>)
...

instead of?:

TPersonAction = class(specialize TBrookAction<TPerson>) ...

This would save typing.

Sorry, I'm beginner in generics.

Silvio Clécio My public projects - github.com/silvioprog
Sven Barth
to silvioprog
silvioprog wrote 26 lines
Hello, Can I use it: TBrookAction<TBrookEntity> = class(TBrookObject) ... instead of?: generic TBrookAction<TBrookEntity> = class(TBrookObject) ... And, can I use it: TPersonAction = class(TBrookAction<TPerson>) ... instead of?: TPersonAction = class(specialize TBrookAction<TPerson>) ... This would save typing. Sorry, I'm beginner in generics.

Currently only in mode Delphi.

Regards,
Sven

silvioprog
to Sven Barth

2014-02-13 5:43 GMT-02:00 Sven Barth :

Show quoted text 32 lines
Am 13.02.2014 01:28, schrieb silvioprog: > Hello, > > Can I use it: > > TBrookAction<TBrookEntity> = class(TBrookObject) > ... > > instead of?: > > generic TBrookAction<TBrookEntity> = class(TBrookObject) > ... > > And, can I use it: > > TPersonAction = class(TBrookAction<TPerson>) > ... > > instead of?: > > TPersonAction = class(specialize TBrookAction<TPerson>) > ... > > This would save typing. > > Sorry, I'm beginner in generics. > > Currently only in mode Delphi. Regards, Sven

Thank you Sven!

Silvio Clécio My public projects - github.com/silvioprog