.\" -*- mode: troff; coding: utf-8 -*- .\" Automatically generated by Pod::Man v6.0.2 (Pod::Simple 3.45) .\" .\" 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 .. .\" \*(C` and \*(C' are quotes in nroff, nothing in troff, for use with C<>. .ie n \{\ . ds C` "" . ds C' "" 'br\} .el\{\ . 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 .\" .\" Required to disable full justification in groff 1.23.0. .if n .ds AD l .\" ======================================================================== .\" .IX Title "Type::Params::Signature 3" .TH Type::Params::Signature 3 2025-07-14 "perl v5.42.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 Type::Params::Signature \- internal representation of a function signature .SH STATUS .IX Header "STATUS" This module is not covered by the Type\-Tiny stability policy. .SH DESCRIPTION .IX Header "DESCRIPTION" This is mostly internal code, but can be used to provide basic introspection for signatures. .SS Constructors .IX Subsection "Constructors" .ie n .IP new(%attributes) 4 .el .IP \f(CWnew(%attributes)\fR 4 .IX Item "new(%attributes)" .PD 0 .ie n .IP """new_from_compile($style, %attributes)""" 4 .el .IP "\f(CWnew_from_compile($style, %attributes)\fR" 4 .IX Item "new_from_compile($style, %attributes)" .ie n .IP new_from_v2api(\e%attributes) 4 .el .IP \f(CWnew_from_v2api(\e%attributes)\fR 4 .IX Item "new_from_v2api(%attributes)" .PD .SS Attributes .IX Subsection "Attributes" All attributes are read\-only. .ie n .IP """package"" \fBClassName\fR" 4 .el .IP "\f(CWpackage\fR \fBClassName\fR" 4 .IX Item "package ClassName" The package we\*(Aqre providing a signature for. Will be used to look up any stringy type names. .ie n .IP """subname"" \fBStr\fR" 4 .el .IP "\f(CWsubname\fR \fBStr\fR" 4 .IX Item "subname Str" The sub we\*(Aqre providing a signature for. .ie n .IP """description"" \fBStr\fR" 4 .el .IP "\f(CWdescription\fR \fBStr\fR" 4 .IX Item "description Str" .PD 0 .ie n .IP """method"" \fBArrayRef[InstanceOf[\*(AqType::Params::Parameter\*(Aq]]\fR" 4 .el .IP "\f(CWmethod\fR \fBArrayRef[InstanceOf[\*(AqType::Params::Parameter\*(Aq]]\fR" 4 .IX Item "method ArrayRef[InstanceOf['Type::Params::Parameter']]" .ie n .IP """head"" \fBArrayRef[InstanceOf[\*(AqType::Params::Parameter\*(Aq]]\fR" 4 .el .IP "\f(CWhead\fR \fBArrayRef[InstanceOf[\*(AqType::Params::Parameter\*(Aq]]\fR" 4 .IX Item "head ArrayRef[InstanceOf['Type::Params::Parameter']]" .ie n .IP """tail"" \fBArrayRef[InstanceOf[\*(AqType::Params::Parameter\*(Aq]]\fR" 4 .el .IP "\f(CWtail\fR \fBArrayRef[InstanceOf[\*(AqType::Params::Parameter\*(Aq]]\fR" 4 .IX Item "tail ArrayRef[InstanceOf['Type::Params::Parameter']]" .ie n .IP """parameters"" \fBArrayRef[InstanceOf[\*(AqType::Params::Parameter\*(Aq]]\fR" 4 .el .IP "\f(CWparameters\fR \fBArrayRef[InstanceOf[\*(AqType::Params::Parameter\*(Aq]]\fR" 4 .IX Item "parameters ArrayRef[InstanceOf['Type::Params::Parameter']]" .ie n .IP """slurpy"" \fBInstanceOf[\*(AqType::Params::Parameter\*(Aq]\fR" 4 .el .IP "\f(CWslurpy\fR \fBInstanceOf[\*(AqType::Params::Parameter\*(Aq]\fR" 4 .IX Item "slurpy InstanceOf['Type::Params::Parameter']" .ie n .IP """on_die"" \fBCodeRef\fR" 4 .el .IP "\f(CWon_die\fR \fBCodeRef\fR" 4 .IX Item "on_die CodeRef" .ie n .IP """strictness"" \fBBool|ScalarRef\fR" 4 .el .IP "\f(CWstrictness\fR \fBBool|ScalarRef\fR" 4 .IX Item "strictness Bool|ScalarRef" .ie n .IP """next"" \fBCodeRef\fR" 4 .el .IP "\f(CWnext\fR \fBCodeRef\fR" 4 .IX Item "next CodeRef" .ie n .IP """goto_next"" \fBCodeRef\fR" 4 .el .IP "\f(CWgoto_next\fR \fBCodeRef\fR" 4 .IX Item "goto_next CodeRef" .PD Alias for \f(CW\*(C`next\*(C'\fR. .ie n .IP """can_shortcut"" \fBBool\fR" 4 .el .IP "\f(CWcan_shortcut\fR \fBBool\fR" 4 .IX Item "can_shortcut Bool" Indicates whether the signature has no potential to alter \f(CW@_\fR allowing it to be returned without being copied if type checks pass. Generally speaking, you should not provide this to the constructor and rely on Type::Params::Signature to figure it out. .ie n .IP """coderef"" \fBInstanceOf[\*(AqEval::TypeTiny::CodeAccumulator\*(Aq]\fR" 4 .el .IP "\f(CWcoderef\fR \fBInstanceOf[\*(AqEval::TypeTiny::CodeAccumulator\*(Aq]\fR" 4 .IX Item "coderef InstanceOf['Eval::TypeTiny::CodeAccumulator']" You probably don\*(Aqt want to provide this to the constructor. The whole point of this module is to build it for you! .PP \fIAttributes related to named parameters\fR .IX Subsection "Attributes related to named parameters" .ie n .IP """is_named"" \fBBool\fR" 4 .el .IP "\f(CWis_named\fR \fBBool\fR" 4 .IX Item "is_named Bool" .PD 0 .ie n .IP """allow_dash"" \fBBool\fR" 4 .el .IP "\f(CWallow_dash\fR \fBBool\fR" 4 .IX Item "allow_dash Bool" .ie n .IP """bless"" \fBBool|ClassName\fR" 4 .el .IP "\f(CWbless\fR \fBBool|ClassName\fR" 4 .IX Item "bless Bool|ClassName" .ie n .IP """class"" \fBClassName\fR" 4 .el .IP "\f(CWclass\fR \fBClassName\fR" 4 .IX Item "class ClassName" .ie n .IP """constructor"" \fBStr\fR" 4 .el .IP "\f(CWconstructor\fR \fBStr\fR" 4 .IX Item "constructor Str" .ie n .IP """class_attributes"" \fBHashRef\fR" 4 .el .IP "\f(CWclass_attributes\fR \fBHashRef\fR" 4 .IX Item "class_attributes HashRef" .PD HashRef suitable for passing to the \f(CW\*(C`import\*(C'\fR method of Class::XSAccessor. A default will be generated based on \f(CW\*(C`parameters\*(C'\fR .ie n .IP """named_to_list"" \fBArrayRef\fR" 4 .el .IP "\f(CWnamed_to_list\fR \fBArrayRef\fR" 4 .IX Item "named_to_list ArrayRef" Can be coerced from a bool based on \f(CW\*(C`parameters\*(C'\fR. .ie n .IP """list_to_named"" \fBBool\fR" 4 .el .IP "\f(CWlist_to_named\fR \fBBool\fR" 4 .IX Item "list_to_named Bool" .PD 0 .ie n .IP """oo_trace"" \fBBool\fR" 4 .el .IP "\f(CWoo_trace\fR \fBBool\fR" 4 .IX Item "oo_trace Bool" .PD Defaults to true. Indicates whether blessed \f(CW$arg\fR hashrefs created by the signature will include a \f(CW\*(Aq~~caller\*(Aq\fR key. .PP \fIBare attributes\fR .IX Subsection "Bare attributes" .PP These attributes may be passed to the constructors and may do something, but no methods are provided to access the values later. .ie n .IP """positional"" or ""pos"" \fBArrayRef\fR" 4 .el .IP "\f(CWpositional\fR or \f(CWpos\fR \fBArrayRef\fR" 4 .IX Item "positional or pos ArrayRef" .PD 0 .ie n .IP """named"" \fBArrayRef\fR" 4 .el .IP "\f(CWnamed\fR \fBArrayRef\fR" 4 .IX Item "named ArrayRef" .ie n .IP """multiple"" or ""multi"" \fBArrayRef\fR" 4 .el .IP "\f(CWmultiple\fR or \f(CWmulti\fR \fBArrayRef\fR" 4 .IX Item "multiple or multi ArrayRef" .ie n .IP """returns"" \fBBool\fR" 4 .el .IP "\f(CWreturns\fR \fBBool\fR" 4 .IX Item "returns Bool" .PD Shortcut for setting \f(CW\*(C`returns_scalar\*(C'\fR and \f(CW\*(C`returns_list\*(C'\fR simultaneously. .ie n .IP """want_source"" \fBBool\fR" 4 .el .IP "\f(CWwant_source\fR \fBBool\fR" 4 .IX Item "want_source Bool" .PD 0 .ie n .IP """want_details"" \fBBool\fR" 4 .el .IP "\f(CWwant_details\fR \fBBool\fR" 4 .IX Item "want_details Bool" .ie n .IP """want_object"" \fBBool\fR" 4 .el .IP "\f(CWwant_object\fR \fBBool\fR" 4 .IX Item "want_object Bool" .ie n .IP """rationalize_slurpies"" \fBBool\fR" 4 .el .IP "\f(CWrationalize_slurpies\fR \fBBool\fR" 4 .IX Item "rationalize_slurpies Bool" .PD .SS Methods .IX Subsection "Methods" \fIPredicates\fR .IX Subsection "Predicates" .PP Predicate methods return true/false to indicate the presence or absence of attributes. .ie n .IP """has_description""" 4 .el .IP \f(CWhas_description\fR 4 .IX Item "has_description" .PD 0 .ie n .IP """has_head""" 4 .el .IP \f(CWhas_head\fR 4 .IX Item "has_head" .ie n .IP """has_tail""" 4 .el .IP \f(CWhas_tail\fR 4 .IX Item "has_tail" .ie n .IP """has_parameters""" 4 .el .IP \f(CWhas_parameters\fR 4 .IX Item "has_parameters" .ie n .IP """has_slurpy""" 4 .el .IP \f(CWhas_slurpy\fR 4 .IX Item "has_slurpy" .ie n .IP """has_on_die""" 4 .el .IP \f(CWhas_on_die\fR 4 .IX Item "has_on_die" .ie n .IP """has_strictness""" 4 .el .IP \f(CWhas_strictness\fR 4 .IX Item "has_strictness" .ie n .IP """has_returns_scalar""" 4 .el .IP \f(CWhas_returns_scalar\fR 4 .IX Item "has_returns_scalar" .ie n .IP """has_returns_list""" 4 .el .IP \f(CWhas_returns_list\fR 4 .IX Item "has_returns_list" .PD .PP \fIClass making methods\fR .IX Subsection "Class making methods" .PP These methods will be called automatically during object construction and should not typically be called. They are public methods in case it is desired to subclass Type::Params::Signature. .ie n .IP """make_class_pp""" 4 .el .IP \f(CWmake_class_pp\fR 4 .IX Item "make_class_pp" Builds the class specified in \f(CW\*(C`bless\*(C'\fR by evaluating Perl code. .ie n .IP """make_class_xs""" 4 .el .IP \f(CWmake_class_xs\fR 4 .IX Item "make_class_xs" Builds the class specified in \f(CW\*(C`bless\*(C'\fR using Class::XSAccessor. .ie n .IP """make_class""" 4 .el .IP \f(CWmake_class\fR 4 .IX Item "make_class" Calls either \f(CW\*(C`make_class_pp\*(C'\fR or \f(CW\*(C`make_class_xs\*(C'\fR. .ie n .IP """make_class_pp_code""" 4 .el .IP \f(CWmake_class_pp_code\fR 4 .IX Item "make_class_pp_code" Generates the code for \f(CW\*(C`make_class_pp\*(C'\fR. .PP \fIOther methods\fR .IX Subsection "Other methods" .ie n .IP """BUILD""" 4 .el .IP \f(CWBUILD\fR 4 .IX Item "BUILD" Called by the constructors. You should not call this. .ie n .IP """return_wanted""" 4 .el .IP \f(CWreturn_wanted\fR 4 .IX Item "return_wanted" Normally returns the signature coderef, unless \f(CW\*(C`want_source\*(C'\fR, \f(CW\*(C`want_details\*(C'\fR, or \f(CW\*(C`want_object\*(C'\fR were provided to the constructor, in which case it will return the source code for the coderef, a hashref of details, or \f(CW$self\fR. .SH ENVIRONMENT .IX Header "ENVIRONMENT" .ie n .IP """PERL_TYPE_PARAMS_XS""" 4 .el .IP \f(CWPERL_TYPE_PARAMS_XS\fR 4 .IX Item "PERL_TYPE_PARAMS_XS" Affects the building of accessors for \f(CW$arg\fR objects. If set to true, will use Class::XSAccessor. If set to false, will use pure Perl. If this environment variable does not exist, will use Class::XSAccessor. .Sp If Class::XSAccessor is not installed or is too old, pure Perl will always be used as a fallback. .SH BUGS .IX Header "BUGS" Please report any bugs to . .SH "SEE ALSO" .IX Header "SEE ALSO" Type::Params, Type::Params::Parameter, Type::Params::Alternatives. .SH AUTHOR .IX Header "AUTHOR" Toby Inkster . .SH "COPYRIGHT AND LICENCE" .IX Header "COPYRIGHT AND LICENCE" This software is copyright (c) 2023\-2025 by Toby Inkster. .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. .SH "DISCLAIMER OF WARRANTIES" .IX Header "DISCLAIMER OF WARRANTIES" THIS PACKAGE IS PROVIDED "AS IS" AND WITHOUT ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.