Home > Articles > Programming > Ruby

  • Print
  • + Share This
This chapter is from the book

This chapter is from the book

Back to Business

Now we can get back to talking about object containers. We've already been using some containers without bringing attention to the fact. Strings, by holding characters, qualify as one kind of container. Lists, such as those produced by methods that have to return more than one value, are another kind of container; these are normally called arrays. The other types we'll discuss today, hashes and ranges, we have not yet seen.

NOTE

If you already know what a range is and have just had your hackles raised by seeing it called a container, I concede the point; it's not a true container. But it acts like a container in the ways that are important to programmers, so it should be introduced with the others. By way of precedent, consider that some languages with "lazy" evaluation (like Haskell) often don't draw a meaningful distinction between them.

  • + Share This
  • 🔖 Save To Your Account