Re: What does `:_` and/or `:_:` signify?

[email protected] (William Michels via perl6-users)
Newsgroups perl.perl6.users
Message-ID <[email protected]>
Hi Marton, Thanks for the reply. 

Below last example (in the REPL), does `dd` not work on Pairs? 
Or is this Indirect Object Notation at work?


[3] > :_
_ => True
[4] > dd :_
:_
Nil
[5] > dd _
===SORRY!=== Error while compiling:
Undeclared name:
    _ used at line 1

[5] > dd :_:
No such method 'dd' for invocant of type 'Pair'
  in block <unit> at <unknown file> line 1




> On Sep 24, 2023, at 23:40, Polgár Márton <[email protected]> wrote:
> 
> Hi Bill,
> 
> :_ is a Pair with the colon syntax that stands for "_" => True. In the first case, it got passed as a named argument and say ignored it. The second case was a method call using the colon syntax - the syntax lizmat challenged not so long ago.  https://github.com/Raku/problem-solving/issues/384 so, ultimately, it was (:_).say, a normal say method call on a Pair.
> 
> Cheers
> 
> 
> 
> A(z) Galaxy eszközömről küldve
> 
> 
> 
> -------- Eredeti üzenet --------
> Feladó: William Michels <[email protected]>
> Dátum: 2023. 09. 25. 7:15 (GMT+01:00)
> Címzett: perl6-users <[email protected]>
> Tárgy: What does `:_` and/or `:_:` signify?
> 
> Hello, 
> 
> While playing around in an attempt to define new operators, I stumbled upon some curious results. 
> 
> In the REPL, trying `say :_` returns a blank line.
> 
> In the REPL, trying `say :_:` returns `_ => True`.
> 
> What is the meaning of this?
> 
> admin@mbp ~ % raku
> Welcome to Rakudo™ v2023.05.
> Implementing the Raku® Programming Language v6.d.
> Built on MoarVM version 2023.05.
> 
> To exit type 'exit' or '^D'
> [0] > say _
> ===SORRY!=== Error while compiling:
> Undeclared name:
>     _ used at line 1
> 
> [0] > say :_
> 
> [0] > say :_:
> _ => True
> [0] >
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.