.\" Automatically generated by Pod::Man 4.10 (Pod::Simple 3.35) .\" .\" 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 "Kavorka::Signature 3pm" .TH Kavorka::Signature 3pm "2019-01-17" "perl v5.28.1" "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" Kavorka::Signature \- a function signature .SH "DESCRIPTION" .IX Header "DESCRIPTION" Kavorka::Signature is a class where each instance represents a function signature. This class is used to parse the function signature, and also to inject Perl code into the final function. .PP Instances of this class are also returned by Kavorka's function introspection \s-1API.\s0 .SS "Introspection \s-1API\s0" .IX Subsection "Introspection API" A signature instance has the following methods. Each method which returns parameters, returns an instance of Kavorka::Parameter. .ie n .IP """package""" 4 .el .IP "\f(CWpackage\fR" 4 .IX Item "package" Returns the package name the parameter was declared in. .ie n .IP """params""" 4 .el .IP "\f(CWparams\fR" 4 .IX Item "params" Returns an arrayref of parameters. .ie n .IP """return_types""" 4 .el .IP "\f(CWreturn_types\fR" 4 .IX Item "return_types" Returns an arrayref of declared return types. .ie n .IP """has_invocants"", ""invocants""" 4 .el .IP "\f(CWhas_invocants\fR, \f(CWinvocants\fR" 4 .IX Item "has_invocants, invocants" Returns a boolean/list of invocant parameters. .ie n .IP """positional_params""" 4 .el .IP "\f(CWpositional_params\fR" 4 .IX Item "positional_params" Returns a list of positional parameters. .ie n .IP """has_named"", ""named_params""" 4 .el .IP "\f(CWhas_named\fR, \f(CWnamed_params\fR" 4 .IX Item "has_named, named_params" Returns a boolean/list of named parameters. .ie n .IP """has_slurpy"", ""slurpy""" 4 .el .IP "\f(CWhas_slurpy\fR, \f(CWslurpy\fR" 4 .IX Item "has_slurpy, slurpy" Returns a boolean indicating whether there is a slurpy parameter in this signature / returns the slurpy parameter. .ie n .IP """yadayada""" 4 .el .IP "\f(CWyadayada\fR" 4 .IX Item "yadayada" Indicates whether the yadayada operator was encountered in the signature. .ie n .IP """last_position""" 4 .el .IP "\f(CWlast_position\fR" 4 .IX Item "last_position" The numeric index of the last positional parameter. .ie n .IP """args_min"", ""args_max""" 4 .el .IP "\f(CWargs_min\fR, \f(CWargs_max\fR" 4 .IX Item "args_min, args_max" The minimum/maximum number of arguments expected by the function. Invocants are not counted. If there are any named or slurpy arguments, of the yada yada operator was used in the signature, then \f(CW\*(C`args_max\*(C'\fR will be undef. .ie n .IP """check(@args)""" 4 .el .IP "\f(CWcheck(@args)\fR" 4 .IX Item "check(@args)" Check whether \f(CW@args\fR (which should include any invocants) would satisfy the signature. .ie n .IP """checker""" 4 .el .IP "\f(CWchecker\fR" 4 .IX Item "checker" Returns a coderef which acts like \f(CW\*(C`check(@args)\*(C'\fR. .ie n .IP """inline_check($varname)""" 4 .el .IP "\f(CWinline_check($varname)\fR" 4 .IX Item "inline_check($varname)" Returns a string of Perl code that acts like an inline check, given the name of an array variable, such as \f(CW\*(Aq@foo\*(Aq\fR. .SS "Other Methods" .IX Subsection "Other Methods" .ie n .IP """parse""" 4 .el .IP "\f(CWparse\fR" 4 .IX Item "parse" An internal method used to parse a signature. Only makes sense to use within a Parse::Keyword parser. .ie n .IP """parameter_class""" 4 .el .IP "\f(CWparameter_class\fR" 4 .IX Item "parameter_class" A class to use for parameters when parsing the signature. .ie n .IP """return_type_class""" 4 .el .IP "\f(CWreturn_type_class\fR" 4 .IX Item "return_type_class" A class to use for return types when parsing the signature. .ie n .IP """injection""" 4 .el .IP "\f(CWinjection\fR" 4 .IX Item "injection" The string of Perl code to inject for this signature. .ie n .IP """sanity_check""" 4 .el .IP "\f(CWsanity_check\fR" 4 .IX Item "sanity_check" Tests that the signature is sane. (For example it would not be sane to have a slurpy parameter prior to a positional one.) .SH "BUGS" .IX Header "BUGS" Please report any bugs to . .SH "SEE ALSO" .IX Header "SEE ALSO" Kavorka::Manual::API, Kavorka::Sub, Kavorka::Parameter. .SH "AUTHOR" .IX Header "AUTHOR" Toby Inkster . .SH "COPYRIGHT AND LICENCE" .IX Header "COPYRIGHT AND LICENCE" This software is copyright (c) 2013\-2014, 2017 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" \&\s-1THIS PACKAGE IS PROVIDED \*(L"AS IS\*(R" AND WITHOUT ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.\s0