Matt Williams
Posts: 466
Nickname: aetherical
Registered: Feb, 2008
|
Matt Williams is a jack-of-all trades living in Columbus, OH.
|
|
|
|
Overriding operators: two dimensional arrays
|
Posted: Feb 23, 2009 2:54 PM
|
|
|
This post originated from an RSS feed registered with Ruby Buzz
by Matt Williams.
|
Original Post: Overriding operators: two dimensional arrays
Feed Title: Ruby Blender
Feed URL: http://feeds2.feedburner.com/RubyBlender
Feed Description: This blog contains short-ish ruby tips, hints, and techniques.
|
Latest Ruby Buzz Posts
Latest Ruby Buzz Posts by Matt Williams
Latest Posts From Ruby Blender
|
|
Image via Wikipedia
One of the neat things about ruby is that, in general, operators are methods, so they can be overridden. When working with multidimensional arrays, some languages allow you to do the following: Text | copy code |?1a[0,0] whereas ruby uses: Ruby | copy code |?1a[0][0] Which makes sense, since Ruby implements it as an array of arrays and you’re chaining methods to [...]
Read: Overriding operators: two dimensional arrays
|
|