[fpc-devel] RFC: Support for new type "tuple" v0.1

Mark Morgan Lloyd markMLl.fpc-devel at telemetry.co.uk
Sat Jan 26 20:25:50 CET 2013


Michael Van Canneyt wrote:

> After a first read, looks OK. You seem to have thought of everything 
> that needs to be described, except maybe extraction of a single element:
> 
> b : tuple of (integer, integer);
> a : integer;
> 
> begin
>   b:=(1,2);
>   a:=b[0]; // a = 1 after this.
> end;
> 
> In this sense, it seems more like an array of const than as a record.
> 
> I would not do the extensions. The tuple is simply a logical, immutable 
> grouping of values.
> I would also not allow operators other than := <> and =, because in 
> expressions,
> when encountering a (, it is not clear what is meant.

But provided that single-element tuples aren't allowed there'll be a 
recognisable comma.

-- 
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