Re: [fpc-pascal] Implementing a true Singleton - Can we decrease the visibility of a method?

2006-12-08 Thread Graeme Geldenhuys
On 12/8/06, Vincent Snijders [EMAIL PROTECTED] wrote: I think the solution is to create a public constructor which throws an NotImplemented exception or something like that. Ok, that works, or at least stops a developer from trying to create a instance directly. In the exception message, I

Re: [fpc-pascal] Implementing a true Singleton - Can we decrease the visibility of a method?

2006-12-08 Thread Jonas Maebe
On 8 dec 2006, at 10:55, Graeme Geldenhuys wrote: I still don't know why we can't decrease visibility in Free Pascal. Is there some internal language design that prevents it? At least Borland explicitly says you cannot do that:

Re: [fpc-pascal] Implementing a true Singleton - Can we decrease the visibility of a method?

2006-12-08 Thread TOndrej
On 12/8/06, Graeme Geldenhuys [EMAIL PROTECTED] wrote: I still don't know why we can't decrease visibility in Free Pascal. Is there some internal language design that prevents it? A class definition (or at least its parts visible from outside) can be understood as a kind of contract. If you

Re: [fpc-pascal] Implementing a true Singleton - Can we decrease the visibility of a method?

2006-12-08 Thread Graeme Geldenhuys
On 12/8/06, Jonas Maebe [EMAIL PROTECTED] wrote: Quote: You should not change the access modifier for inherited members. So it's possible but discouraged, and they give warnings (and sometimes errors) for it with the recommendation Do not exclude a warning from this rule. There is a lot of

Re: [fpc-pascal] Implementing a true Singleton - Can we decrease the visibility of a method?

2006-12-08 Thread Vincent Snijders
Graeme Geldenhuys schreef: On 12/8/06, Jonas Maebe [EMAIL PROTECTED] wrote: Quote: You should not change the access modifier for inherited members. So it's possible but discouraged, and they give warnings (and sometimes errors) for it with the recommendation Do not exclude a warning from this

Re: [fpc-pascal] Implementing a true Singleton - Can we decrease the visibility of a method?

2006-12-08 Thread Jonas Maebe
On 8 dec 2006, at 14:03, Graeme Geldenhuys wrote: There is a lot of things in life we shouldn't do, but we do. :-) At least give us the choice, maybe via a compiler directive and keep the compiler warning in place. That way we can use it responsibly when required, This is a generic

Re: [fpc-pascal] Implementing a true Singleton - Can we decrease the visibility of a method?

2006-12-08 Thread TOndrej
I'm not even sure if there is a language which allows demoting visibility of inherited class members. It would seem odd to me. Just my 2c, of course. ;-) C++, C#, VB.Net are three I know of. I think Java also allows it. In these languages, AFAIK, it's allowed, the compiler generates a

[fpc-pascal] Article on Pixel.

2006-12-08 Thread Michael Van Canneyt
Hi, The latest issue of Linux Journal features an article about Pixel (By Pavel Kanzelsberger). It gives it a very good comment. Pity it's not mentioned that it's written using FPC. (the article is written by a writer/publisher, not a programmer). For the Lazarus users: Pixel is written using

Re: [fpc-pascal] Implementing a true Singleton - Can we decrease the visibility of a method?

2006-12-08 Thread Steve Williams
I found this by trying to implement a True Singleton in Free Pascal / Delphi. For those that don't know, a Singleton is a Design Pattern that allows only one instance of a class. It seems it is impossible to do in Free Pascal / Delphi. :-( Try this. http://bdn.borland.com/article/22576 --

Re: [fpc-pascal] Implementing a true Singleton - Can we decrease thevisibility of a method?

2006-12-08 Thread Matt Emson
On 8 dec 2006, at 10:55, Graeme Geldenhuys wrote: I still don't know why we can't decrease visibility in Free Pascal. Is there some internal language design that prevents it? At least Borland explicitly says you cannot do that:

Re: [fpc-pascal] Implementing a true Singleton - Can we decrease the visibility of a method?

2006-12-08 Thread Andreas Berger
Graeme Geldenhuys wrote: On 12/8/06, TOndrej [EMAIL PROTECTED] wrote: On 12/8/06, Graeme Geldenhuys [EMAIL PROTECTED] wrote: I still don't know why we can't decrease visibility in Free Pascal. Is there some internal language design that prevents it? A class definition (or at least its

Re: [fpc-pascal] Good revision on wince cross-compiler

2006-12-08 Thread TOndrej
On 12/8/06, Felipe Monteiro de Carvalho [EMAIL PROTECTED] wrote: Does anyone know a good revision that works with Lazarus-WinCE? A few weeks ago I experimented and found out that fpc 5389 and Lazarus 10204 worked for me on arm-wince. I'm sticking to these revisions for the time being, making

Re: [fpc-pascal] Implementing a true Singleton - Can we decrease the visibility of a method?

2006-12-08 Thread Marc Santhoff
Am Freitag, den 08.12.2006, 10:50 +0200 schrieb Graeme Geldenhuys: Bottom line: How can we hide the constructor of a class? As far as I can see you cannot decrease the visibility of a method compared to it's inherited class. Why shouldn't we be allowed to? C++, C# does! I found this by

[fpc-pascal] UML state machine drawing tool

2006-12-08 Thread Marc Santhoff
Hi, is anyone aware of a UML tool capable of making class diagrams and state diagrams and emitting fpc compilable pascal code (or at least being configurable to do so)? TIA, Marc ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org

Re: [fpc-pascal] Implementing a true Singleton - Can we decrease the visibility of a method?

2006-12-08 Thread Micha Nelissen
Daniƫl Mantione wrote: Op Fri, 8 Dec 2006, schreef Micha Nelissen: Btw, I think singletons are nonsense too. Why is a global variable evil, and a singleton class not ? Well, a singleton can hide and/or protect its private data. Not more than a global variable of the same class type ?

Re: [fpc-pascal] UML state machine drawing tool

2006-12-08 Thread Michael Van Canneyt
On Fri, 8 Dec 2006, Marc Santhoff wrote: Hi, is anyone aware of a UML tool capable of making class diagrams and state diagrams and emitting fpc compilable pascal code (or at least being configurable to do so)? I think Umbrello (part of KDE) can do this. It can save everything as XML, I

Re: [fpc-pascal] UML state machine drawing tool

2006-12-08 Thread Felipe Monteiro de Carvalho
On 12/8/06, Marc Santhoff [EMAIL PROTECTED] wrote: is anyone aware of a UML tool capable of making class diagrams and state diagrams and emitting fpc compilable pascal code (or at least being configurable to do so)? I did a quick search and found this:

Re: [fpc-pascal] Implementing a true Singleton - Can we decrease the visibility of a method?

2006-12-08 Thread Dean Zobec
Try this. http://bdn.borland.com/article/22576 NewInstance/FreeInstance is what I would have recommended as well. Maybe we should include an implementation in FPC by default ? How ? The article works as-is AFAIK. Btw, I think singletons are nonsense too. Why is a global variable evil, and

[fpc-pascal] GetEpochTime not found

2006-12-08 Thread Marc Santhoff
Hi, I've got some funny problem here. The program compiled well with fpc up to version 1.9.4. I haven't touched it for a while and now it fails with fpc 2.0.2. The source snippet in queston is: function TStorable.generateID: integer; begin //writeln(GetEpochTime); does not work anymore result

Re: [fpc-pascal] UML state machine drawing tool

2006-12-08 Thread Marc Santhoff
Am Freitag, den 08.12.2006, 21:40 +0100 schrieb Michael Van Canneyt: On Fri, 8 Dec 2006, Marc Santhoff wrote: Hi, is anyone aware of a UML tool capable of making class diagrams and state diagrams and emitting fpc compilable pascal code (or at least being configurable to do so)?