3 ms·
> For the record, most languages don't have indexable tuples as far as I'm aware Most languages with tuples have indexable tuples either via language syntax or
by pcwalton 11y ago
> For the record, most languages don't have indexable tuples as far as I'm aware
Most languages with tuples have indexable tuples either via language syntax or library functions. (For example, OCaml practically does, with fst and snd.)
> It doesn't have "true tuples" but you can do multiple returns in a tuple-like way and there is syntax for unpacking it.
There's a large difference between having multiple return values and having first-class tuple values.
- nv-vn 11y agoHaskell/OCaml style "fst" and "snd" functions can't index arbitrary tuples (they only work on 2-tuples/pairs): http://i.imgur.com/PbhNxmu.png http://i.imgur.com/PbhNxmu.png.