From: Stu Date: 2011-04-25T05:53:14+09:00 Subject: Re: who can eplain deeply the ruby's methods? glad to help. I wrote that right before I went to sleep last night. If I could edit the post (which I can't) I'd remove my lazy run on sentences. I'd also rewrite the array/hash explanation to say this: Another great example would be Array and Hash. Both data types share Enumerable and I'm sure both override the .each method to deal with the polymorphism of either being an indexed array or an associative array. In the end they are just containers. Container data structures that are purely abstracted and feature endowed linked lists. This paradigm shift blurs the distinction of Array and Hash through a clever abstraction which proves Ruby to be absolutely "principle of least surprise" *.each example with a simple hash and multidimensional array : >> {one: 1, two:2}.each {|x,y| p x; p y} :one 1 :two 2 => {:one=>1, :two=>2} >> [[:one,1],[:two,2]].each{|x,y| p x; p y} :one 1 :two 2 => [[:one, 1], [:two, 2]] A better example would be to put both the array and hash into a variable where one wouldn't even have to know what the variable data type was but knew they could parse it without worry of implementation details or test with a million + one conditionals to figure out how to deal with the data. Yukihiro Matsumoto truly has engineered an elaborate and eloquent language which elucidates the intricate nature of object oriented programming. I can't begin to explain how much respect I have for this man. On Sun, Apr 24, 2011 at 8:18 AM, savin max wrote: > thank you very much. > your answer is good for me. > > -- > Posted via http://www.ruby-forum.com/. > >