[fpc-devel] for-in-index loop

Mark Morgan Lloyd markMLl.fpc-devel at telemetry.co.uk
Sat Jan 26 15:05:16 CET 2013


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]



More information about the fpc-devel mailing list