From: "D. Deryl Downey" Date: 2013-02-27T23:04:16+09:00 Subject: Re: Why `10` not returned without the `return` from the block ? Again, as you have been asked previously, WHY are you screwing around attempting to rewrite core classes of Ruby when you DO NOT understand how to use them properly in the first place? Drop your Eloquent Ruby book, and WORK THROUGH codecademy.com/tracks/ruby COMPLETELY! THEN post to the list if you still have problems. You have VERY sketchy Ruby knowledge which that URL will flesh out so that you understand at least the basics. DO NOT post to the list every little question you have while working through that set of tracks. Post AFTER you have COMPLETED the ENTIRE Ruby track there! I can almost guarantee you that 99.999% if your current questions will be answered once you COMPLETE the ENTIRE Ruby track there. On 2/27/13 8:36 AM, "Love U Ruby" wrote: >CODE - I > >class Fixnum >alias other_s to_s >def to_s >a = self + 5 >return a.other_s >end >end >#=> nil >puts 5 >10 >#=> nil > >CODE - II > >class Fixnum >alias other_s to_s >def to_s >self + 5 >#return a.other_s >end >end > >puts 5 ># >#=> nil > >What I know that block returns automatically its last expression. Why >does `10` not the returned >here, rather `#`? > >But with the `return a.other_s` `10` printed - what is the concpetual >difference between CODE-I and CODE - II? > >Please help me to understand. > >Thanks > >-- >Posted via http://www.ruby-forum.com/. >