Summer actually scratch that 00:01
how to do the following: $potentially-nil.?Str
as in "stringify if defined, else nil"
.defined ?? .Str !! Nil given $potentially-nil; I guess 00:04
Kaiepi my $potentially-nil andthen .Str 00:27
technically, (my $potentially-nil andthen .Str) || Nil
er 00:28
my $potentially-nil andthen .Str orelse Nil
Summer `git blame whoever-did-nil's-str-method` :sob: 00:29
00:43 frost joined
Kaiepi m: put (my $potentially-nil andthen .Str) 00:50
camelia
Kaiepi m: dd (my $potentially-nil andthen .Str) 00:51
camelia Empty
Kaiepi an empty list coerces to an empty string
Summer it was going into a pair, but then I found out empty pairs are just still pairs 00:54
but then i solved everything
method AT-KEY( $key where { NIC.parse: $_ } ) {
&!constructor( | $/.hash>>.Str );
};
03:15 Guest35_ left 06:14 archenoth is now known as arch 06:20 frost left 08:08 dakkar joined 08:14 frost joined 09:36 jaguart joined 11:10 frost left 11:57 discord-raku-bot left, discord-raku-bot joined 13:14 discord-raku-bot left, discord-raku-bot joined 13:24 discord-raku-bot left, discord-raku-bot joined 13:52 dakkar left 13:53 jaguart left 14:03 Guest35_ joined 14:29 Kaipei joined 14:33 Kaiepi left 15:02 Kaipei is now known as Kaiepi 16:24 qorg11 left
Anton Antonov I want to specify Whatever or Nil as values for CLI arguments. Right now make those arguments of type Str and check are the given values in <Whatever Nil>. Is there are a better or more concise approach? 19:22
lizmat multi MAIN("Whatever") { } multi MAIN("Nil") { } ?? 19:34
Anton Antonov @lizmat Yes, that works for me. I use(d) it. I was thinking something like MAIN( Str :$arg1 = v1, :$arg2 = Whatever where * ~~ Str || * ∈ (Whatever Nil), Num :$arg = 12) 19:38
19:44 jaguart joined 21:33 kueppo joined
Nemokosch How do I `take` a list by elements? 21:36
`.take for @list` definitely works, is there something better? 21:38
Morfent m:``` 21:59
dd gather for <1 2 3>, <4 5 6> { take |@^xs }
```
Nemokosch yes, this doesn't seem to actually flatten.. 22:07
22:33 jaguart left 23:27 kueppo left