[Lazarus] const array syntax

Marc Weustink marc.weustink at cuperus.nl
Tue Jan 12 12:15:21 CET 2010


>> Alexander Klenin schrieb:
>> 1) Proposed syntax seems somewhat suboptimal. Historically, Pascal
>> used redundancy and keywords to minimize the chance of errors and
>> make diagnostics easier. In that spirit, I think some active indication
>> of arbitrary upper bound is preferable to a mere omission:
>> IDECommandStrs: array[0..*] of TIdentMapEntry = (
>> IDECommandStrs: array[0..auto] of TIdentMapEntry = (
>> IDECommandStrs: array[0..end] of TIdentMapEntry = (
>
> I would vote for "auto".

I wont, since the following would fail:

const
   auto = 10;
   arr: [1..auto] of Integer = (1, 2, 3);

I would go for
   arr: [1..] of Integer = (1, 2, 3);

Marc





More information about the Lazarus mailing list