From: Chris Carter Date: 2007-07-02T00:40:27+09:00 Subject: Re: Newbie Question. eval.rb variable scope issue On 7/1/07, Rishel,Wes wrote: > Thanks, Bill. It sounds like irb will fill my needs. > > I have to say that featuring eval in the tutorials when it doesn't work > for a simple set of interactions like setting a variable and then > printing it seems very newbie unfriendly. > > Some languages have a culture that excludes all but the smartest and > those who are willing to devote all their time to memorizing the > nuances. I would put Perl in that category. The initial "affect" of the > Ruby language and community is else-wise, but a couple of things make me > wonder. This includes tutorials that don't work in every case and the > fact that there is no free version of documentation for the current > version, which was released > 3 months ago. > > If it weren't for people like you willing to respond it could be very > off-putting indeed. > I would like to know which tutorial out there you were following that teaches use of eval(). The Ruby Way generally does not recommend the use of eval with a string unless you are doing some very advanced work, and even then it is very risky business. Ruby does have it's nuances, but this community, as you can see, is quite willing to help you out when you have found one, and help you figure out what it is and why it is. I don't know which tutorial you are referring to, because none of the "official" tutorials on the ruby-lang.org website mention eval. If you want a good place to start learning ruby, I suggest you check out _why's poignant guide to ruby (http://poignantguide.net/ruby/), it is a little wacky, but it teaches the language and the concepts of the ruby way very well. As to no free documentation for the most recent version of ruby, one ships with your ruby install (the ri tool and the rdocs) and there is ruby-doc.org. Welcome to Ruby, if you hit any other major problems feel free to ask. We also have a lively IRC channel #ruby-lang on freenode. Hope you like the language. And be aware, the philosophy guiding Ruby is not the same as that of python's. -- Chris Carter concentrationstudios.com brynmawrcs.com