From: Markus Date: 2004-10-15T03:22:16+09:00 Subject: Re: Need Help on Ruby Details > I am shooting in the dark here. I have few very significant questions > regarding Ruby. It is new to me, and I cannot find sufficient help at > Barnes & Nobles. In other words HELP HELP HELP. I am in part guessing what you want to know. You may want to look at http://www.rubycentral.com/book/ for more information. If you want a paper copy, the new edition of this book should be in the stores in a few weeks. > > Here are my questions. Also I am in need of a pretty technical > details, etc. > > 1) How does ruby handle choice and repetition? I need to know the guts > of the choice and repetition. Choice provides lots of choice: case s when 'bob' then puts 'Hi bob!' when /q[^u]/i puts 'Q must always be followed by U' else puts "Fried cheese!" end or if cond then print "true" else print "false" end or if i < 0 print "negative" elsif i > 0 print "positive" else print "zero" end or (i < 0) ? 0 : i and so forth. Likewise, there are things like 5.times do ... end (i..2*i).each { |x| ...} loop {... break...next...} ['tree','frog','elf','taxes',3.14159].each { |item| ...} and for loops, and... > 2) How does ruby support branches, loops, and recursion? I am not > looking for the syntax on language. I am looking for the real detail > on how it is done behind the scenes. For the real details behind the scenes, read the source. For the syntax, see the link mentioned above or look at any of the sample code that comes with ruby. Or, if you really must know the absolute details of the syntax (not recommended) you can look at the grammar in parse.y > 3) I need to know the local flow of control and the global flow of > control. I.E. Global provisions for transfer of the control; I know > that functions do not exist in Ruby, rather a global object member is > created. I cannot find this in Intro books that I have access to. ANy > help is welcome. I do not understand this question. The answer may be "continuations", "read the source", "no", "threads", "yes", "method/closure", or "flying monkeys." That is how unsure I am of what you are asking. > 4) Does ruby have a go to statement embedded in the language? No. > Again thank you for looking and may be even helping me out. I have > read bunch of guides and learning materials for the ruby, however, I > need some real info that is hard to find.