On Thursday, August 22, 2002, at 10:32 AM, Randall Meadows wrote:
On 8/22/02 at 7:16 AM -0700, Will Leshner wrote:
You probably should make a super class that returns NIL for NewObject.
That way if somebody forgets to override they will find out pretty
quickly.
<RB-newbie/OO-novice>
Would it not be better form to throw and exception in this case,
instead of returning nil? In my mind, there is a subtly different, but
important, distinction between the two.
</>
Or, perhaps better yet, is there an RB equivalent of "pure virtual"?
You can fake it by defining the "virtual" method in the abstract class
to raise an exception.
Charles Yeomans
|