Waldek Hebisch wrote:
Frank Heckenbach wrote:
Adriaan van Os wrote:
vanam srihari kumar wrote:
TYPE MaxCPlus_RArray = ARRAY[1..MaxCplus] OF REAL; Maxcomp_Array = ARRAY[1..Maxcomp] OF REAL;
CONST wPAF : Maxcomp_Array = [ 0.040, 0.225,
<snip> > > > 0 ]; > > The problem with this syntax is that it really looks like set > constants ([1, 2, 3]), especially if the array fields are ordinal > types. So changing it should also make the code somewhat more > readable IMHO.
Current GPC version allows:
CONST Maxcomp = 3; TYPE Maxcomp_Array = ARRAY[1..Maxcomp] OF REAL; CONST wPAF : Maxcomp_Array = [ 0.040; 0.225; 0 ];
Indeed, that's closer to the original.
(with semicolons as separators). The compiler (and presumably human readers too) use type information to decide the meaning of the list. I think that we can easily add Sun syntax (if we want to).
Are you sure it's so easy? Even if the element type is ordinal, and it occurs deep within another structure (so you can't easily decide while parsing whether it will become a set or an array)?
Frank