From: Meino Christian Cramer Date: 2003-09-13T02:01:18+09:00 Subject: Mthod redefinition Hi, I just want to know, whether there is a way to accomplish things like "method redefinition" like in C++ (sorry, dont know the exact terminus technicus...) For example in C++ one could write: class Foo { .... int aMethod( void ) { printf( "Who who gives no input will get no output!\n" ); } int aMethod( int i ) { printf( "One gives me: %d\n", i ); } } so I can call "aMthod" either with no parameter at all and will trigger the execution of the first reincarnation of "aMethod()" and if I will spend my time for evaluating some input and offer it to aMethod I will trigger the execution of the second existence of aMethod(). I tried this in a brute force manner with ruiby (just to check, whether a comparable syntax is avallable -- but git a "redefinition of..." warning. So, ruby exactly recognizes, what I want -- a redefinition of aMethod -- but insists on not to enligth me her coherent shine... Is there a way, an adept of the eternal light of The Ruby could learn to serve her majesty in a way, the her majesty will also serve him ? :) Be coherent ! Meino