The :foo<bar> syntax is called a "colon pair", and colon pair also
describes :quux since it is short for :quux(True)

Colon pair also describes :$foo because it is a shorthand using a colon to
create the Pair object foo=>$foo

Searching raku docs showed
https://docs.raku.org/language/glossary#index-entry-Colon_Pair

which also says that putting a bunch of those together creates a "colon
list"

It also has a link to Adverb https://docs.raku.org/language/glossary#Adverb

which shows how colon pairs can be used to set named arguments–when used
that way, a colon pair is also called an "adverbial pair."

-y


On Sun, Aug 30, 2020 at 2:50 AM ToddAndMargo via perl6-users <
perl6-us...@perl.org> wrote:
>
> >> On Sat, Aug 29, 2020 at 9:05 PM ToddAndMargo via perl6-users
> >> <perl6-us...@perl.org <mailto:perl6-us...@perl.org>> wrote:
>
> >>     And if you would not mind, what is the official name
> >>     of variables that begin with ":"
> >>
>
> On 2020-08-30 00:43, Brad Gilbert wrote:
> > There are no variables that begin with :
> >
> > There are variable declarations in signatures that begin with :
> >
> > :$foo is exactly the same as :foo($foo)
> >
> >      sub bar ( :$foo ) {…}
> >      sub bar ( :foo($foo) ){…}
> >
> > :$foo in a signature is a shortcut for declaring a named argument :foo()
> > and a variable with the same base name $foo
> >
> > :$foo also does the same thing as an argument
> >
> >      my $foo = 1;
> >
> >      bar( :$foo )
> >      bar( :foo($foo) )
> >      bar( foo => $foo )
> >
> > Note that forms with : can be outside of the signature
> >
> >      bar( ) :$foo
> >      bar( ) :foo($foo)
>
>
> Follow up questions:
>
> 1) what is the exact name used to describe these critters?
>
> 2) is there a manual page on them?

Reply via email to