Oxygene: 2D Arrays

would your var x not be an arrary so that x[0] = 1 & x[1]=2?
In which case your an : array[0…1] of (integer, integer) could be used as:
an[0, 0] = 1st integer in first tuple &
an[0, 1] = 2nd integer in 1st tuple?

OR would a Oxygene “tuple” be equivalent to Delphi TPoint, addressed with “X” & “Y” 's?

I’ve never used such vars other than TPoint in Delphi for which TPoint.X = 1st, & TPoint.& the 2nd of a tuple.

While conceptually similar (especially when talking literals), arrays and tuples ar every different, would not have the necessarily have the same in-memory structure, and not be assignment compatible.

See https://docs.elementscompiler.com/Oxygene/Types/Tuples/ for more min tuples.

Sure, either an array or a tuple x could be accessed the same way, with x[0] and x[1] in this case, but the similarities end there.

Thanks, Marc. Tuples look useful to me & I would not have thought about 'em as Delphi did not have them that I know of.

For what it’s worth; the () syntax is ONLY valid inside const/var declaration.

1 Like

3 posts were split to a new topic: Fun with Tuples