From: Massimiliano Mirra Date: 2001-11-17T09:03:40+09:00 Subject: [ruby-talk:25688] Re: Something strange with Ruby's inheritance mechanism On Sat, Nov 17, 2001 at 01:20:26AM +0900, Eric Jacoboni wrote: > In fact, "my head" has some problem to justify that there is two > objects of different classes that can be assigned to each other (i'm > rather experienced with strong typing languages). There are no two objects being assigned to each other in your example, there is just one variable to which you first assign a reference to an object, then to another one. anEmployee = Employee.new # the anEmployee variable now contains a reference to an object of # class Employee aString = String.new # the aString variable now contains a reference to an object of class # String anEmployee = aString # now the anEmployee contains the same reference contained in the # class aString Variables are just names. Maybe it will be clearer to you if you choose more "neutral" names, such as x, y... that do not make you think that a variable must be bound to the first thing it is assigned. BTW I come from an Object Pascal background so I fully sympathize. :-) And you don't need strong typing at all to teach OOP concepts. Massimiliano