MooseX...seSetup(3pm)
π MooseX::Declare::Syntax::MooseSetup π
okay bestie, welcome to the manual page for MooseX::Declare::Syntax::MooseSetup(3pm) β straight outta the User Contributed Perl Documentation, no cap. this is the little role that does all the shared heavy lifting for Moose namespace declarations. pull up a chair, we're getting into it π«Ά
β¨ VERSION β¨
version 0.43 β yes, she has a number, she's official.
πΈ DESCRIPTION πΈ
so basically, this role is an extension to NamespaceHandling. that's the whole vibe. it adds all the common parts that every Moose namespace definition needs, so nobody has to write them over and over like a clown. π
if you wanna see this role in the wild, go peek at the class and role keywords β that's where the examples live. π¦
π METHODS π
auto_make_immutable
Bool Object->auto_make_immutable ()
this one always returns false. why? because Moose::Roles can't be made immutable β and before you @ me, this is not a bug and it is not a missing feature, okay? making a role immutable would make absolutely no sense. so she says no. false. every time. periodt. π
imported_moose_symbols
List Object->imported_moose_symbols ()
by default this returns confess and blessed β those two get handed over as extra imports for the namespace. cute little starter pack β¨
import_symbols_from
Str Object->import_symbols_from ()
this is the namespace where those extra imports come from. default? Moose. obviously. π
π§ CONSUMES π§
MooseX::Declare::Syntax::NamespaceHandlingMooseX::Declare::Syntax::EmptyBlockIfMissing
she eats these for breakfast, fr fr. π
π₯ MODIFIED METHODS π₯
default_inner
ArrayRef default_inner ()
this is where the default inner-handlers for the namespace get set up. here's the lineup, bestie:
methodβ a simple Method handler. no drama.aroundβ a MethodModifier handler that kicks off the generated method's signature with$orig: $self, so the original method shows up in$orig. iconic behaviour honestly πafterbeforeoverrideaugment
okay so these four βafter,before,override,augmentβ are allMethodModifierinstances. group chat of modifiers.
cleanβ this one's an instance of theCleankeyword handler. sparkly β¨
β οΈ heads up: the original method will never be called, and all arguments are ignored at the moment. not a drill. that's just how it is right now. π
setup_inner_for
Object->setup_inner_for (ClassName $class)
this installs a with function. what does that with do? it pushes its arguments onto a global storage array that's holding all the roles of the current namespace. teamwork makes the dream work π«Ά
add_namespace_customizations
Object->add_namespace_customizations (Object $context, Str $package, HashRef $options)
after all the other customizations have done their thing, this one:
- adds code to the preamble that imports the
imported_moose_symbolsfrom whatever packageimport_symbols_fromhanded back. π¦ - then adds a code part that immutabilizes the class into the cleanup code β but only if
auto_make_immutablereturned a true value and$options->{is}{mutable}does not exist. conditional queen π
handle_post_parsing
CodeRef Object->handle_post_parsing (Object $context, Str $package, Str|Object $name)
this generates a callback that sets up the roles in the global role storage for the current namespace. and about $name β she's the specified name (which is different from $package, because $package is always the fully qualified name), or if no name was specified at all, she's the anonymous metaclass instance. mystery girl energy π¦
π SEE ALSO π
MooseX::DeclareMoose
go read these too, iykyk.
π AUTHOR π
Florian Ragwitz <rafl@debian.org> β thank you for your service, king π
π COPYRIGHT AND LICENSE π
This software is copyright (c) 2008 by Florian Ragwitz.
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.
and that's the whole page, bestie!! this was generated from perl v5.34.0, dated 2022-06-15 β the manpage footer said so and i would never lie to you. slay, stay hydrated, and go make some immutability decisions responsibly πβ¨πΈ
π¦ where this page comes from
- debian bookworm: libmoosex-declare-perl 0.43-2 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- debian trixie: libmoosex-declare-perl 0.43-2 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu noble: libmoosex-declare-perl 0.43-2 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu resolute: libmoosex-declare-perl 0.43-2 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu stonking: libmoosex-declare-perl 0.43-2 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms