[00:58] *** discord-raku-bot joined
[01:05] *** riffraff18 joined
[01:10] *** riffraff18 left
[01:19] *** discord-raku-bot left
[01:20] *** discord-raku-bot joined
[01:48] *** discord-raku-bot left
[01:56] *** discord-raku-bot joined
[02:02] *** parv left
[02:08] *** discord-raku-bot left
[02:08] *** discord-raku-bot joined
[03:05] *** riffraff18 joined
[03:10] *** riffraff18 left
[04:30] *** riffraff18 joined
[04:31] *** riffraff18 left
[04:31] *** riffraff18 joined
[06:00] *** riffraff18 left
[06:01] *** riffraff18 joined
[07:47] *** parv joined
[09:05] *** riffraff18 left
[09:05] *** riffraff18 joined
[09:10] *** riffraff18 left
[09:36] *** riffraff18 joined
[11:04] *** parv left
[12:26] <discord-raku-bot> <Nemokosch#9980> What is the most comfortable way to replace a Nil value with something else, like a default value for an expression:

[12:26] <discord-raku-bot> <Nemokosch#9980> What is the most comfortable way to replace a Nil value with something else, like a default value for an expression?

[12:31] <discord-raku-bot> <Nemokosch#9980> Also, why:

[12:32] <lizmat> m: say Nil // 42

[12:32] <camelia> rakudo-moar d7152ea59: OUTPUT: «42␤»

[12:32] <discord-raku-bot> <Nemokosch#9980> m: [213,23142124,Nil] ~~ [Nil, **]

[12:32] <discord-raku-bot> <Nemokosch#9980> oops

[12:33] <discord-raku-bot> <Nemokosch#9980> anyways, this is True

[12:33] <lizmat> ?

[12:33] <discord-raku-bot> <Nemokosch#9980> why is it True?

[12:33] <lizmat> m: dd 213 ~~ Nil

[12:33] <camelia> rakudo-moar d7152ea59: OUTPUT: «Bool::False␤»

[12:33] <discord-raku-bot> <Nemokosch#9980> yes, this will do, thank you

[12:33] <discord-raku-bot> <Nemokosch#9980> still, I'm curious why that match returns true

[12:34] <lizmat> m: say [213,23142124,Nil] ~~ [Nil, **]

[12:34] <camelia> rakudo-moar d7152ea59: OUTPUT: «True␤»

[12:35] <discord-raku-bot> <Nemokosch#9980> m: dd [213,23142124,Nil] ~~ [Nil, **]

[12:35] <discord-raku-bot> <Nemokosch#9980> you won, haha

[12:39] <lizmat> ** is a so-called HyperWhatever, but the semantics of that are pretty undeveloped

[12:41] <discord-raku-bot> <Nemokosch#9980> yes, I was trying to use it like a "slurpy whatever"

[12:42] <discord-raku-bot> <Nemokosch#9980> but apparently that's not the semantics we get here

[12:43] <lizmat> a single * should act as a slurpy whatever in that context

[12:47] <discord-raku-bot> <Nemokosch#9980> oh that's good to know

[12:47] <discord-raku-bot> <Nemokosch#9980> by the way, while we are at it

[12:47] <discord-raku-bot> <Nemokosch#9980> a couple of days ago, something came up with array assignments

[12:47] <discord-raku-bot> <Nemokosch#9980> namely that [@a, @b] results into a proper two-dimensional something

[12:47] <discord-raku-bot> <Nemokosch#9980> but

[12:47] <discord-raku-bot> <Nemokosch#9980> my [@a, @b]  = ...

[12:47] <discord-raku-bot> <Nemokosch#9980> seems to always be flat

[12:48] <discord-raku-bot> <Nemokosch#9980> and hence I don't think @b can ever get a non-default value

[12:48] <discord-raku-bot> <Nemokosch#9980> do you know something about this behavior?

[12:49] <discord-raku-bot> <Nemokosch#9980> let's have an example

[12:49] <discord-raku-bot> <Nemokosch#9980> m: my @a = 1, 2; my @b = 3,4; [@a, @b] = [@b, @a ]; dd @a; dd @b;

[12:49] <discord-raku-bot> <Nemokosch#9980> wait what

[12:51] <discord-raku-bot> <Nemokosch#9980> maybe it was with lists?

[12:51] <discord-raku-bot> <Nemokosch#9980> okay, found it

[12:52] <discord-raku-bot> <Nemokosch#9980> my @a = 1, 2; my @b = 3,4; (@a, @b) = (@b, @a); dd @a; dd @b;

[12:52] <discord-raku-bot> <Nemokosch#9980> m: my @a = 1, 2; my @b = 3,4; (@a, @b) = (@b, @a); dd @a; dd @b;

[12:52] <discord-raku-bot> <Nemokosch#9980> here you go

[12:52] <lizmat> m: my @a = 1, 2; my @b = 3,4; (@a, @b) = (@b, @a); dd @a; dd @b;

[12:52] <camelia> rakudo-moar d7152ea59: OUTPUT: «Array @a = ((my @Array_17078280) = [[], @Array_17078280])␤Array @b = []␤»

[12:54] <lizmat> it basically boils down to:

[12:54] <lizmat> m: my @a; my $b; (@a, $b) = 1,2,3; dd @a, $b

[12:54] <camelia> rakudo-moar d7152ea59: OUTPUT: «Array @a = [1, 2, 3]␤Any $b = Any␤»

[12:54] <lizmat> when should the assignment to @a stop ?

[12:55] <lizmat> m: my @a; my $b; (@a, $b) = (1,2,3),4; dd @a, $b

[12:55] <camelia> rakudo-moar d7152ea59: OUTPUT: «Array @a = [(1, 2, 3), 4]␤Any $b = Any␤»

[13:06] <discord-raku-bot> <Nemokosch#9980> @a shouldn't be slurpy whatsoever

[13:06] <discord-raku-bot> <Nemokosch#9980> as it indeed isn't when (@a, $b) is on the right handside

[13:13] <lizmat> but how would it know when to stop ?

[13:13] <lizmat> m: my @a; my $b; (@a, $b) = $(1,2,3),4; dd @a, $b

[13:13] <camelia> rakudo-moar d7152ea59: OUTPUT: «Array @a = [(1, 2, 3), 4]␤Any $b = Any␤»

[13:14] <lizmat> one could maybe argue that that should DWIM, but that's getting very magic indeed

[13:16] <discord-raku-bot> <Nemokosch#9980> it would stop after the first element

[13:16] <discord-raku-bot> <Nemokosch#9980> which in this case would be a list

[13:17] <discord-raku-bot> <Nemokosch#9980> or array, doesn't matter - a positional

[13:18] <discord-raku-bot> <Nemokosch#9980> @a shouldn't have to act differently on the left hand side

[13:18] <discord-raku-bot> <Nemokosch#9980> if it doesn't make the surrounding parens collapse on the rhs, it shouldn't on the rhs either

[13:18] <discord-raku-bot> <Nemokosch#9980> the inconsistency is the main problem, not the collapsing

[13:18] <discord-raku-bot> <Nemokosch#9980> even though the collapsing really doesn't seem to make sense in particular

[13:19] <lizmat> well, I suggest you make a problem-solving issue for that: I'm afraid such a change would at least require a language level boundary

[13:20] <discord-raku-bot> <Nemokosch#9980> if there is no easy-to-spot rationale behind this asymmetry, this is a serious enough anomaly to be issued

[13:31] <discord-raku-bot> <Hydrazer#4827> is there a better way to have a default value for first? ```pl

[13:31] <discord-raku-bot> <Hydrazer#4827> my $num = [1,2,3,4,0].first(* < 1);

[13:31] <discord-raku-bot> <Hydrazer#4827> say $num ~~ Int ?? $num !! -69;

[13:31] <discord-raku-bot> <Hydrazer#4827> ```

[13:33] <lizmat> m: .say with  [1,2,3,4,0].first(* < 1)

[13:33] <camelia> rakudo-moar d7152ea59: OUTPUT: «0␤»

[13:33] <lizmat> fwiw, with / without were specifically invented to handle cases where something could validly return 0

[13:34] <discord-raku-bot> <Hydrazer#4827> hm yeah that is nice

[13:37] <discord-raku-bot> <Hydrazer#4827> m: say with Nil

[13:37] <discord-raku-bot> <Hydrazer#4827> m:```

[13:37] <discord-raku-bot> <Hydrazer#4827> say with Nil

[13:37] <discord-raku-bot> <Hydrazer#4827> ```

[13:37] <discord-raku-bot> <Hydrazer#4827> m: ```

[13:37] <discord-raku-bot> <Hydrazer#4827> say with Nil

[13:37] <discord-raku-bot> <Hydrazer#4827> ```

[13:37] <discord-raku-bot> <Nemokosch#9980> // is nice 🙂

[13:45] <discord-raku-bot> <Hydrazer#4827> interesting

[14:34] <discord-raku-bot> <Nemokosch#9980> Can I stack statement modifiers somehow?

[14:34] <discord-raku-bot> <Nemokosch#9980> I'm thinking of something like

[14:34] <discord-raku-bot> <Nemokosch#9980> m: dd (.words[0] for ^5);

[14:35] <discord-raku-bot> <Nemokosch#9980> this works

[14:35] <discord-raku-bot> <Nemokosch#9980> m: dd (.words[0] with 'ioj oiJOIjoij oij ');

[14:35] <discord-raku-bot> <Nemokosch#9980> this also works

[14:35] <discord-raku-bot> <Nemokosch#9980> m: dd (.words[0] with 'ioj oiJOIjoij oij ' for ^5);

[14:35] <discord-raku-bot> <Nemokosch#9980> this doesn't seem to do what I want

[14:35] <discord-raku-bot> <Nemokosch#9980> m: dd (.words[0] for ^5 with 'ioj oiJOIjoij oij ');

[14:37] <discord-raku-bot> <Nemokosch#9980> this doesn't work at all

[15:05] <discord-raku-bot> <Nemokosch#9980> another thing with list comprehensions

[15:05] <discord-raku-bot> <Nemokosch#9980> say I have an open file

[15:05] <discord-raku-bot> <Nemokosch#9980> ```perl

[15:05] <discord-raku-bot> <Nemokosch#9980> dd ($file.get until $file.eof)

[15:05] <discord-raku-bot> <Nemokosch#9980> ```

[15:05] <discord-raku-bot> <Nemokosch#9980> works alright

[15:06] <discord-raku-bot> <Nemokosch#9980> ```perl

[15:06] <discord-raku-bot> <Nemokosch#9980> dd ({$file.get} until $file.eof)

[15:06] <discord-raku-bot> <Nemokosch#9980> ```

[15:06] <discord-raku-bot> <Nemokosch#9980> is an infinite loop

[15:08] <discord-raku-bot> <Nemokosch#9980> the function doesn't seem to get called

[18:00] <discord-raku-bot> <Xueji#0156> Hello, could anyone explain something about types in raku to me? Let's look at this piece of code:

[18:00] <discord-raku-bot> <Xueji#0156> ```

[18:00] <discord-raku-bot> <Xueji#0156> sub hokus-pokus(Bool %pokus, Str $item --> Bool) {

[18:00] <discord-raku-bot> <Xueji#0156>     return %pokus{$item}:exists;

[18:00] <discord-raku-bot> <Xueji#0156> }

[18:00] <discord-raku-bot> <Xueji#0156> my SetHash[Str] $pokus = SetHash[Str].new: "1,2,3,4,5,6,7,8,9,10".split(',', :skip-empty).List;

[18:00] <discord-raku-bot> <Xueji#0156> my Bool %another = $pokus;

[18:00] <discord-raku-bot> <Xueji#0156> say hokus-pokus($pokus, "1");

[18:00] <discord-raku-bot> <Xueji#0156> ```

[18:00] <discord-raku-bot> <Xueji#0156> If I try to run it, I get this error: `Calling hokus-pokus(SetHash[Str], Str) will never work with declared signature (Bool %pokus, Str $item --> Bool)`. Why can I assign $pokus to %another, but not call a function hokus-pokus($pokus)?

[18:41] *** riffraff18 left
[18:41] *** riffraff18 joined
[18:45] <discord-raku-bot> <Nemokosch#9980> m: sub hokus-pokus(Bool %pokus, Str $item --> Bool) {    return %pokus{$item}:exists; } my SetHash[Str] $pokus = SetHash[Str].new: "1,2,3,4,5,6,7,8,9,10".split(',', :skip-empty).List; my Bool %another = $pokus; dd %another; dd $pokus;

[18:45] <discord-raku-bot> <Nemokosch#9980> oops

[18:47] <discord-raku-bot> <Nemokosch#9980> m: sub hokus-pokus(Bool %pokus, Str $item --> Bool) {    return %pokus{$item}:exists; }; my SetHash[Str] $pokus = SetHash[Str].new: "1,2,3,4,5,6,7,8,9,10".split(',', :skip-empty).List; my Bool %another = $pokus; dd %another; dd $pokus;

[18:49] <discord-raku-bot> <Nemokosch#9980> If I were to guess, signatures don't make conversions per se

[18:49] *** riffraff18 left
[18:49] *** riffraff18 joined
[19:40] <discord-raku-bot> <Morfent#9811> m: Metamodel::Primitives.is_type: Positional[Bool], SetHash[Str]

[19:40] <discord-raku-bot> <Morfent#9811> er

[19:40] <discord-raku-bot> <Morfent#9811> m: say Metamodel::Primitives.is_type: Positional[Bool], SetHash[Str]

[19:41] <discord-raku-bot> <Morfent#9811> me doing the right type would help

[19:41] <discord-raku-bot> <Morfent#9811> m: say Metamodel::Primitives.is_type: Associative[Bool], SetHash[Str]

[19:41] <discord-raku-bot> <Morfent#9811> m: say Metamodel::Primitives.is_type: Associative[Str], SetHash[Str]

[19:42] <discord-raku-bot> <Morfent#9811> m: say Metamodel::Primitives.is_type: Associative, SetHash[Str]

[19:49] <discord-raku-bot> <Morfent#9811> oh

[19:49] <discord-raku-bot> <Morfent#9811> m:```

[19:49] <discord-raku-bot> <Morfent#9811> sub hokus-pokus(Bool %pokus, Str $item --> Bool) {

[19:49] <discord-raku-bot> <Morfent#9811>     return %pokus{$item}:exists;

[19:49] <discord-raku-bot> <Morfent#9811> }

[19:49] <discord-raku-bot> <Morfent#9811> my SetHash[Str] $pokus = SetHash[Str].new: "1,2,3,4,5,6,7,8,9,10".split(',', :skip-empty).List;

[19:49] <discord-raku-bot> <Morfent#9811> my Bool %another = $pokus;

[19:49] <discord-raku-bot> <Morfent#9811> INIT say %another;

[19:49] <discord-raku-bot> <Morfent#9811> say hokus-pokus($pokus, "1");

[19:49] <discord-raku-bot> <Morfent#9811> ```

[19:49] <discord-raku-bot> <Morfent#9811> no worries, the compiler's being smart here

[19:53] <discord-raku-bot> <Morfent#9811> however...

[19:54] *** parv joined
[20:01] <discord-raku-bot> <Morfent#9811> m: .^name.say for SetHash[Str].^mro;

[20:02] <discord-raku-bot> <Morfent#9811> m: .^name.say for SetHash[Str].^mro(:roles);

[20:02] <discord-raku-bot> <Morfent#9811> i'd expect it to be an `Associative[Bool:D, Str]`

[20:06] <discord-raku-bot> <Morfent#9811> this'll typecheck:

[20:06] <discord-raku-bot> <Morfent#9811> m:```

[20:06] <discord-raku-bot> <Morfent#9811> sub hokus-pokus(Bool %pokus, Str $item --> Bool) {

[20:06] <discord-raku-bot> <Morfent#9811>     return %pokus{$item}:exists;

[20:06] <discord-raku-bot> <Morfent#9811> }

[20:06] <discord-raku-bot> <Morfent#9811> my SetHash[Str] $pokus = SetHash[Str].new: "1,2,3,4,5,6,7,8,9,10".split(',', :skip-empty).List;

[20:06] <discord-raku-bot> <Morfent#9811> my Bool() %another = $pokus;

[20:06] <discord-raku-bot> <Morfent#9811> say hokus-pokus(%another, "1");

[20:06] <discord-raku-bot> <Morfent#9811> ```

[20:07] <discord-raku-bot> <Morfent#9811> dropping `Bool()` for `Bool` should also work

[20:09] <discord-raku-bot> <Nemokosch#9980> oh right

[20:09] <discord-raku-bot> <Nemokosch#9980> the coercion

[20:20] *** riffraff18 left
[20:20] *** riffraff18 joined
[20:21] <discord-raku-bot> <Xueji#0156> Okay, I think I got it. Thanks.

[20:26] *** riffraff18 left
[20:46] *** riffraff18 joined
[21:42] *** riffraff18 left
[22:34] *** parv left
