From 1f30c682a8486dde594bef6dc05af9ab97f78fa6 Mon Sep 17 00:00:00 2001 From: "Wenzel P. P. Peppmeyer" Date: Thu, 29 Sep 2016 01:26:18 +0200 Subject: [PATCH] clarify what arguments are defined in what where-clause --- doc/Type/Signature.pod6 | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/doc/Type/Signature.pod6 b/doc/Type/Signature.pod6 index 7b1ffa0c7..f383f2e19 100644 --- a/doc/Type/Signature.pod6 +++ b/doc/Type/Signature.pod6 @@ -138,6 +138,17 @@ The first of those can be shortened to i.e., you can use a literal directly as a type and value constraint on an anonymous parameter. +Any argument in a C is declared in a C-clause that is +following that argument. Therefor, the C-clause of the last argument got +access to all arguments of a signature that are not part of a sub-signature. +For sub-signature place the C-clause inside the sub-signature. + + sub one-of-them(:$a, :$b, :$c where { $a.defined ^^ $b.defined ^^ $c.defined } ) { + $a // $b // $c + }; + say one-of-them(c=>42); + # OUTPUT«42␤» + =head3 Constraining Slurpy Arguments L can not have type