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" <lists@ruby-forum.com> 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
#<Fixnum:0x00000b>
#=> nil
What I know that block returns automatically its last expression. Why
does `10` not the returned
here, rather `#<Fixnum:0x00000b>`?
But with the `return a.other_s` `10` printed - what is the concpetual
difference between CODE-I and CODE - II?
I seriously believe now that you are trolling this list. I, for one, am
done. You have been pointed over and over to documentation, to tutorials,
to online FREE courses to teach you Ruby, both basic and intermediate
levels. You take NO advantage of them.
I will block all email from you, from the mailing list that contains your
email address and username.
I'd rather spend my time helping someone who really wants to learn, not
half ass their learning. I hope one day you actually learn Ruby. Right
now, you're not even close.
···
On 2/27/13 10:12 AM, "Love U Ruby" <lists@ruby-forum.com> wrote:
But why mean to say when the below code works:
class Simple
def foo
2 + 2
end
end
#=> nil
simple = Simple.new
#=> #<Simple:0x11eb390>
simple.foo
#=> 4
Why not the below:
class Fixnum
def to_s
self + 5
end
end
#=> nil
puts 10
#<Fixnum:0x000015>
#=> nil
Yes, perfectly. It was clear all the way. But you refuse to ignore
the hints you are given. By offloading thinking to other people you
will never _learn_ something let alone become a programmer or software
engineer.
Good luck!
robert
···
On Wed, Feb 27, 2013 at 4:12 PM, Love U Ruby <lists@ruby-forum.com> wrote:
I seriously believe now that you are trolling this list. I, for one, am
done. You have been pointed over and over to documentation, to
tutorials,
to online FREE courses to teach you Ruby, both basic and intermediate
levels. You take NO advantage of them.
Sorry! my last post was actually thrown before your one. But don't know
how it appeared last. And I have seen your excellent suggestion
late,when my one actually sent.
Yes,I will do now, what you suggested. Thanks for the suggestions. But
doing some try to understand how that url works, how to start.
On Wed, Feb 27, 2013 at 4:12 PM, Love U Ruby <lists@ruby-forum.com> > wrote:
But why mean to say when the below code works:
Hope my confusion is clear.
Yes, perfectly. It was clear all the way. But you refuse to ignore
the hints you are given. By offloading thinking to other people you
will never _learn_ something let alone become a programmer or software
engineer.
Then take feedback serious and behave according to your stated
intentions. If you don't the way you are viewed in the community
won't change because people tend to judge other people by their
behavior and not only by their stated intentions.
robert
···
On Wed, Feb 27, 2013 at 5:56 PM, Love U Ruby <lists@ruby-forum.com> wrote: