Open rebcabin opened 1 year ago
I assume
List
is homogeneous andTuple
is heterogeneous, as suggested (if not implied ?!?) by the arguments. Otherwise, they're both ordered collections, start-index 0, with duplicate entries allowed?
Yes. Tuple has compile time length and (possibly different) types for each element. List has a compile time type, the same for each element, and the length is runtime (you can append and remove from it).
The documentation for all ASR nodes is here: https://github.com/lfortran/lfortran/tree/c648a8d824242b676512a038bf2257f3b28dad3b/doc/src/asr/asr_nodes and please do not close this issue until I document this there.
roger. Pinned the link, btw. ty :)
I assume
List
is homogeneous andTuple
is heterogeneous, as suggested (if not implied ?!?) by the arguments. Otherwise, they're both ordered collections, start-index 0, with duplicate entries allowed?Proposition:
If
ttype* types
inTuple
denotes a sequence of types for a heterogeneous tuple, thenttypes*
must denote a sequence (the ASDL is ambiguous), and the length of any tuple that conforms to the spec must be equal to the length of thettypes*
.Remark:
The length of conforming tuples is implied by the length of the
ttypes*
. I consider this spec to be implied and explicit, rather than implicit, with implicit meaning "not evident from the manifest text." This spec forTuple
, oncettypes*
is clarified as a sequence, is therefore acceptable under the tenet that all MASR specs must be explicit.