Sven Barth wrote:

As Michael said Pascal is a declarative language (though this has been forgotten some times) so I'd allow the declaration of tuple types using something like "tuple of (type1, type2, etc.)"

etc. Yes, I like it. This also sorts out the lack of multiple assignment that somebody was complaining about in the fpc-pascal ML a few days ago.

Some way of extending a single value to fill a tuple where all the elements are of the same type would be useful, note that I'm not suggesting any other relaxation of type checking.

(x, y, z) := (0, 0, 0);         // OK
(x, y, z) := Tuple(0);          // OK
(x, y, z) := (0, 0);            // Not OK
(x, y, z) := Tuple(0, 0);       // Not OK

So if I understand things correctly, brackets [] are used where the number of contained elements is indeterminate (sets, multidimensional array indices, arrays of const) and parentheses where it's determinate (tuples, record initialisation etc.).

--
Mark Morgan Lloyd
markMLl .AT. telemetry.co .DOT. uk

[Opinions above are the author's, not those of his employers or colleagues]
_______________________________________________
fpc-devel maillist  -  [email protected]
http://lists.freepascal.org/mailman/listinfo/fpc-devel

Reply via email to