.\" Automatically generated by Pod::Man 4.14 (Pod::Simple 3.42) .\" .\" Standard preamble: .\" ======================================================================== .de Sp \" Vertical space (when we can't use .PP) .if t .sp .5v .if n .sp .. .de Vb \" Begin verbatim text .ft CW .nf .ne \\$1 .. .de Ve \" End verbatim text .ft R .fi .. .\" Set up some character translations and predefined strings. \*(-- will .\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left .\" double quote, and \*(R" will give a right double quote. \*(C+ will .\" give a nicer C++. Capital omega is used to do unbreakable dashes and .\" therefore won't be available. \*(C` and \*(C' expand to `' in nroff, .\" nothing in troff, for use with C<>. .tr \(*W- .ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p' .ie n \{\ . ds -- \(*W- . ds PI pi . if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch . if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch . ds L" "" . ds R" "" . ds C` "" . ds C' "" 'br\} .el\{\ . ds -- \|\(em\| . ds PI \(*p . ds L" `` . ds R" '' . ds C` . ds C' 'br\} .\" .\" Escape single quotes in literal strings from groff's Unicode transform. .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" .\" If the F register is >0, we'll generate index entries on stderr for .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index .\" entries marked with X<> in POD. Of course, you'll have to process the .\" output yourself in some meaningful fashion. .\" .\" Avoid warning from groff about undefined register 'F'. .de IX .. .nr rF 0 .if \n(.g .if rF .nr rF 1 .if (\n(rF:(\n(.g==0)) \{\ . if \nF \{\ . de IX . tm Index:\\$1\t\\n%\t"\\$2" .. . if !\nF==2 \{\ . nr % 0 . nr F 2 . \} . \} .\} .rr rF .\" ======================================================================== .\" .IX Title "MooseX::Has::Sugar::Saccharin 3pm" .TH MooseX::Has::Sugar::Saccharin 3pm "2022-06-15" "perl v5.34.0" "User Contributed Perl Documentation" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l .nh .SH "NAME" MooseX::Has::Sugar::Saccharin \- Experimental sweetness .SH "VERSION" .IX Header "VERSION" version 1.000006 .SH "SYNOPSIS" .IX Header "SYNOPSIS" This is a highly experimental sugaring module. No Guarantees of stability. .PP .Vb 4 \& use MooseX::Types::Moose qw( :all ); \& has name => rw Str, default { 1 }; \& has suffix => required rw Str; \& has \*(Aqsuffix\*(Aq, required rw Str; .Ve .PP Your choice. .SH "EXPORT GROUPS" .IX Header "EXPORT GROUPS" .ie n .SS """:default""" .el .SS "\f(CW:default\fP" .IX Subsection ":default" exports: .Sp .RS 4 \&\*(L"ro\*(R", \*(L"rw\*(R", \*(L"required\*(R", \*(L"lazy\*(R", \*(L"lazy_build\*(R", \*(L"coerce\*(R", \*(L"weak_ref\*(R", \*(L"auto_deref\*(R", \&\*(L"bare\*(R", \*(L"default\*(R", \*(L"init_arg\*(R", \*(L"predicate\*(R", \*(L"clearer\*(R", \*(L"builder\*(R", \*(L"trigger\*(R" .RE .SH "EXPORTED FUNCTIONS" .IX Header "EXPORTED FUNCTIONS" .ie n .SS """bare""" .el .SS "\f(CWbare\fP" .IX Subsection "bare" .ie n .SS """bare"" $Type" .el .SS "\f(CWbare\fP \f(CW$Type\fP" .IX Subsection "bare $Type" .Vb 1 \& bare Str .Ve .PP equivalent to this .PP .Vb 1 \& is => \*(Aqbare\*(Aq, isa => Str .Ve .ie n .SS """ro""" .el .SS "\f(CWro\fP" .IX Subsection "ro" .ie n .SS """ro"" $Type" .el .SS "\f(CWro\fP \f(CW$Type\fP" .IX Subsection "ro $Type" .Vb 1 \& ro Str .Ve .PP equivalent to this .PP .Vb 1 \& is => \*(Aqro\*(Aq, isa => Str, .Ve .ie n .SS """rw""" .el .SS "\f(CWrw\fP" .IX Subsection "rw" .ie n .SS """rw"" $Type" .el .SS "\f(CWrw\fP \f(CW$Type\fP" .IX Subsection "rw $Type" .Vb 1 \& rw Str .Ve .PP equivalent to this .PP .Vb 1 \& is => \*(Aqrw\*(Aq, isa => Str .Ve .ie n .SS """required""" .el .SS "\f(CWrequired\fP" .IX Subsection "required" .ie n .SS """required @rest""" .el .SS "\f(CWrequired @rest\fP" .IX Subsection "required @rest" this .PP .Vb 1 \& required rw Str .Ve .PP is equivalent to this .PP .Vb 1 \& required => 1, is => \*(Aqrw\*(Aq, isa => Str, .Ve .PP this .PP .Vb 1 \& rw Str, required .Ve .PP is equivalent to this .PP .Vb 1 \& is => \*(Aqrw\*(Aq, isa => Str , required => 1 .Ve .ie n .SS """lazy""" .el .SS "\f(CWlazy\fP" .IX Subsection "lazy" .ie n .SS """lazy @rest""" .el .SS "\f(CWlazy @rest\fP" .IX Subsection "lazy @rest" like \f(CW\*(C`( lazy => 1 , @rest )\*(C'\fR .ie n .SS """lazy_build""" .el .SS "\f(CWlazy_build\fP" .IX Subsection "lazy_build" .ie n .SS """lazy_build @rest""" .el .SS "\f(CWlazy_build @rest\fP" .IX Subsection "lazy_build @rest" like \f(CW\*(C`( lazy_build => 1, @rest )\*(C'\fR .ie n .SS """weak_ref""" .el .SS "\f(CWweak_ref\fP" .IX Subsection "weak_ref" .ie n .SS """weak_ref @rest""" .el .SS "\f(CWweak_ref @rest\fP" .IX Subsection "weak_ref @rest" like \f(CW\*(C`( weak_ref => 1, @rest )\*(C'\fR .ie n .SS """coerce""" .el .SS "\f(CWcoerce\fP" .IX Subsection "coerce" .ie n .SS """coerce @rest""" .el .SS "\f(CWcoerce @rest\fP" .IX Subsection "coerce @rest" like \f(CW\*(C`( coerce => 1, @rest )\*(C'\fR .PP \fI\s-1WARNING:\s0\fR .IX Subsection "WARNING:" .PP Conflicts with \f(CW\*(C`MooseX::Types\*(Aqs\*(C'\fR \f(CW\*(C`coerce\*(C'\fR method .ie n .SS """auto_deref""" .el .SS "\f(CWauto_deref\fP" .IX Subsection "auto_deref" .ie n .SS """auto_deref @rest""" .el .SS "\f(CWauto_deref @rest\fP" .IX Subsection "auto_deref @rest" like \f(CW\*(C`( auto_deref => 1, @rest )\*(C'\fR .ie n .SS """builder""" .el .SS "\f(CWbuilder\fP" .IX Subsection "builder" .ie n .SS """builder $buildername""" .el .SS "\f(CWbuilder $buildername\fP" .IX Subsection "builder $buildername" .Vb 1 \& required rw Str, builder \*(Aq_build_foo\*(Aq .Ve .PP is like .PP .Vb 1 \& builder => \*(Aq_build_foo\*(Aq .Ve .ie n .SS """predicate""" .el .SS "\f(CWpredicate\fP" .IX Subsection "predicate" .ie n .SS """predicate $predicatename""" .el .SS "\f(CWpredicate $predicatename\fP" .IX Subsection "predicate $predicatename" see \*(L"builder\*(R" .ie n .SS """clearer""" .el .SS "\f(CWclearer\fP" .IX Subsection "clearer" .ie n .SS """clearer $clearername""" .el .SS "\f(CWclearer $clearername\fP" .IX Subsection "clearer $clearername" see \*(L"builder\*(R" .ie n .SS """init_arg""" .el .SS "\f(CWinit_arg\fP" .IX Subsection "init_arg" .ie n .SS """init_arg $argname""" .el .SS "\f(CWinit_arg $argname\fP" .IX Subsection "init_arg $argname" see \*(L"builder\*(R" .ie n .SS """default""" .el .SS "\f(CWdefault\fP" .IX Subsection "default" .ie n .SS """default { $code }""" .el .SS "\f(CWdefault { $code }\fP" .IX Subsection "default { $code }" Examples: .PP .Vb 4 \& default { 1 } \& default { { } } \& default { [ ] } \& default { $_\->otherfield } .Ve .PP \&\f(CW$_\fR is localized as the same value as \f(CW$_\fR[0] for convenience ( usually \f(CW$self\fR ) .ie n .SS """trigger""" .el .SS "\f(CWtrigger\fP" .IX Subsection "trigger" .ie n .SS """trigger { $code }""" .el .SS "\f(CWtrigger { $code }\fP" .IX Subsection "trigger { $code }" Works exactly like default. .SH "CONFLICTS" .IX Header "CONFLICTS" .SS "MooseX::Has::Sugar" .IX Subsection "MooseX::Has::Sugar" .SS "MooseX::Has::Sugar::Minimal" .IX Subsection "MooseX::Has::Sugar::Minimal" This module is not intended to be used in conjunction with ::Sugar or ::Sugar::Minimal .PP We export many of the same symbols and its just not very sensible. .SS "MooseX::Types" .IX Subsection "MooseX::Types" .SS "Moose::Util::TypeConstraints" .IX Subsection "Moose::Util::TypeConstraints" due to exporting the \*(L"coerce\*(R" symbol, using us in the same scope as a call to .PP .Vb 1 \& use MooseX::Types .... .Ve .PP or use Moose::Util::TypeConstraints .PP will result in a symbol collision. .PP We recommend using and creating proper type libraries instead, ( which will absolve you entirely of the need to use MooseX::Types and MooseX::Has::Sugar(::*)? in the same scope ) .SS "Perl 5.010 feature 'switch'" .IX Subsection "Perl 5.010 feature 'switch'" the keyword 'default' becomes part of Perl in both these cases: .PP .Vb 2 \& use 5.010; \& use feature qw( :switch ); .Ve .PP As such, we can't have that keyword in that scenario. .SH "AUTHOR" .IX Header "AUTHOR" Kent Fredric .SH "COPYRIGHT AND LICENSE" .IX Header "COPYRIGHT AND LICENSE" This software is copyright (c) 2017 by Kent Fredric . .PP This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.