🦋 Welcome to the MAIN() IRC channel of the Raku Programming Language (raku.org). This channel is logged for the purpose of keeping a history about its development | evalbot usage: 'm: say 3;' or /msg camelia m: ... | Log inspection is getting closer to beta. If you're a beginner, you can also check out the #raku-beginner channel!
Set by lizmat on 25 August 2021.
japhb Doc_Holliwould: your multi isn't in the scope of the definition of sort. 00:00
You can fake it by using a 2-arg function for sort, rather than a 1-arg, which is implicitly using the *builtin* cmp.
lizmat notable6: weekly 09:51
notable6 lizmat, 2 notes: 2021-10-28T12:19:14Z <lizmat>: www.reddit.com/r/rakulang/ we have just passed the 1000 Rakoons mark! ; 2021-10-31T23:33:34Z <melezhik>: weekly update for Raku on #mybfio - mybf.io/?language=Raku&filter=top
lizmat notable6: weekly reset 11:28
notable6 lizmat, Moved existing notes to “weekly_2021-11-01T11:28:38Z”
[Coke] Hope folks had a pleasant Halloween. 11:30
lizmat oh, is that what that was? :-)
lizmat just assumed Covid19 had turned ugly :-)
Altreus how do you think it started? :D
Anton Antonov If you want to generate lists with random pet names or random bullshit job titles please take a look at the package `Data::Generators` . github.com/antononcube/Raku-Data-Generators 12:33
Skarsnik Hello there ^^ 13:25
Skarsnik m:sub piko {react whenever Promise.in(1) { return 42;}}; piko(); 13:27
evalable6 (exit code 1) MoarVM panic: Internal error: Unwound entire stack and missed handler
Skarsnik Today, in "Skarsnik does some Raku and find a new bug" xD 13:28
lizmat And yet another Rakudo Weekly news hits the Net: rakudoweekly.blog/2021/11/01/2021-...0-rakoons/ 13:37
Skarsnik Nice :) 13:42
Skarsnik Hm, I am trying to send request to a UPD server, it seems my second attempt at using print-to fail and prevent me from getting the reply 14:03
It's my second attempt at reading the data that fail, not sure why :( 14:07
timo well, with udp you never know! :D 14:09
Skarsnik code is like sub write-socket ($towrite) {await $socket.print-to("127.0.0.1", 55355, $towrite);} 14:10
sub read-socket {my $toret; 14:11
react whenever $socket.Supply -> $data { $toret = $data;
done();}
return $toret;}
read-socket fails the second time (Yes I don't need a async api x)) 14:12
ugexe seems a bit odd that $socket would be a global variable, no?
Skarsnik Died because of the exception: 14:13
connection already in progress
timo hm, getting the supply twice, huh?
i assume requesting the supply is what turns listening on
Skarsnik it's just a dumb script to poke at RetroArch udp api
timo perhaps you can't get .Supply a second time as fast unless you SO_REUSEADDR 14:14
ugexe sure, but your computer only cares about logic not if its just a dumb script
timo i'd really just grab $socket.Supply.Channel early and use that
Skarsnik Ok that worked, thank timo :) 14:19
Skarsnik How could I replace .raku On Buf/Blob to print Hex value and not Int? 14:24
timo m: Buf.new(1, 2, 10, 20, 90, 91, 92).format("%x").say 14:25
camelia No such method 'format' for invocant of type 'Buf'
in block <unit> at <tmp> line 1
timo m: Buf.new(1, 2, 10, 20, 90, 91, 92).list.format("%x").say
camelia No such method 'format' for invocant of type 'List'
in block <unit> at <tmp> line 1
timo oh?
ah
m: Buf.new(1, 2, 10, 20, 90, 91, 92).fmt("%x").say
camelia No such method 'fmt' for invocant of type 'Buf'
in block <unit> at <tmp> line 1
timo m: Buf.new(1, 2, 10, 20, 90, 91, 92).list.fmt("%x").say
camelia 1 2 a 14 5a 5b 5c
timo m: Buf.new(1, 2, 10, 20, 90, 91, 92).list.fmt("%02x", ",").say
camelia 01,02,0a,14,5a,5b,5c
japhb Those buffer contents are giving me flashbacks of the last week's work (parsing ANSI control code schemes) 14:31
Skarsnik damn, no method to search a buffer in another one x) 14:52
melezhik how can I check that an array includes another array? 19:00
ugexe m: my @a = 1,2,3,4,5,6; my @b = 2,3,4; say @a.rotor(@b.elems => -(@b.elems - 1)).grep(* ~~ @b) 19:06
camelia ((2 3 4))
melezhik m: say (1,2,5).contains([1,2]) 19:09
camelia Calling '.contains' on a List, did you mean 'needle (elem) list'?
True
in block <unit> at <tmp> line 1
ugexe i dont think that does what you want 19:10
melezhik m: say (1,2).contains([1,2,5]) 19:11
camelia Calling '.contains' on a List, did you mean 'needle (elem) list'?
False
in block <unit> at <tmp> line 1
melezhik ugexe why?
ugexe maybe it does... i thought .contains stringified lists
m: my @a = 1,2,3; say @a.contains("1 2") 19:12
camelia Calling '.contains' on a Array, did you mean 'needle (elem) list'?
True
in block <unit> at <tmp> line 1
ugexe that probably isnt the behavior you desire
melezhik what do you mean ? warnings?
ugexe well do you expect @a = 1,2,3 to contains "1 2"? 19:13
tonyo m: my @a = 1,2; say "1 2".contains(@a)
camelia True
tonyo m: my $a = (1,2); say "1 25".contains($a)
camelia True
melezhik yeah, but I need check for arrays ... 19:15
ugexe yes, that is why we are telling you .contains doesnt work 19:16
melezhik ok
ugexe m: my @a = 1,2,3,4,5,6; my @b = 2,3,4; say @a.rotor(@b.elems => -(@b.elems - 1)).grep(* ~~ @b)
camelia ((2 3 4))
melezhik so the only way is the code you've shared before?
MasterDuke m: my @a = 1,2,3,4,5,6; my @b = 2,3,4; say @b (elem) @a.rotor(@b.elems => -(@b.elems - 1)) # i'm sort of surprised this doesn't work 19:19
camelia False
ugexe i mean you could use (&) but i assume you want the items in the same sequence 19:20
i.e. 1,2,3 doesnt match 1,2,9,3
melezhik ah , no, I mean I don't need to take an order into account for this ... 19:21
MasterDuke m: my @a = 1,2,"c",4,5,6; my @b = "c",8; say so all(@b.map(* (elem) @a)); my @c = "c",6; say so all(@c.map(* (elem) @a)); 19:26
camelia False
True
tonyo my $arr = [1,2,3]; my $search = [1,2]; say [&&] |([||] $arr.map(* == $_) for $search); 19:30
evalable6 True
tonyo if you don't care about order
m: my $arr = [1,2,3]; my $search = [1,2,4]; say [&&] |([||] $arr.map(* == $_) for $search); 19:31
camelia True
tonyo oops.
something like that
m: my $arr = [1,2,3]; my $search = [1,2,4]; say [&&] ([||] $arr.map(* == $_) for |$search); 19:34
camelia False
tonyo m: my $arr = [1,2,3]; my $search = [1,2]; say [&&] ([||] $arr.map(* == $_) for |$search);
camelia True
AntonOks hi dev's. who has commit and the like right on github.com/rakudo/star? 19:45
AntonOks it would be great if someone looks into github.com/rakudo/star/pull/167 19:45
AntonOks any feedback for that pull is highly appreciated... 19:45
Geth doc: cddc09f799 | (Stoned Elipot)++ | doc/Language/operators.pod6
Document U+2A75 and U+2A76 operator aliases

ref #3922
20:12
linkable6 Link: docs.raku.org/language/operators
melezhik . 20:31
I have created devops weekly on top of mybfio projects and added on Raku project there, feel free to add your project if you consider them devops related - www.reddit.com/r/devops/comments/q...on_mybfio/ 20:32
there is only one there right now
tonyo .tell melezhik not sure you saw this for array in array - `my $arr = [1,2,3]; my $search = [1,2,4]; say [&&] ([||] $arr.map(* == $_) for |$search);` 21:06
tellable6 tonyo, I'll pass your message to melezhik
tonyo could even be shortened to `my $arr = (1,2,3); my $search = (1,2); say [&&] ([||] $_ ∈ $arr for |$search);` 21:09
melezhik . 22:28
tellable6 2021-11-01T21:06:45Z #raku <tonyo> melezhik not sure you saw this for array in array - `my $arr = [1,2,3]; my $search = [1,2,4]; say [&&] ([||] $arr.map(* == $_) for |$search);`
melezhik .tell tonyo: - thanks
tellable6 melezhik, I'll pass your message to tonyo
tonyo if you care about ordering then use a loop 22:57
tellable6 2021-11-01T22:28:48Z #raku <melezhik> tonyo: - thanks