introspection (and Perl 6)

Ovid publiustemp-londonpm at
Mon Jan 21 17:43:26 GMT 2008

--- Aaron Trevena <aaron.trevena at> wrote:

> On 21/01/2008, Jeff Anderson <captvanhalen at> wrote:
> > $class.^can('foo')
> >
> > That syntax is nearly as elegant as mud is not. :P
> Yes - what's wrong with just having a can method, it's say not ^say,
> so why the silly hat?
> And yes, I am bitching about perl 6, mostly because I'm starting to
> write code in it and some of the syntax changes like this are just
> WTF.

I think the problem here is that when you universally shove things into
all objects, you force your changes on everyone.


That's actually shorthand for:


You can still do this:


But if another programmer needs to override can() in a subclass, you
can still allow easily reach the original can() method, if needed. 
This method is properly kept in a metaobject (fetched, of course, with
$class.HOW) which is separate from the class itself.  It's a good step
towards metaprogramming, but since 'can' isn't entirely honest, it
seems broken to me.

Since not many people get into metaprogramming, however, it might not
have much effect.


Buy the book  -
Perl and CGI  -
Personal blog -
Tech blog     -

More information about the mailing list