introspection (and Perl 6)
aaron.trevena at gmail.com
Mon Jan 21 21:04:45 GMT 2008
On 21/01/2008, Ovid <publiustemp-londonpm at yahoo.com> wrote:
> --- Aaron Trevena <aaron.trevena at gmail.com> wrote:
> > On 21/01/2008, Jeff Anderson <captvanhalen at gmail.com> 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?
> 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:
Kinda neat. :)
I don't mind the hat as long as it's shorthand for golfers that I'll
never need to use or read in production code.
> 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.
It's an improvement on what we have currently and well beyond the 80/20 :)
> Since not many people get into metaprogramming, however, it might not
> have much effect.
True. Especially considering how the after-market mod's from CPAN you
can apply to Perl 5 now - you should be able to do even more with perl
I still think there are a bunch of WTF syntax changes in Perl 6, but
I'll reserve judgement until I've ported my code.
LAMP System Integration, Development and Hosting
More information about the london.pm