From: Pascal GUICHARD Date: 2005-10-03T03:00:03+09:00 Subject: Re: C++ equivs in Ruby ------=_Part_8149_24706194.1128276000550 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Content-Disposition: inline my point is : - on pymorphism, i have seen ruby code that is testing what is the type (class, name) that is calling this pice of code, and that sounds very strange to me, - on pointers, i try to understand (howto implement) datastructures in whic= h you need to mix values and references/poiters Pascal On 10/2/05, Devin Mullins wrote: > > Pascal GUICHARD wrote: > > > Could you give me an enlightment about : > > - polymorphism (method overloading, virtual methods) > > > > > class A > def fun(arg); puts "Hello, #{arg}!" end > end > class B > def fun(baz); puts "Hiya, #{baz}!" end > end > def greet(obj) > obj.fun > end > greet A.new > greet B.new > > Unlike statically typed languages, there is no need for inheritance to > achieve polymorphism. > > >- pointers (i know these can be described as having some problems with > them, > >how to implement (for example, linked lists, binary trees, and so on) > > > > > What Martin said. All variables are pointers. (Contrast 'variable' with > 'return value', for instance. You can't [easily] return a pointer to an > object. However, there are plenty of subsitutes, usually better.) > > Devin > > > ------=_Part_8149_24706194.1128276000550--