From: Dave Date: 2002-01-24T06:34:59+09:00 Subject: Re: Newbie: simple data-type problem On Wed, 23 Jan 2002 15:26:51 GMT, Mathieu Bouchard wrote: > >On Wed, 23 Jan 2002, Dave Carmean wrote: >> What I though I'd try is to create a class which inherits from >> Fixnum, and do range checking in the initializer. Doesn't work. >> Can't figure out how to initialize it, because Fixnum doesn't have >> a new() method. > >Classes are there to add functionality, not remove it. [snip] >Do you want to manipulate integer values, or integer variables ? >What does this class do apart from being a Fixnum or a holder thereof? Actually, I'm not really sure whether or not it should be mutable. All I need to do is perform the range check when I initialize it, and after that just get it's value. The time-related subclass will just allow initialization and querying in terms of integer seconds, or weeks, days, hours, minutes, and seconds. They're going to be part of a DNS tool; I'm thinking now that they're good candidates for the Singleton pattern.