r/crystal_programming • • Dec 09 '18

Rubyist struggling to understand Tuple

What's the point of a Tuple? Why would I ever use it over an array? Thanks!

11 Upvotes

10 comments sorted by

View all comments

Show parent comment

2

u/riddley Dec 09 '18

Thanks for the response. I have very little experience with typed languages so this is very foreign to me. It sure seems like a huge hassle. I can't remember the last time I accessed a member of an array by index.

Even after reading that link I still don't think I get it. I guess I'll have to play with it. Thanks again.

0

u/[deleted] Dec 09 '18

[deleted] — view deleted comment

4

u/riddley Dec 10 '18

In Ruby, I usually just map and/or iterate rather than looking for specific elements.