On 26.01.2013 20:36, Sven Barth 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.


And I just got the following idea:

=== example begin ===

var
  t1: tuple of (Integer, Integer, Integer, Integer);
  t2: tuple of (Integer, Integer);
begin
  t1 := (4, 3, 2, 1);
  t2 := tl[2..3]; // with 1 based access t2 will be (3, 2);
  t1[3..4] := (5, 6); // t1 will now be (4, 3, 5, 6)
end;

=== example end ===

Regards,
Sven
_______________________________________________
fpc-devel maillist  -  [email protected]
http://lists.freepascal.org/mailman/listinfo/fpc-devel

Reply via email to