Hi All,
https://github.com/rakudo/rakudo/blob/master/src/core.c/Str.pm6
337:multi method contains(Str:D: Str:D $needle --> Bool:D) {
338:nqp::hllbool(nqp::isne_i(nqp::index($!value,$needle,0),-1))
339:}
I "presume" in
"abcd".contains("bc")
"abcd" is `$!value`, and
"bc" is $needle. Do I presume correctly?
Questions:
1) why is it "$needle" and not "$!needle" on line 338?
Is this because it is an internal variable and not
a variable from the class declaration?
2) where is variable ".value" defined on line 338?
What kind of variable is .value?
3) the first "Str:D" goes to what on line 337? To .value?
4) Is .value the default, if there is no name given?
Many thanks,
-T