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 __

Re: [fpc-pascal] use cwstring or fpwidestring on linux

2013-10-07 Thread ko paka
When I used both managers, like in example, program doesnt work as expected. Should I report it as error ? For now I will stay with cwstring manager, but good to know that there is native implementation(first I need to study something about unicode and collation though) . In fpc sources I found fpw

Re: [fpc-pascal] Getting the state of a TRTLCriticalSection

2013-10-07 Thread Mark Morgan Lloyd
Jonas Maebe wrote: On 07 Oct 2013, at 11:33, Marco van de Voort wrote: In our previous episode, Jonas Maebe said: [interlocked increment/decrement] They do not include any memory barrier. The only thing those routines guarantee on all platforms, is that the value is atomically incremented/dec

Re: [fpc-pascal] Getting the state of a TRTLCriticalSection

2013-10-07 Thread Jonas Maebe
On 07 Oct 2013, at 11:33, Marco van de Voort wrote: In our previous episode, Jonas Maebe said: [interlocked increment/decrement] They do not include any memory barrier. The only thing those routines guarantee on all platforms, is that the value is atomically incremented/decremented. (btw th

Re: [fpc-pascal] Getting the state of a TRTLCriticalSection

2013-10-07 Thread Mark Morgan Lloyd
Jonas Maebe wrote: On 07 Oct 2013, at 09:14, Mark Morgan Lloyd wrote: Benito van der Zander wrote: In the end I stuck in code to increment/decrement a counter, and looked for it to be explicitly 0 or 1. Do you need to put a memory barrier around that, or does the critical section take care

Re: [fpc-pascal] Getting the state of a TRTLCriticalSection

2013-10-07 Thread Marco van de Voort
In our previous episode, Jonas Maebe said: > > I used the interlocked increment/decrement, which- as I understand > > it- should handle membar itself on architectures that can benefit > > from it. > > They do not include any memory barrier. The only thing those routines > guarantee on all pl

Re: [fpc-pascal] Getting the state of a TRTLCriticalSection

2013-10-07 Thread Jonas Maebe
On 07 Oct 2013, at 09:14, Mark Morgan Lloyd wrote: Benito van der Zander wrote: In the end I stuck in code to increment/decrement a counter, and looked for it to be explicitly 0 or 1. Do you need to put a memory barrier around that, or does the critical section take care of that? I used

Re: [fpc-pascal] use cwstring or fpwidestring on linux

2013-10-07 Thread Michael Schnell
On 10/04/2013 11:02 PM, Sven Barth wrote: If you want to share Unicode- or AnsiStrings between library and application you need to use a common memory manager. For example you could use unit "cmem" as one of the first units of both programs. It will work on Unix based systems and *should* wor

Re: [fpc-pascal] Getting the state of a TRTLCriticalSection

2013-10-07 Thread Mark Morgan Lloyd
Benito van der Zander wrote: In the end I stuck in code to increment/decrement a counter, and looked for it to be explicitly 0 or 1. Do you need to put a memory barrier around that, or does the critical section take care of that? I used the interlocked increment/decrement, which- as I unde