develooper Front page | perl.perl6.users | Postings from June 2021

Notes/Questions about Leon Timmermans's talk

Thread Next
Marc Chantreux
June 9, 2021 11:04
Notes/Questions about Leon Timmermans's talk
Message ID:

I just saw this and it's very good

The features he picked are indeed things i really like in raku
and i learned some interesting details. Other details are still
bugging me so i have some questions there:

A. if x -> $y with //

For exemple, given a function Foo

    sub foo ( Int $x ) { 42 if $x > 5  }

this is awesome you can write

    if foo 7 -> $value { say $value }

and even

    if foo 7 { say $^value }

but is there a way (adverb?) to match if something is False but defined
so given this

    sub foo ( Int $x ) { 0 if $x > 5 }

i would write something else than

    sub foo ( Int $x ) { 0 if $x > 5 }
    sub hello {say "hello $^world"}
    if defined my $value = foo 45 { hello $value }

B. » vs map

Leon made this slide where i consider as equivalent


someone, some day, told me they are not and i shouldn't use » if
i don't know what it means. I read the doc and came to the
(incorrect?) conclusion that


is actually*.abs).hyper

which could have important overloads while creating an HyperSeq.

should i reconsider the whole thing and use » without fear?


Thread Next Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About