What Curt said, but also, this is a bit like trying to understand English's
word "have" with a dictionary. No one who speaks English natively looks up
"have" in the dictionary. Anyone who does so will find definitions like,
"Used in forming the perfect aspect and the past perfect aspect." Well,
that's not very good at all, how could any common speaker be expected to
understand that? Could any fluent English speaker reverse engineer that
definition? Obviously, considering common cases like "I *have* already seen
that movie", how you _should_ write that definition is... well...

The [] postcircmfix is so low-level to how Perl (both 5 and 6) work that
squinting at its solitary definition to try to divine meaning is not
particularly useful. Eventually you will know Perl 6 well enough that this
document might be of interest to you when you're trying to implement your
own indexing or postcircumfix operator. But it's not useful for learning
what [] _does_ in practice, because it's so basic to the language that one
can only really learn it through seeing it used, or in a tutorial where it
comes up as a topic.
On Tue, Oct 2, 2018 at 20:21 Curt Tilmes <c...@tilmes.org> wrote:

> Remember within the few days people sent you links to read more about
> signatures?  Go read them, then re-ask any remaining questions.
>
> I can cut/paste bits from them them under each of your questions, but it
> would really be better for you to just read the existing docs and try to
> understand signatures more holistically.
>
> https://opensource.com/article/18/9/signatures-perl-6
> https://docs.perl6.org/type/Signature
> https://perl6advent.wordpress.com/2013/12/21/day-21-signatures/
>
> and some videos:
> https://vimeo.com/42051800
> https://www.youtube.com/watch?v=obYlOurt-44
>
>
> On Tue, Oct 2, 2018 at 8:14 PM ToddAndMargo <toddandma...@zoho.com> wrote:
>
>> Hi All,
>>
>> I use postcircumfix [] all the time.  But I don't
>> understand the documentation.
>>
>> https://docs.perl6.org/routine/[%20]#language_documentation_Operators
>> <https://docs.perl6.org/routine/%5B%20%5D#language_documentation_Operators>
>>
>> would someone please explain what the crypto line means:
>>
>> sub postcircumfix:<[ ]>(@container, **@index,
>>                          :$k, :$v, :$kv, :$p, :$exists, :$delete)
>>
>> 1  Why the <[]>?  I have always used [] with out the <>.
>>     Why would I want to use one over the other?
>>
>> 2)  Where does it state that the <> is optional?
>>
>> 3)  What is a **@?  *@ is a slurp all remaining.   A
>>      super duper slurp?
>>
>> 4)  What is :$k, :$v, :$kv, :$p, :$exists, :$delete
>>      and where are they defined?
>>
>> 5)  Why does :$k, :$v, :$kv, :$p, :$exists, :$delete
>>      have colons in front of them?
>>
>> 6)  Where is the --> return described?
>>
>> Yours in confusion,
>> -T
>>
>

Reply via email to