Beefy Boxes and Bandwidth Generously Provided by pair Networks
XP is just a number
 
PerlMonks  

Re^2: Passing an import list to Moose extends

by davido (Cardinal)
on May 03, 2018 at 20:15 UTC ( [id://1214024]=note: print w/replies, xml ) Need Help??


in reply to Re: Passing an import list to Moose extends
in thread Passing an import list to Moose extends

°) it's not easy to avoid puns here

Indeed. I found it difficult to choose my words in the question I asked for the same reason.

I'm certain that I can come up with a solution, and it may follow one of the paths you've explored. But I just keep thinking I can't be the first person to discover this need, considering how well-developed the Moose ecosystem has become. But you're on the right track, I think. So thanks!


Dave

  • Comment on Re^2: Passing an import list to Moose extends

Replies are listed 'Best First'.
Re^3: Passing an import list to Moose extends
by LanX (Saint) on May 03, 2018 at 21:06 UTC
    I'm not sure if that's such a trivial requirement.

    My next idea was to import manually and run extends afterwards because all the docs say:

    When you pass classes to this method, we will attempt to load them if they are not already loaded .

    But here it becomes really tricky ... import into which namespace exactly?

    You are effectively setting @ISA to a superclass which has to be created with special import features, right?

    What if another part of your runtime needs the same superclass with different features?

    Well, this gets really abstract without a concrete use case.*

    But I think you need to create intermediate classes for different import options between your subclass and superclass.

    Or probably you just need to change your concept to mixins?

    Cheers Rolf
    (addicted to the Perl Programming Language and ☆☆☆☆ :)
    Wikisyntax for the Monastery

    *) please help us understand better what your goal is.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1214024]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others goofing around in the Monastery: (3)
As of 2024-04-19 17:51 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found