From: "Booker C.Bense" Date: 2007-04-05T06:35:06+09:00 Subject: Re: Everything is a object? In article <5e85406fd17fc7cc59e2cbb2e1503c00@ruby-forum.com>, Jamal Soueidan wrote: > >Ruby understand that everything start with @ is a object, either >reference or a type. > >like in other language > >@var = &reference >@var = object > >when I type it > >if var.nil? > >var is unknown? > >it's not variable, neither object? what is it? nobody knows, throw >exception to the bad coder :P > Ruby variables aren't quite what you expect. They are merely labels that point to existing objects, they have no inhernet existance in and of themselves. Ruby will "autocreate" objects along the way, but IMHO it requires thinking about variables in a much different way that most other languages use the term variables. Personally, I think this is a least an interesting if not good thing. It requires that you think in different ways about how variable work. The problems you are having is that you are making method calls on non-existant objects. It's like handing a NULL pointer in C to a function that expects a pointer. _ Booker C. Bense