On Wed, Jun 2, 2021 at 11:57 AM William Michels wrote:
>
> Hi Ralph, Both prefix/postfix 'when' look okay on my Rakudo_2020.10 install:
Only postfix in 2021.03:
https://replit.com/@RalphMellor/FooACCEPT-junction#main.raku
Hi Ralph, Both prefix/postfix 'when' look okay on my Rakudo_2020.10 install:
user@mbook:~$ raku
Welcome to 퐑퐚퐤퐮퐝퐨™ v2020.10.
Implementing the 퐑퐚퐤퐮™ programming language v6.d.
Built on MoarVM version 2020.10.
To exit type 'exit' or '^D'
> when 3 { say 'prefix when' }
False
> { say 'postfix when'
On Tue, Jun 1, 2021 at 11:31 William Michels via perl6-users <
perl6-users@perl.org> wrote:
> Hi Bruce,
> This is what I see with Rakudo 2020.10 (all code below performs
> delightfully as expected):
>
This whole thread looks like good stuff for some probably missing roast
tests.
-Tom
Hi Bruce,
This is what I see with Rakudo 2020.10 (all code below performs
delightfully as expected):
user@mbook:~$ raku
Welcome to 퐑퐚퐤퐮퐝퐨™ v2020.10.
Implementing the 퐑퐚퐤퐮™ programming language v6.d.
Built on MoarVM version 2020.10.
To exit type 'exit' or '^D'
> ? (any(4,3) ~~ 3)
True
> ? (3 ~~
Curiously, it works for postfix `when`:
```
$_ := any(4,3);
{say 'postfix when'} when 3; # 3
when 3 { say 'prefix when' } # (no output)
```
--
love, raiph
On Tue, Jun 1, 2021 at 4:02 AM Larry Wall wrote:
>
> In my opinion, the most consistent approach is to disallow any
> autothreading of the argument to .ACCEPTS
That sounds like a really appropriate simplification as I write this.
> All those other smartmatches are sugar for .ACCEPTS, and
>
In my opinion, the most consistent approach is to disallow any
autothreading of the argument to .ACCEPTS, such that 3.ACCEPTS(any(3,4))
simply returns False. I suspect the only thing that returns True for
that sort of argument is Junction.ACCEPTS(any(3,4)) and such. And we
can't autothread that,
Thanks for the explanation, I think the docs (and Roast) also can be more
explicit on the difference between
$left ~~ $right
and
$right.ACCEPTS($left)
and
given ($left) { when $right { ... } }
and
... when $right;
ralph-if you are reading this, last week you went into detail about
On Sun, May 30, 2021 at 10:18:13PM -0400, yary wrote:
: This came up in today's Raku study group (my own golfing-)
:
: > ? (any(4,3) ~~ 3)
: True
: > ? (3 ~~ any(4,3))
: True
: > given any(4,3) { when 3 {say '3'}; say 'nope'}
: nope
: > given 3 { when any(4,3) {say '3'}; say 'nope'}
: 3
: > given
Nice checking! I opened https://github.com/rakudo/rakudo/issues/4386
-y
On Mon, May 31, 2021 at 3:45 AM Bruce Gray
wrote:
>
>
> > On May 30, 2021, at 9:18 PM, yary wrote:
> >
> > This came up in today's Raku study group (my own golfing-)
> >
> > > ? (any(4,3) ~~ 3)
> > True
> > > ? (3 ~~
> On May 30, 2021, at 9:18 PM, yary wrote:
>
> This came up in today's Raku study group (my own golfing-)
>
> > ? (any(4,3) ~~ 3)
> True
> > ? (3 ~~ any(4,3))
> True
> > given any(4,3) { when 3 {say '3'}; say 'nope'}
> nope
> > given 3 { when any(4,3) {say '3'}; say 'nope'}
> 3
> > given
This came up in today's Raku study group (my own golfing-)
> ? (any(4,3) ~~ 3)
True
> ? (3 ~~ any(4,3))
True
> given any(4,3) { when 3 {say '3'}; say 'nope'}
nope
> given 3 { when any(4,3) {say '3'}; say 'nope'}
3
> given any(4,3) { say .raku }
any(4, 3)
why does Raku say 'nope' for the example
12 matches
Mail list logo