[fpc-pascal] Writeable typed constants - what's the point?

2009-06-18 Thread Graeme Geldenhuys
Hi, Recently I learned that you can have writeable typed constants. That sounds rather like an oxymoron to my. Writeable constants make no sense, is that then simply a variable? What is the use of a writeable typed constant? Below is two examples of how they can be used, and support for them are

Re: [fpc-pascal] Writeable typed constants - what's the point?

2009-06-18 Thread Vincent Snijders
Graeme Geldenhuys schreef: Hi, Recently I learned that you can have writeable typed constants. That sounds rather like an oxymoron to my. Writeable constants make no sense, is that then simply a variable? What is the use of a writeable typed constant? Backwards compatibility with turbo

Re: [fpc-pascal] Writeable typed constants - what's the point?

2009-06-18 Thread Graeme Geldenhuys
Vincent Snijders wrote: Backwards compatibility with turbo pascal, which lacked initialized variables and writable constants were the alternative. Thanks Vincent. The Kylix 3 help mentioned early versions of Delphi and Borland Pascal, which made me think that it must have been some limitation

Re: [fpc-pascal] Writeable typed constants - what's the point?

2009-06-18 Thread fpclist
On Thursday 18 June 2009 08:51:13 Vincent Snijders wrote: Graeme Geldenhuys schreef: Hi, Recently I learned that you can have writeable typed constants. That sounds rather like an oxymoron to my. Writeable constants make no sense, is that then simply a variable? What is the use of a

Re: [fpc-pascal] Writeable typed constants - what's the point?

2009-06-18 Thread Graeme Geldenhuys
fpcl...@silvermono.co.za wrote: Is this likely to be dropped in future versions of FPC? No idea. But I have noticed that FPC (mode objfpc) defaults to allow writeable typed constants, whereas Delphi and Kylix doesn't. In the latter two compilers you have to enable is support with $J+ compiler

Re: [fpc-pascal] Writeable typed constants - what's the point?

2009-06-18 Thread Graeme Geldenhuys
I don't know (have not tested) what FPC does with mode delphi though. OK, just tested FPC modes objfpc and delphi. In both cases writeable typed constants are allow by default. This is not compatible with current Delphi compilers. I still think this should be disable by default in both

Re: [fpc-pascal] Writeable typed constants - what's the point?

2009-06-18 Thread fpclist
On Thursday 18 June 2009 10:48:57 Graeme Geldenhuys wrote: I don't know (have not tested) what FPC does with mode delphi though. But seeing that this feature is just for backward compatibility, maybe it should be disallowed by default in mode objfpc as well? It also works in Delphi mode.

Re: [fpc-pascal] Writeable typed constants - what's the point?

2009-06-18 Thread Vincent Snijders
Graeme Geldenhuys schreef: I don't know (have not tested) what FPC does with mode delphi though. OK, just tested FPC modes objfpc and delphi. In both cases writeable typed constants are allow by default. This is not compatible with current Delphi compilers. I still think this should be

Re: [fpc-pascal] Writeable typed constants - what's the point?

2009-06-18 Thread Graeme Geldenhuys
Vincent Snijders wrote: I disagree. It would be backwards incompatible with existing objfpc programs. That decision should have been made 10 (?) years ago, when mode objfpc was introduced. Not everything was done correctly 10 years ago (or first time round). There are many bug reports still

Re: [fpc-pascal] Writeable typed constants - what's the point?

2009-06-18 Thread Florian Klaempfl
Graeme Geldenhuys schrieb: Vincent Snijders wrote: I disagree. It would be backwards incompatible with existing objfpc programs. That decision should have been made 10 (?) years ago, when mode objfpc was introduced. Not everything was done correctly 10 years ago (or first time round).

Re: [fpc-pascal] Writeable typed constants - what's the point?

2009-06-18 Thread fpclist
It's intersting to note that as far back as Delphi 5,(oldest I have on my system), attempting to write to a typed constant causes a left side cannot be assigned to compiler error. I guess as long as FPC compiler offers TP7 compatibility, this feature must be retained. Also, bear in mind that

Re: [fpc-pascal] Writeable typed constants - what's the point?

2009-06-18 Thread Marco van de Voort
In our previous episode, Florian Klaempfl said: Not everything was done correctly 10 years ago (or first time round). Nevertheless, writable typed constants are simply an important part of Borland style Object Pascal. Is it, since D4 also supports var? I agree it is a sterile difference,

Re: [fpc-pascal] Writeable typed constants - what's the point?

2009-06-18 Thread Graeme Geldenhuys
Florian Klaempfl wrote: Nevertheless, writable typed constants are simply an important part of Borland style Object Pascal. I'm not arguing that. Then maybe writeable typed constants should be disabled for compiler mode delphi at least. It's a Delphi compatibility issue after all. Just this

Re: [fpc-pascal] Writeable typed constants - what's the point?

2009-06-18 Thread Martin Friebe
Graeme Geldenhuys wrote: FPC often implements something that breaks existing code. Examples :)? Please note that I am not saying I disagree with the changes. I know they were introduced for the better. What I am saying, is that changes do get introduced into FPC (for whatever

Re: [fpc-pascal] Writeable typed constants - what's the point?

2009-06-18 Thread Graeme Geldenhuys
Martin Friebe wrote: Afaik 1 3 are the same? True. And if I understand the changes where mad, because this feature was broken before: To quote myself, even though I know one shouldn't. ;-) I know they were introduced for the better. I was not arguing the point that those changes

Re: [fpc-pascal] object.ClassInfo.Create

2009-06-18 Thread Marc Weustink
Martin wrote: Just got a question, to ensure I understand thinks correctly. Let's start with stuff I definitely know (or think so). Destructors are virtual/overriden, because they are called on the instance, and the instance may be assigned to a variable foo: Tobject, which would call

Re: [fpc-pascal] Writeable typed constants - what's the point?

2009-06-18 Thread Paul Nicholls
2009/6/18 Graeme Geldenhuys grae...@opensoft.homeip.net Vincent Snijders wrote: Backwards compatibility with turbo pascal, which lacked initialized variables and writable constants were the alternative. Thanks Vincent. The Kylix 3 help mentioned early versions of Delphi and Borland

Re: [fpc-pascal] Writeable typed constants - what's the point?

2009-06-18 Thread Jürgen Hestermann
Paul Nicholls schrieb: I also find writable constants hand for things like this where I can define the 'variable' + values too so I don't have to set the values at run time: But can't you do the same with a variable declaration? If you want to change the value at runtime it's definitely