From: "Mauricio Fernández" Date: 2003-05-20T16:00:31+09:00 Subject: Re: Ruby reference recommendations On Tue, May 20, 2003 at 03:10:35PM +0900, Dave wrote: > Hi, I'm new to Ruby, on my second day now, and I love the language so > far, but there's one problem. The documentation I've found so far is > pretty incomplete or at least hard to find info in. Is there a real Ruby > reference out there on the web? I've got the Ruby manual, and I've > checked out the "book" at rubycentral.com, but it's all incomplete. The pickaxe book is widely considered to be the best introductory and reference material available in English... > For instance, what errors will File.new throw? When exactly does Ruby > pass by reference and when does it copy the object? All objects but Fixnum (and you don't see the difference because there's no "mutator" methods defined in that class and you cannot define singleton methods for it) and Float (not sure about the latter). Maybe I forget something, but anyway, in practice, all objects. > If you return an > object from a function, does it copy that object, or does it return a > reference? a reference >If it returns a reference like I think it does, does that > provide the calling function with access to write to the returned object? You can use methods that modify the internal state of the object. class Foo def initialize @foo = "a" end def foo return @foo end end a = Foo.new puts a.foo # a b = a.foo b << "b" puts a.foo # ab > If there's a book out there I should buy, please let me know. > rubycentral.com looks like a decent introduction to the language, but I > need something a little more solid. Thanks in advance for your > recommendations :) If you don't like it, you're different from most of us :-P -- _ _ | |__ __ _| |_ ___ _ __ ___ __ _ _ __ | '_ \ / _` | __/ __| '_ ` _ \ / _` | '_ \ | |_) | (_| | |_\__ \ | | | | | (_| | | | | |_.__/ \__,_|\__|___/_| |_| |_|\__,_|_| |_| Running Debian GNU/Linux Sid (unstable) batsman dot geo at yahoo dot com ...[Linux's] capacity to talk via any medium except smoke signals. -- Dr. Greg Wettstein, Roger Maris Cancer Center