On 09/11/2018 03:22 AM, Timo Paulssen wrote:
On 11/09/18 12:18, JJ Merelo wrote:
El mar., 11 sept. 2018 a las 12:15, Timo Paulssen (<t...@wakelift.de
<mailto:t...@wakelift.de>>) escribió:
The colon at the end of "Str:D:" signifies that it's a type
constraint on what you call the method on. For example:
That, of course, is also in the documentation:
https://docs.perl6.org/type/Signature#index-entry-type_constraint_%3AD
(maybe not with the same words, and maybe it can be improved, but still)
You just have to type :D in the search slot.
JJ
I believe you linked to the wrong section,
https://docs.perl6.org/type/Signature#Parameter_separators is where the
colon at the end is explained.
Though you cannot search for :D: and get to somewhere that explains it,
and searching for :D:, which is a very common usage for the invocant
colon, doesn't lead you to this section, either.
-Timo
Hi Timo,
method ($a: @b, %c) {}; # first argument is the invocant
class Foo {
method whoami($me:) {
"Well I'm class $me.^name(), of course!"
}
}
say Foo.whoami; # OUTPUT: «Well I'm class Foo, of course!»
is no help whatsoever.
Would you please explain it to me?
-T