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

Hans-Peter Diettrich DrDiettrich1 at aol.com
Wed Jul 13 11:36:17 CEST 2011


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 and paper).

The name also may be useful in debugging and RTTI, and with every usage 
of an array element in code.

Pascal is a strongly typed language, where e.g. for local variables or 
parameter types a unique type name is a must!

DoDi





More information about the Lazarus mailing list