From: James Edward Gray II Date: 2006-12-13T05:30:16+09:00 Subject: Re: Comments on ObjectiveView issue 9 (no, I'm not a spambot) On Dec 12, 2006, at 8:50 AM, Mark Collins-Cope wrote: > As for the Ruby side of things, note that the article by Amy Hoy > contains on or two deprecated uses within Ruby that ought not to have > been allowed to propagate through. (c.f. ''foo.type'' should be > ''foo.class''). Was she writing that article based on Ruby 1.6.X? > Still, that aside, it ought to give your readership a little bit of an > idea about Ruby. > [*** If you'd like to send me full details (to markcollinscope AT > gmail.com) I will update issue 9 with corrections. It's still getting > about 2k downloads a month. ***] 1. On page five 5.times{ puts "Mice!\n" } is not very Rubyish. The \n should go. 2. On page six it says, "This converts a Range object of (1..10) to an Array using the method to_a, which is inherited from the Object class." Range#to_a comes from the mixin Enumerable, actually. 3. On page six RegEx is listed as a basic Ruby type. The class name is actually Regexp. 4. On page six mysterytype.type and (1..2).type should be mysterytype.class and (1..2).class. Object#type is deprecated. 5. On page seven, one sentence says "It [Enumerable] provides fun functions like each (for looping)..." Another says, "Enumerable relies on the implementing class (Array, Hash) to provide its own each function to make everything work." Those are opposites. The second one is correct. 6. On page seven the example ['monkey','cheese','pants'].each { | thing| print "I put #{thing} on my head!\n" } would be better as ['monkey','cheese','pants'].each { |thing| puts "I put #{thing} on my head!" }. 7. Similarly, on page seven, using_yield { |word,num| puts "#{word} -- {num} times!" } should be using_yield { |word,num| puts "#{word} -- #{num} times!" }. Note that I made three changes that time, not two. I corrected a typo. 8. On page nine, the One Last Trick section claims you won't get a redefinition warning, but you will if you put the earlier code and this code in a text file and run them with Ruby's warnings enabled. Hope that helps. James Edward Gray II