I just started learning Ruby. I am already well-versed in C programming,
doing it from 5 years. I started learning from Ruby-Koans
(http://rubykoans.com/) and ran the test "about_nil.rb" but can not seem
to understand to change on that particular line in question:
assert_equal __, nil.is_a?(Object), "Unlike NULL in other languages"
[arnuld@arch64 koans $] ruby about_nil.rb
AboutNil#test_nil_is_an_object has damaged your karma.
The Master says:
You have not yet reached enlightenment.
I sense frustration. Do not be afraid to ask for help.
The answers you seek...
Unlike NULL in other languages
Please meditate on the following code:
about_nil.rb:5:in `test_nil_is_an_object'
mountains are merely mountains
your path thus far [X_________________________________________________]
0/3
[arnuld@arch64 koans $] ruby -v
ruby 2.2.0p0 (2014-12-25 revision 49005) [x86_64-linux]
Notice the test name: test_nil_is_an_object
and then the assert is asking: nil.is_a?(Object)
the answer is: true
nil is an Object
···
"ruby-talk" <ruby-talk-bounces@ruby-lang.org> wrote on 01/23/2015 08:13:40 AM:
From: arnuld uttre <arnuld.mizong@gmail.com>
To: ruby-talk@ruby-lang.org
Date: 01/23/2015 08:14 AM
Subject: Ruby Koans -- about_nil
Sent by: "ruby-talk" <ruby-talk-bounces@ruby-lang.org>
I just started learning Ruby. I am already well-versed in C programming,
doing it from 5 years. I started learning from Ruby-Koans
(http://rubykoans.com/\) and ran the test "about_nil.rb" but can not seem
to understand to change on that particular line in question:
assert_equal __, nil.is_a?(Object), "Unlike NULL in other languages"
[arnuld@arch64 koans $] ruby about_nil.rb
AboutNil#test_nil_is_an_object has damaged your karma.
The Master says:
You have not yet reached enlightenment.
I sense frustration. Do not be afraid to ask for help.
The answers you seek...
Unlike NULL in other languages
Please meditate on the following code:
about_nil.rb:5:in `test_nil_is_an_object'
mountains are merely mountains
your path thus far [X_________________________________________________]
0/3
[arnuld@arch64 koans $] ruby -v
ruby 2.2.0p0 (2014-12-25 revision 49005) [x86_64-linux]
Ok, I understood. But how to tell this to the program ? What does this
koan want me to add/remove from that line of code ?
I checked the official docementation at:
and does not explain "assert_equal__", it only explans "assert_equal"
(without the 2 underscores) and even that "assert_equal" is explained
without telling the definition of "objects are equal" , deos iequal
mean same object in memory or just the valuos of those
···
On 1/23/15, HANSEM1@nationwide.com > <HANSEM1@nationwide.com> wrote:
"ruby-talk" <ruby-talk-bounces@ruby-lang.org>
wrote on 01/23/2015 08:13:40 > AM:
Notice the test name: test_nil_is_an_object
and then the assert is asking: nil.is_a?(Object)
From: arnuld uttre <arnuld.mizong@gmail.com>
To: Ruby users <ruby-talk@ruby-lang.org>
Date: 01/23/2015 08:59 AM
Subject: Re: Ruby Koans -- about_nil
Sent by: "ruby-talk" <ruby-talk-bounces@ruby-lang.org>
> "ruby-talk" <ruby-talk-bounces@ruby-lang.org>
> Notice the test name: test_nil_is_an_object
> and then the assert is asking: nil.is_a?(Object)
>
> the answer is: true
> nil is an Object
Ok, I understood. But how to tell this to the program ? What does this
koan want me to add/remove from that line of code ?
I checked the official docementation at:
and does not explain "assert_equal__", it only explans "assert_equal"
(without the 2 underscores) and even that "assert_equal" is explained
without telling the definition of "objects are equal" , deos iequal
mean same object in memory or just the valuos of those
Ok, I think I more fully understand your question/issue.
assert_equal __, nil.is_a?(Object), "Unlike NULL in other languages"
the __ is a variable that has been defined in the project, and it's not
the expected answer
the reason you don't see what you might consider a more helpful error is
that this assert was given a message to display "Unlike ... "
if you remove the last comma and the message and re-run the code you will
see a message like:
expected: true, got: ???
where the ??? is whatever __ was defined as
the test is expecting you to replace the __ with true
···
"ruby-talk" <ruby-talk-bounces@ruby-lang.org> wrote on 01/23/2015 08:57:48 AM:
> On 1/23/15, HANSEM1@nationwide.com > > <HANSEM1@nationwide.com> wrote:
> wrote on 01/23/2015 08:13:40 > > AM:
and does not explain "assert_equal__", it only explans "assert_equal"
(without the 2 underscores) and even that "assert_equal" is explained
without telling the definition of "objects are equal" , deos iequal
mean same object in memory or just the valuos of those
One single space caused so much of mess in the mind. I did solve it
before I checked your and madman's replies by banging my head for an
hour, only to find that all of my understanding was "blocked" by not
looking at one single space.
Thanks for the help though. I think this koans-method of learning is
good for newbies to programming. I will check other documentation, I
like reading reference manuals more, textbooks bore me.
···
On 1/23/15, HANSEM1@nationwide.com > <HANSEM1@nationwide.com> wrote:
"ruby-talk" <ruby-talk-bounces@ruby-lang.org>
wrote on 01/23/2015 08:57:48 AM:
Ok, I think I more fully understand your question/issue.
assert_equal __, nil.is_a?(Object), "Unlike NULL in other languages"
the __ is a variable that has been defined in the project, and it's not
the expected answer
.. SNIP...
I actually hate that we still lovingly call "Programming Ruby 1.9 & 2.0 (4th edition): The Pragmatic Programmers' Guide" the pickaxe book... I hate it because if you don't know the real title, it can make it hard to locate.
Yup I had no idea what the pickaxe book was. Thanks for clarifying Wayne.
Jonathan
···
On Sat, Jan 24, 2015 at 2:00 AM, Wayne Brisette <wbrisett@att.net> wrote:
I actually hate that we still lovingly call "Programming Ruby 1.9 & 2.0
(4th edition): The Pragmatic Programmers' Guide" the pickaxe book... I hate
it because if you don't know the real title, it can make it hard to locate.
Really doesn't seem unclear. Maybe you should hate less, or at least hate more important things.
···
On Jan 23, 2015, at 07:00, Wayne Brisette <wbrisett@att.net> wrote:
I actually hate that we still lovingly call "Programming Ruby 1.9 & 2.0 (4th edition): The Pragmatic Programmers' Guide" the pickaxe book... I hate it because if you don't know the real title, it can make it hard to locate.