Sex, 2008-05-02 às 14:38 +0200, TSa escreveu:
> Ovid wrote:
> > However, the CGI/CGI::Simple example I posted earlier doesn't fulfill
> > this.  CGI::Simple offers a subset of CGI.pm's functionality and it's
> > guaranteed to be identical
> Then, since classes are open, the programmer can easily say
>    CGI does CGI::Simple;
> and let go CGI instances wherever a CGI::Simple is expected.
> As added value you can get a compiler check with

Not really... 'does' will try to compose the CGI::Simple methods to the
CGI class (although I think your example was supposed to be CGI::Simple
does CGI, but anyway). You don't want to change the class
implementation, you just want to annotate an additional 'interface' on
the given implementation.

I'm actually not sure that you can have 'CGI does CGI::Simple', since
CGI::Simple is not a role...

daniel

Reply via email to