Re: [Lazarus] array[0..n] of class of TSomething

2011-07-12 Thread leledumbo
Seems like codetools parser bug. Try writing it type by type: type Tp2pMessageClass = class of Tp2pMessage; Tp2pMessageClassArray = array [0 .. 1] of Tp2pMessageClass; const MsgTypes: Tp2pMessageClassArray = ( ... ); -- View this message in context: http://free-pascal-lazarus.989080

Re: [Lazarus] array[0..n] of class of TSomething

2011-07-12 Thread Sven Barth
On 12.07.2011 18:38, leledumbo wrote: Seems like codetools parser bug. Try writing it type by type: type Tp2pMessageClass = class of Tp2pMessage; Tp2pMessageClassArray = array [0 .. 1] of Tp2pMessageClass; const MsgTypes: Tp2pMessageClassArray = ( ... ); Free Pascal supports "

Re: [Lazarus] array[0..n] of class of TSomething

2011-07-12 Thread Hans-Peter Diettrich
Sven Barth schrieb: On 12.07.2011 18:38, leledumbo wrote: Seems like codetools parser bug. Try writing it type by type: type Tp2pMessageClass = class of Tp2pMessage; Tp2pMessageClassArray = array [0 .. 1] of Tp2pMessageClass; const MsgTypes: Tp2pMessageClassArray = ( ... ); F

Re: [Lazarus] array[0..n] of class of TSomething

2011-07-12 Thread Flávio Etrusco
On Tue, Jul 12, 2011 at 7:53 PM, Hans-Peter Diettrich wrote: > Sven Barth schrieb: >> >> On 12.07.2011 18:38, leledumbo wrote: >>> >>> Seems like codetools parser bug. Try writing it type by type: >>> >>> type >>>   Tp2pMessageClass = class of Tp2pMessage; >>>   Tp2pMessageClassArray = array [0 ..

Re: [Lazarus] array[0..n] of class of TSomething

2011-07-13 Thread Hans-Peter Diettrich
Flávio Etrusco schrieb: Err, why pollute the namespace with an identifier you'll only refer once? For clarity? Code is not only written for the compiler, but also for human readers. Look at the C syntax for type declarations, where some constructs are nearly unparsable by humans (without pen

Re: [Lazarus] array[0..n] of class of TSomething

2011-07-13 Thread Flávio Etrusco
On Wed, Jul 13, 2011 at 6:36 AM, Hans-Peter Diettrich wrote: > Flávio Etrusco schrieb: > >> Err, why pollute the namespace with an identifier you'll only refer >> once? > > For clarity? Code is not only written for the compiler, but also for human > readers. Look at the C syntax for type declarati

Re: [Lazarus] array[0..n] of class of TSomething

2011-07-13 Thread Mark Morgan Lloyd
Hans-Peter Diettrich wrote: Flávio Etrusco schrieb: Err, why pollute the namespace with an identifier you'll only refer once? For clarity? Code is not only written for the compiler, but also for human readers. As are comments. Particularly for a rarely-used construct like 'class of' I thi