Re: [fpc-pascal] [OT] sealed?

2013-10-08 Thread Paul Ishenin
08.10.2013 17:35, Graeme Geldenhuys пишет: All good and well, but I really don't see the point of a class that you can't extend. The original developer can never foresee all possible use cases in the future. We already have issues with some classes defining fields or methods and private, when t

Re: [fpc-pascal] [OT] sealed?

2013-10-08 Thread Graeme Geldenhuys
On 2013-10-07 19:35, Sven Barth wrote: > > Simple: You are not allowed to create child classes of sealed classes > (the compiler enforces this). FPC supports this since 2.4.2. All good and well, but I really don't see the point of a class that you can't extend. The original developer can never

Re: [fpc-pascal] [OT] sealed?

2013-10-08 Thread Sven Barth
Am 08.10.2013 09:12 schrieb "Mark Morgan Lloyd" < markmll.fpc-pas...@telemetry.co.uk>: > > Sven Barth wrote: >> >> On 07.10.2013 19:29, silvioprog wrote: >>> >>> Hello, >>> >>> I was surfing the internet and came across this structure Delphi: >>> >>> >>> TJSONPair= class sealed(TJSONAncestor) >>>

Re: [fpc-pascal] [OT] sealed?

2013-10-08 Thread Mark Morgan Lloyd
Sven Barth wrote: On 07.10.2013 19:29, silvioprog wrote: Hello, I was surfing the internet and came across this structure Delphi: TJSONPair= class sealed(TJSONAncestor) So, what is this? Simple: You are not allowed to create child classes of sealed classes (the compiler enforces this).

Re: [fpc-pascal] [OT] sealed?

2013-10-07 Thread Sven Barth
Am 08.10.2013 05:23 schrieb "Dennis Poon" : > > > It is wonderful, thank you very much Sven! :) >> >> >> Well, the opinion whether this feature is wonderful or not differs among FPC/Delphi users :P >> >> Regards, >> Sven >> > May I know the usual use of such feature? I can only think of library ve

Re: [fpc-pascal] [OT] sealed?

2013-10-07 Thread Dmitry Boyarintsev
Actually, it's useful when used a platform-specific keyword (i.e. for declaring an external Java-class, which can be finalized). It was introduced for platform-specific needs (delphi.net), but became a part of the language. thanks, Dmitry On Tue, Oct 8, 2013 at 12:14 AM, Dmitry Boyarintsev < sk

Re: [fpc-pascal] [OT] sealed?

2013-10-07 Thread Dmitry Boyarintsev
A well written class doesn't need to be sealed. As well as doesn't require an inheritance. IIRC, "sealed" was added to delphi language at the time of the delphi .nettism. Correct me, if I'm wrong but Delphi-net is dead (replaced by Oxygen, which is not delphi or pascal). However, since the keyword

Re: [fpc-pascal] [OT] sealed?

2013-10-07 Thread Dennis Poon
> It is wonderful, thank you very much Sven! :) Well, the opinion whether this feature is wonderful or not differs among FPC/Delphi users :P Regards, Sven May I know the usual use of such feature? I can only think of library vendors want to seal a class to prevent users from modifying it w

Re: [fpc-pascal] [OT] sealed?

2013-10-07 Thread silvioprog
2013/10/7 Sven Barth > On 07.10.2013 20:38, silvioprog wrote: > >> 2013/10/7 Sven Barth > > >> >> On 07.10.2013 19:29, silvioprog wrote: >> >> Hello, >> >> I was surfing the internet and came across this structure Delphi: >> >> >>

Re: [fpc-pascal] [OT] sealed?

2013-10-07 Thread Sven Barth
On 07.10.2013 20:38, silvioprog wrote: 2013/10/7 Sven Barth mailto:pascaldra...@googlemail.com>> On 07.10.2013 19:29, silvioprog wrote: Hello, I was surfing the internet and came across this structure Delphi: TJSONPair= class sealed(TJSONAncestor) So,

Re: [fpc-pascal] [OT] sealed?

2013-10-07 Thread silvioprog
2013/10/7 Sven Barth > On 07.10.2013 19:29, silvioprog wrote: > >> Hello, >> >> I was surfing the internet and came across this structure Delphi: >> >> >> TJSONPair= class sealed(TJSONAncestor) >> >> >> So, what is this? >> > > Simple: You are not allowed to create child classes of sealed class

Re: [fpc-pascal] [OT] sealed?

2013-10-07 Thread Sven Barth
On 07.10.2013 19:29, silvioprog wrote: Hello, I was surfing the internet and came across this structure Delphi: TJSONPair= class sealed(TJSONAncestor) So, what is this? Simple: You are not allowed to create child classes of sealed classes (the compiler enforces this). FPC supports this

[fpc-pascal] [OT] sealed?

2013-10-07 Thread silvioprog
Hello, I was surfing the internet and came across this structure Delphi: TJSONPair = class sealed(TJSONAncestor) So, what is this? Link: http://docwiki.embarcadero.com/Libraries/XE3/en/API:Data.DBXJSON.TJSONPair -- Silvio Clécio My public projects - github.com/silvioprog __