Re: [fpc-pascal] class constants

2008-01-26 Thread Marco van de Voort
> On 24 Jan 2008, at 20:27, Marco van de Voort wrote: > > > > To be honest, if we wouldn't be able to do that now, and a request for > > implementation came, my answer would be pretty much the same. > > I strongly disagree with that answer to those points. No surprise there. I know you are a bit

Re: [fpc-pascal] class constants

2008-01-25 Thread Vinzent Hoefler
On Friday 25 January 2008 12:30, Peter Vreman wrote: > > Regarding class constants: I missed them, too, already, although > > not too much. ;) > > Maybe you should read the documentation. Static fields are supported > already for 10 years: > > ~/fpc/compiler>>> cat p.pp > {$mode objfpc} > {$static

Re: [fpc-pascal] class constants

2008-01-25 Thread Peter Vreman
> Regarding class constants: I missed them, too, already, although not too > much. ;) Maybe you should read the documentation. Static fields are supported already for 10 years: ~/fpc/compiler>>> cat p.pp {$mode objfpc} {$static on} type cl=class l : longint;static; end; var c1,c2 : cl;

Re: [fpc-pascal] class constants

2008-01-24 Thread Vinzent Hoefler
On Thursday 24 January 2008 20:27, Marco van de Voort wrote: > > On 24 Jan 2008, at 19:45, Marco van de Voort wrote: > > >> constants. > > > > > > A constant is already in a scope, the unit. > > > > So are constants local to a function. Being able to restrict the > > scope to a certain function or

Re: [fpc-pascal] class constants

2008-01-24 Thread Jonathan Benedicto
Marco van de Voort: Class constants add the ability to provide scoped, "namespaced" constants. A constant is already in a scope, the unit. The unit scope is a very open scope. Via class constants, one gets private, protected and public scoping for constants, all of which are essential scope

Re: [fpc-pascal] class constants

2008-01-24 Thread Peter Vreman
> Marco van de Voort wrote: >>> Marco van de Voort wrote: > Does FPC support class constants, and if it doesn't, are there any plans > to add this support? Have a look at http://www.freepascal.org/faq.var#extensionselect The question would be "what would make this possib

Re: [fpc-pascal] class constants

2008-01-24 Thread Marc Weustink
Marco van de Voort wrote: Marco van de Voort wrote: Does FPC support class constants, and if it doesn't, are there any plans to add this support? Have a look at http://www.freepascal.org/faq.var#extensionselect The question would be "what would make this possible?" What about class vars? S

Re: [fpc-pascal] class constants

2008-01-24 Thread Jonas Maebe
On 24 Jan 2008, at 20:27, Marco van de Voort wrote: On 24 Jan 2008, at 19:45, Marco van de Voort wrote: A constant is already in a scope, the unit. So are constants local to a function. Being able to restrict the scope to a certain function or group of functions is nevertheless useful. T

Re: [fpc-pascal] class constants

2008-01-24 Thread Marco van de Voort
> On 24 Jan 2008, at 19:45, Marco van de Voort wrote: > >> constants. > > > > A constant is already in a scope, the unit. > > So are constants local to a function. Being able to restrict the > scope to a certain function or group of functions is nevertheless > useful. To be honest, if we woul

Re: [fpc-pascal] class constants

2008-01-24 Thread Jonas Maebe
On 24 Jan 2008, at 19:45, Marco van de Voort wrote: Henry Vermaak wrote: I'm not sure what you mean - do you mean would I be willing to write the support myself? i think he's asking what the use of it is. number 2 under the link he gave. Oh, ok. Well, I'll try to summarize: Class co

Re: [fpc-pascal] class constants

2008-01-24 Thread Marco van de Voort
> Henry Vermaak wrote: > >> I'm not sure what you mean - do you mean would I be willing to write the > >> support myself? > > > > i think he's asking what the use of it is. number 2 under the link he > > gave. > > Oh, ok. Well, I'll try to summarize: > > Class constants add the ability to provi

Re: [fpc-pascal] class constants

2008-01-24 Thread Jonathan Benedicto
Henry Vermaak wrote: I'm not sure what you mean - do you mean would I be willing to write the support myself? i think he's asking what the use of it is. number 2 under the link he gave. Oh, ok. Well, I'll try to summarize: Class constants add the ability to provide scoped, "namespaced" con

Re: [fpc-pascal] class constants

2008-01-24 Thread Henry Vermaak
On 24/01/2008, Jonathan Benedicto <[EMAIL PROTECTED]> wrote: > > I'm not sure what you mean - do you mean would I be willing to write the > support myself? i think he's asking what the use of it is. number 2 under the link he gave. henry ___ fpc-pascal

Re: [fpc-pascal] class constants

2008-01-24 Thread Jonathan Benedicto
Marco van de Voort wrote: Does FPC support class constants, and if it doesn't, are there any plans to add this support? Have a look at http://www.freepascal.org/faq.var#extensionselect The question would be "what would make this possible?" Hi Marco, I'm not sure what you mean - do you mean

Re: [fpc-pascal] class constants

2008-01-24 Thread Marco van de Voort
> Marco van de Voort wrote: > >> Does FPC support class constants, and if it doesn't, are there any plans > >> to add this support? > > > > Have a look at > > http://www.freepascal.org/faq.var#extensionselect > > > > The question would be "what would make this possible?" > > What about class v

Re: [fpc-pascal] class constants

2008-01-24 Thread Joao Morais
Marco van de Voort wrote: Does FPC support class constants, and if it doesn't, are there any plans to add this support? Have a look at http://www.freepascal.org/faq.var#extensionselect The question would be "what would make this possible?" What about class vars? ___

Re: [fpc-pascal] class constants

2008-01-24 Thread Joao Morais
Leonardo M. Ramé wrote: With your response I assume he meant something like "static attributes" when he said "class constants". Yup. A class variable is another matter, which afaik cannot be reached with one class per unit approach. --- Joao Morais <[EMAIL PROTECTED]> wrote: A class fu

Re: [fpc-pascal] class constants

2008-01-24 Thread Leonardo M. Ram
With your response I assume he meant something like "static attributes" when he said "class constants". --- Joao Morais <[EMAIL PROTECTED]> wrote: > A class function would be a better approach. > >

Re: [fpc-pascal] class constants

2008-01-24 Thread Joao Morais
Leonardo M. Ramé wrote: Jonathan, I never needed such type of feature, a propossed solution is to create one unit per class, and declare your constants in the implementation section of each unit. A class function would be a better approach. Example: unit People interface type TPeople

Re: [fpc-pascal] class constants

2008-01-24 Thread Marco van de Voort
> > Does FPC support class constants, and if it doesn't, are there any plans > to add this support? Have a look at http://www.freepascal.org/faq.var#extensionselect The question would be "what would make this possible?" ___ fpc-pascal maillist - fp

Re: [fpc-pascal] class constants

2008-01-23 Thread Leonardo M. Ram
Jonathan, I never needed such type of feature, a propossed solution is to create one unit per class, and declare your constants in the implementation section of each unit. Example: unit People interface type TPeople = class .. end; implementation const name = 'default name'; ...

RE: [fpc-pascal] class constants

2008-01-23 Thread Cox, Stuart TRAN:EX
PROTECTED] -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Jonathan Benedicto Sent: Wednesday, January 23, 2008 11:26 AM To: FPC-Pascal Subject: [fpc-pascal] class constants Hello, Does FPC support class constants, and if it doesn't, are there any pla

[fpc-pascal] class constants

2008-01-23 Thread Jonathan Benedicto
Hello, Does FPC support class constants, and if it doesn't, are there any plans to add this support? Example: type TMyClass = class begin private const MyConst = '123'; end; Jon ___ fpc-pascal maillist - fpc-pascal@lists.fre