Re: MooseX::Declare without MooseX::Method::Signatures

[email protected] (Piers Cawley)
Newsgroups perl.moose
Message-ID <[email protected]>
Buddy Burden <barefootcoder@...> writes:

> 
> Guys,
> 
> I'm trying to figure out if I can turn off just the MXMS part of MXD
> (i.e. lose the "method" keyword) ... what I'm trying to do is to use
> Method::Signatures instead, possibly augmenting/extending it to use
> MooseX::Params::Validate for the type checking.  (If anyone really
> wants to know why, I can get into the details, but I figured I
> wouldn't clutter up the initial post. :) )  Is this possible?  I've
> been staring at the code for MXD, MXPV, PV, and MS for a couple of
> days now, but I can't see how to do it.
> 
> In reviewing the mailing list archives to see if my question had
> already been answered somewhere, I discovered a post(*) from Stevan
> (to me, even!) which mentioned a talk Piers Cawley had given, possibly
> on this very topic; does anyone know if that's online somewhere?  I
> searched for it, but couldn't find it.  It might be exactly what I'm
> looking for.  (Can't believe I didn't remember that post in the first
> place ...)
> 
> Thanx all.
> 
>             -- Buddy
> 
> (*) http://article.gmane.org/gmane.comp.lang.perl.moose/1958
> 


I used:

    use MooseX::Declare;
    class Foo {
        use Method::Signatures::Simple name => 'simple_method'
    }

Which buys me the full fat MXD 'method' implementation for where I need 
fancy stuff, and a 'simple_method' keyword for the rest of the time. I'm not 
au fait enough with the innards of MXD to know how to alter what it injects 
with the 'class' keyword. Method::Signatures doesn't seem to offer a 
way to override the keyword name, but it should be easy enough to lift the way 
Method::Signatures::Simple does it.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.