Beefy Boxes and Bandwidth Generously Provided by pair Networks
go ahead... be a heretic
 
PerlMonks  

Re^3: Passing an import list to Moose extends

by LanX (Bishop)
on May 03, 2018 at 21:06 UTC ( #1214025=note: print w/replies, xml ) Need Help??


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

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.

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

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1214025]
help
Chatterbox?
[thezip]: There's a word I'm looking for, which describes the (lack of) repeatability of an instruction. Specifically, when a command is run the first time, it succeeds, but then every subsequent execution of the same command results in an identical result...
[thezip]: What is the name of this property?
[marto]: /mewaves
[marto]: /mefails
[thezip]: Duh... I found it. Idempotentcy
[thezip]: howdy marto!

How do I use this? | Other CB clients
Other Users?
Others exploiting the Monastery: (7)
As of 2018-07-18 20:35 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    It has been suggested to rename Perl 6 in order to boost its marketing potential. Which name would you prefer?















    Results (395 votes). Check out past polls.

    Notices?