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 -- Frank Heckenbach, frank@g-n-u.de, http://fjf.gnu.de/, 7977168E GPC To-Do list, latest features, fixed bugs: http://www.gnu-pascal.de/todo.html GPC download signing key: ACB3 79B2 7EB2 B7A7 EFDE D101 CD02 4C9D 0FE0 E5E8