I’m not addressing Nobu’s point, but there is an argument to say that
there is no meaningful inheritance at all if you change Errno: that
is, if you subclass an Errno::Xxx, the Errno constant in the subclass
must be identical to that in the parent (otherwise it isn’t a true
subclass). After all, these classes are essentially wrappers for the
Errno value, and so for a subclass to maintain the “isa” relationship
it must wrap the same value too.
Cheers
Dave
···
On Dec 8, 2003, at 2:47, Yukihiro Matsumoto wrote:
I’m not sure what you mean. Do you mean when MissingFileError
inherits from Errno::ENOENT, it should inherit Errno constat from
Errno::ENOENT as well?
I’m not sure what you mean. Do you mean when MissingFileError
inherits from Errno::ENOENT, it should inherit Errno constat from
Errno::ENOENT as well?
I’m not addressing Nobu’s point, but there is an argument to say that
there is no meaningful inheritance at all if you change Errno: that
is, if you subclass an Errno::Xxx, the Errno constant in the subclass
must be identical to that in the parent (otherwise it isn’t a true
subclass). After all, these classes are essentially wrappers for the
Errno value, and so for a subclass to maintain the “isa” relationship it
must wrap the same value too.
If that’s the case, maybe it should be a reader class method wrapping
an anonymous constant?
Hal
···
On Dec 8, 2003, at 2:47, Yukihiro Matsumoto wrote: