| | |
Summary: 1/20/2011
1
Learning Ruby
Ruby Arrays and Lists
1
Enumerated Type Ruby doesn't have
them
But there are cool workarounds
2
1/20/2011
2
Implementation of Arrays
· Ruby's Arrays are backed by actual C arrays.
Wh fi t d l b i ([]When you first declare a basic array ([] or
Array.new) an instance of the RArray struct is
created, and it points to a C array which is
allocated with a size of 16.
· When we need more space we increase the p
size by half again of the needed size and copy
3
|