1

Tuple doesn't seem to implement Traversable. So, how would one convert a Tuple to a vec in Hack?

Ben H
  • 3,136
  • 3
  • 25
  • 34
  • 1
    Can you not traverse it using a `foreach` loop? It seems to work for me. ` $lst = tuple('a', 'b', 'c'); foreach($lst as $a) { echo($a); } ` So you can reconstruct the tuple to a vec. – MathBunny Aug 15 '20 at 01:58
  • Tuples aren't meant to be traversed, just indexed, so you do need to shuttle the values in manually like `vec[$tup[0], $tup[1], ...]`. Tuples are meant to be small, so this shouldn't be much of a hassle. – concat Aug 15 '20 at 23:42

0 Answers0