[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

Doubts about an example in Poignant Guide

Damaris Fuentes

7/21/2006 4:36:00 PM

Hi,
I'm reading "Why's guide to ruby" and I have two doubts about the
example of Endertromb, mindreaders, etc.

Firstly, He creates the class "MindReader" where he uses
"EnderTromb::scan_for_sentence". However, there is no EnderTromb class
in the manual.

Even though I can skip that part and initialize the sentence "manually",
I've found that he uses a mind.read method. That is, a "read" method on
a string. And it gives me back an error.

Has anybody come across these errors? If so, I will be pleased to know
how can I solve them :)

Thanks
PT: And thanks for being a vivid forum! You're really really useful for
people starting like me!

--
Posted via http://www.ruby-....

2 Answers

Mat Schaffer

7/22/2006 3:50:00 AM

0


On Jul 21, 2006, at 12:35 PM, Damaris Fuentes wrote:

> Hi,
> I'm reading "Why's guide to ruby" and I have two doubts about the
> example of Endertromb, mindreaders, etc.
>
> Firstly, He creates the class "MindReader" where he uses
> "EnderTromb::scan_for_sentence". However, there is no EnderTromb class
> in the manual.
>
> Even though I can skip that part and initialize the sentence
> "manually",
> I've found that he uses a mind.read method. That is, a "read"
> method on
> a string. And it gives me back an error.
>
> Has anybody come across these errors? If so, I will be pleased to know
> how can I solve them :)
>
> Thanks
> PT: And thanks for being a vivid forum! You're really really useful
> for
> people starting like me!

_why may have something to say here, but I'm not sure why you're
saying mind is a string. I don't see the actual type of mind defined
anywhere. As for EnderTromb, it's included from endertromb.rb, it
says. So it's defined there.

I think part of it is that you have to relax a little and give into
the programming-as-language idea. You can dig down if you have too,
but for an example like this, you don't have to. You know what
mind.read does just by looking at it. It reads minds of course!
How? Leave that up to the author :)
-Mat

Damaris Fuentes

7/25/2006 9:52:00 PM

0

Yes, I guess you are completely right :) I was trying to give life to
EnderTromb planet myself and I was getting crazy :)


--
Posted via http://www.ruby-....