On 03/10/2018 01:50, ToddAndMargo wrote:
> On 10/2/18 4:47 PM, David Green wrote:
>> On 2018-10-02 4:06 pm, ToddAndMargo wrote:
>>> What is the official Perl syntaxland name of the [] subroutine?
>> If you search for "[]" at https://docs.perl6.org, it will turn up the
>> routine "postcircumfix [ ]", which links to
>> <https://docs.perl6.org/routine/[%20]#language_documentation_Operators>
>>
>> https://docs.perl6.org/language/subscripts
>> <https://docs.perl6.org/routine/[%20]#language_documentation_Operators>
>>
>>
>>
>> -David
>>
>
> Thank you!
>
> One down, one to go!
>
> :-)


The same page you already found by searching for [ ] in the search bar
also gives you the explanation of the other [ ], i.e. the one used in my
@a = [1, 2, 3].

It is perhaps less visible than desirable, as it doesn't come with an
example, but the category it's in, namely "circumfix" can clue you in
that it means the one in [1, 2, 3]. circumfix means "goes around", like
prefix means "goes before" or infix means "in between". postcircumfix is
kind of a combination of postfix and circumfix where there is one thing
that the routine goes after, and another thing that the routine goes
around. That's how you get @a[1]; the [ ] from the view of @a is a
postfix and from the view of 1 is a circumfix. Hence, postcircumfix.

Hope that helps
  - Timo

Reply via email to