Skip Menu |
 

This queue is for tickets about the IO-String CPAN distribution.

Report information
The Basics
Id: 16756
Status: rejected
Priority: 0/
Queue: IO-String

People
Owner: Nobody in particular
Requestors: adamk [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: Normal
Broken in: 1.08
Fixed in: (no value)



Subject: Should IO::String play well with the other IO modules?
Download (untitled) / with headers
text/plain 547b
Even though it would not inherit any methods (right?) from them, should IO::String be a subclass of IO::Handle or (preferably) IO::Seekable so that parameter validation works? Currently I get the following... main::(-e:1): 1 DB<1> use IO::String DB<2> x IO::String->isa('IO::Handle') 0 '' DB<3> x IO::String->isa('IO::Seekable') 0 '' DB<4> Is not an actual subclass, and it would cause problems TO actually be a subclass, would something like adding a custom ->isa to return true for IO::Handle and/or IO::Seekable be good enough?
Date: Thu, 29 Dec 2005 16:19:42 +1100
From: Adam Kennedy <adam [...] phase-n.com>
To: bug-IO-String [...] rt.cpan.org
Subject: Re: [cpan #16756] AutoReply: Should IO::String play well with the other IO modules?
RT-Send-Cc:
Download (untitled) / with headers
text/plain 1.5k
That would be just fine. Apart from people doing UNIVERSAL::isa(...) checks, which they shouldn't be doing anyway, adding a custom isa would make things work properly. WRT subclassing, I wasn't sure if you had a replacement for every single method, and thus it might not cause a problem in that case. But if it would, then sub isa { ... } is ok. Adam K IO-String wrote: Show quoted text
> Greetings, > This message has been automatically generated in response to your bug report about IO-String, a summary of which appears below. > > There is no need to reply to this message right now. Your bug in IO-String has been assigned an ID of [cpan #16756]. Please include the string: > > [cpan #16756] > > in the subject line of all future correspondence about this issue. To do so, > you may reply to this message. > > Thank you, > bug-IO-String@rt.cpan.org > > ------------------------------------------------------------------------- > Even though it would not inherit any methods (right?) from them, should IO::String be a subclass of IO::Handle or (preferably) IO::Seekable so that parameter validation works? > > Currently I get the following... > > main::(-e:1): 1 > DB<1> use IO::String > > DB<2> x IO::String->isa('IO::Handle') > 0 '' > DB<3> x IO::String->isa('IO::Seekable') > 0 '' > DB<4> > > Is not an actual subclass, and it would cause problems TO actually be a subclass, would something like adding a custom ->isa to return true for IO::Handle and/or IO::Seekable be good enough?
Download (untitled) / with headers
text/plain 493b
Show quoted text
> Even though it would not inherit any methods (right?) from them, > should IO::String be a subclass of IO::Handle or (preferably) > IO::Seekable so that parameter validation works?
It should IMO. I'm trying to use IO::String objects as arguments to multimethods (as per Class::Multimethods) and I have to hack @IO::String::ISA to make my code work. It doesn't matter that IO::String inherits no code from IO::Handle - it's a subtype of it and it should be reflected in the type system.


This service is sponsored and maintained by Best Practical Solutions and runs on Perl.org infrastructure.

Please report any issues with rt.cpan.org to rt-cpan-admin@bestpractical.com.