File tree Expand file tree Collapse file tree 1 file changed +29
-0
lines changed Expand file tree Collapse file tree 1 file changed +29
-0
lines changed Original file line number Diff line number Diff line change @@ -1048,6 +1048,35 @@ Defined as:
1048
1048
1049
1049
Throws C < X::Cannot::Capture > .
1050
1050
1051
+ = head1 Runtime creation of Signature objects (6.d, 2019.01 and later)
1052
+
1053
+ Signature.new(params => (...), returns => Type, arity => 1, count => 1)
1054
+
1055
+ In some situations, specifically when working with the MetaObject Protocol,
1056
+ it makes sense to create C < Signature > objects programmatically. For this
1057
+ purpose, you can call the C < new > method with the following named parameters:
1058
+
1059
+ = item params
1060
+
1061
+ A list of L < Parameter|/type/Parameter > objects for this signature.
1062
+
1063
+ = item returns
1064
+
1065
+ Any constraint the return value should match. Defaults to C < Mu > , which
1066
+ effectively implies no return value constraint check.
1067
+
1068
+ = item arity
1069
+
1070
+ The I < minimal > number of positional arguments required to satisfy the
1071
+ signature. Defaults to the number of C < Parameter > objects given with
1072
+ the C < params > parameter.
1073
+
1074
+ = item count
1075
+
1076
+ The I < maximal > number of positional arguments which can be bound to the
1077
+ signature. Defaults to the C < arity > if not specified. Specify C < Inf > if
1078
+ there is a slurpy positional parameter.
1079
+
1051
1080
= end pod
1052
1081
1053
1082
# vim: expandtab softtabstop=4 shiftwidth=4 ft=perl6
You can’t perform that action at this time.
0 commit comments