🦋 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: ... | Logs can be inspected at colabti.org/irclogger/irclogger_log/raku
Set by lizmat on 21 April 2021.
japhb (While TinyFloats also supports *EN*coding, I'm not using that in CBOR::Simple yet, because it would probably slow encoding num arrays quite a bit. Correctly encoding binary16 is non-trivial. :-/ ) 00:00
moon-child japhb: signed nan doesn't work on windows? 00:23
japhb moon-child: Windows defaults NaN's representation to the opposite sign bit as everyone else, but the sign bit for NaN is explictly supposed to be ignored, so I just squash it to be the same everywhere to get byte-equivalent encodings everywhere. 00:28
moon-child ahhh
Xliff \o 03:24
tellable6 2021-04-23T06:31:23Z #raku <El_Che> Xliff: is your network faster than your disk?
neshpion i wish 03:25
Xliff .tell El_Che I doubt it. Why do you ask? 03:26
tellable6 Xliff, I'll pass your message to El_Che
Xliff Can someone illustrate the best way to append elements from one array to another in nqp?
Would something like this work? pastebin.com/4vbyLJpH 03:37
tonyo how do you mean? just a push or a flattening push? 03:45
Xliff Just a push 03:59
Actually, no. A flatenning push.
My bad.
ToddAndMargo Hi All,  How do I put a literal in a regex?    `$JsonAddr ~~ s| Q[⏏;] .* ||;` 06:03
I am trying to match on a semicolon 06:04
CIAvash ';'? 06:05
ToddAndMargo yes 06:06
g="rumble.com",b="/embedJS/u3";f.l=d(...rorHandler 06:07
I am trying to dump everything after and including the semicolon
$JsonAddr ~~ s| "\⏏x" .* ||; 06:09
moon-child S/.*(';'.*)/\1/ 06:13
ToddAndMargo I missed the ().  Thank you! 06:16
Xliff Can someone illustrate the best way to append elements from one array to another in nqp?
Would something like this work? pastebin.com/4vbyLJpH
b2gills Xliff: token string { <q> {} ~ $<q> [.*?] } # Note that {} is necessary to update $/. Also I did a bunch of more work to match all of the [#define] at: replit.com/@BradGilbert/MobileBeneficialPixels 06:27
Xliff And... that link can't be loaded ATM. Oh. There it is. Thanks, B2gills! 06:28
elcaro 06:49
lizmat clickbaits and another Rakudo Weekly News hits the Net: rakudoweekly.blog/2021/04/26/2021-...leastable/ 09:13
Xliff Can someone illustrate the best way to append elements from one array to another in nqp? 10:27
Would something like this work? pastebin.com/4vbyLJpH
lizmat github.com/Raku/nqp/blob/master/do...own#splice 10:31
make sure $count is zero
Xliff ^^
Xliff lizmat: So in the above pastebin, that change might look like this? 10:34
@named := nqp::splice(@named, nqp::decont($also.Array), nqp::elems(@named), 0) 10:36
m: use nqp; my @a := (1, 2, 3); my @also := <a b c>; @named := nqp::splice(@named, @also), nqp::elems(@named), 0); @named.gist.sau 10:37
camelia 5===SORRY!5=== Error while compiling <tmp>
Variable '@named' is not declared
at <tmp>:1
------> 3y @a := (1, 2, 3); my @also := <a b c>; 7⏏5@named := nqp::splice(@named, @also), nq
Xliff m: use nqp; my @a := (1, 2, 3); my @also := <a b c>; @named := nqp::splice(@named, @also), nqp::elems(@named), 0); @named.gist.sau
camelia 5===SORRY!5=== Error while compiling <tmp>
Variable '@named' is not declared
at <tmp>:1
------> 3y @a := (1, 2, 3); my @also := <a b c>; 7⏏5@named := nqp::splice(@named, @also), nq
Xliff m: use nqp; my @a := (1, 2, 3); my @also := <a b c>; @named := nqp::splice(@named, @also), nqp::elems(@named), 0); @named.gist.say
camelia 5===SORRY!5=== Error while compiling <tmp>
Variable '@named' is not declared
at <tmp>:1
------> 3y @a := (1, 2, 3); my @also := <a b c>; 7⏏5@named := nqp::splice(@named, @also), nq
Xliff m: use nqp; my @named := (1, 2, 3); my @also := <a b c>; @named := nqp::splice(@named, @also), nqp::elems(@named), 0); @named.gist.say 10:38
camelia 5===SORRY!5=== Error while compiling <tmp>
Unexpected closing bracket
at <tmp>:1
------> 3ce(@named, @also), nqp::elems(@named), 07⏏5); @named.gist.say
Xliff m: use nqp; my @named := (1, 2, 3); my @also := <a b c>; @named := nqp::splice(@named, @also, nqp::elems(@named), 0); @named.gst.say
camelia This type (List) does not support elems
in block <unit> at <tmp> line 1
Xliff Huh.
Xliff m: use nqp; my @named := 1, 2, 3; my @also := <a b c>; @named := nqp::splice(@named, @also), nqp::elems(@named), 0); @named.gist.say 10:40
camelia 5===SORRY!5=== Error while compiling <tmp>
Unexpected closing bracket
at <tmp>:1
------> 3ce(@named, @also), nqp::elems(@named), 07⏏5); @named.gist.say
Xliff m: use nqp; my @named := 1, 2, 3; say nqp::elems(@named) 10:41
camelia This type (List) does not support elems
in block <unit> at <tmp> line 1
Xliff lizmat: Why this error?
lizmat @names is a HLL List
*@named 10:42
use nqp; my @named := nqp::list(1, 2, 3); say nqp::elems(@named)
m: use nqp; my @named := nqp::list(1, 2, 3); say nqp::elems(@named)
camelia Type check failed in binding; expected Positional but got List ((1, 2, 3))
in block <unit> at <tmp> line 1
lizmat m: use nqp; my $named := nqp::list(1, 2, 3); say nqp::elems($named)
camelia 3
lizmat when using nqp in Raku, probably best to stick to $ sigils 10:43
Xliff lizmat++
lizmat: Thanks much. So what would be the nqp equivalent of .gist? 10:47
lizmat there is none
.gist is a HLL concept 10:48
Xliff Best way to output an array, then?
lizmat if it is a nqp::list, use dd
m: dd nqp::list(1,2,3)
camelia 5===SORRY!5=== Error while compiling <tmp>
Could not find nqp::list, did you forget 'use nqp;' ?
at <tmp>:1
------> 3dd nqp::list(1,2,3)7⏏5<EOL>
lizmat m: use nqp; dd nqp::list(1,2,3)
camelia (1, 2, 3)
Xliff dd works!
lizmat in general, dd is capable of handling several primitive types 10:49
gfldex lolibloggedalittle: gfldex.wordpress.com/2021/04/27/th...-a-riddle/
Xliff gfldex: Nice article. Still made my head hurt. 10:51
Are you saying that... in this case, since NotNil is Nil's child, Nil's .new will always override? 10:52
m: class NotNil is Nil {}; say NotNil.new.^name 10:53
camelia Nil
Xliff Ouch. Is there any way to know ahead of time which classes will cause this behavior?
Xliff makes mental note to never subclass Nil. 10:54
m: class NotNil is Nil { method new { self.CREATE }; }; say NotNil.new.^name
camelia NotNil
Xliff That took a long time.
m: class NotNil is Nil { method new { self.CREATE }; }; say NotNil.new.^name
camelia NotNil
Xliff That time not-so-much.
gfldex Xliff: I don't think Nil actually needs that short cut. We never really instanciate Nil. 10:59
lizmat github.com/rakudo/star/releases/tag/2021.04 12:02
tyil++
tyil :>
sena_kun tyil++ 12:16
El_Che++
Altreus now also including *buntu 21.04 # is this censorship or fuzzy matching? 12:17
tyil Altreus: *buntu is generally done to refer to Ubuntu and derivates, such as Kubuntu or Xubuntu
Altreus aha 12:21
And mint
:)
El_Che hi sena_kun 13:02
tellable6 2021-04-27T03:26:06Z #raku <Xliff> El_Che I doubt it. Why do you ask?
sena_kun El_Che, hey hey. Can I be of any help or you are being polite responding to my praise for the new release packaging? :) 13:03
El_Che I was yesterday's day old when I discovered sena_kun and Avatar
Altai-man
wwere the same person :)
sena_kun ah, well, that's me. :) 13:04
sorry for the confusion
El_Che I probably talked to you "both" on different occasions without realizing that
:)
sena_kun El_Che, I don't remember you being impolite in any way so far, so I guess you are a nice person disregarding if I'm sena_kun or Altai-man. :) 13:05
El_Che good, you never know :) 13:06
andinus m: say (4, 6, 5).sort eqv (4, 5,6) 13:42
camelia False
andinus why is this false ^?
m: say (4, 5,6) eqv (4,5,6)
camelia True
vrurg m: say (4, 6, 5).sort.WHICH 13:49
camelia Seq|84289712
vrurg m: say (4, 5,6).WHICH
camelia List|57238480
vrurg andinus: That's why. 13:50
andinus i see, looks like ~~ does what i want 13:51
masak my secret shame: I couldn't tell you what a Seq was if my lunch depended on it
vrurg andinus: that's what you need most of the time.
vrurg m: say (4, 6, 5).sort.List eqv (4, 5,6) 13:52
camelia True
andinus so i have a list of 3 numbers, and there are several cases i need to match against 13:52
the list is sorted
case #1: 4, 5, 6 ;; case #2: all same digits ;; case #3: 2 same digits 13:53
is there a better way to handle #2 & #3 other than just writing if/elsif for each possible combination?
vrurg andinus: you mean matching (4,5,6) and (5,6,4), for example? 13:55
I'd guess sorting both and eqv the result is the best. 13:56
andinus no, matching (x, x, y) ;; matching (x, x, x) where x can be any integer 13:57
vrurg andinus: sorry, still don't get what exactly you need. So, you have (4,5,6) and (6,6,5). Is it a match? 13:59
andinus no, i just need to match for cases. something like: if @rolls ~~ (** all same digits **) 14:00
andinus ** all same digits ** should match (1, 1, 1), (2,2,2) and so on.. 14:00
andinus i'm trying to write www.netexl.com/howtoplay/cee-lo/ in raku 14:01
vrurg m: say bag(4,4,9)
camelia Bag(4(2) 9)
vrurg m: say set(4,4,9).elems 14:02
camelia 2
vrurg m: say set(4,4,4).elems
camelia 1
andinus oh thanks, i could make it work with set and bags 14:03
vrurg andinus: you may also consult with docs.raku.org/language/operators as you may need things like intersections, differences, etc. 14:05
andinus i see, thanks 14:07
tyil lizmat: you around? 14:08
lizmat about to leave for a few hours 14:14
tyil ^^
tyil ah
enjoy the sun, then :D
lizmat well, if I can do something quickly for you, I will :) 14:15
tyil I wanted to ask you to re-send a github event that is usually handed over to geth
lizmat ok, which one ?
tyil I want to see how much I've just broken
any should work
wait, rakudo/star is also set up for this, I can test this myself 14:16
lizmat I've just resent one
tyil alright, I have some more work to do I see :'D 14:17
thanks!
lizmat yw
tyil now go out and enjoy the weather :>
lizmat afk for a few hours&
I will!
andinus say i have a bag(x, x, y) and want "y", is there a good way to get it? x, y are integers 14:24
m: bag(1, 3, 3)
camelia WARNINGS for <tmp>:
Useless use of "bag(1, 3, 3)" in expression "bag(1, 3, 3)" in sink context (line 1)
andinus # need 1 here
m: say bag(1, 1, 2) 14:25
camelia Bag(1(2) 2)
andinus # need 2 here 14:25
andinus m: say bag(1, 1, 3){1} 14:26
camelia 2
andinus something better than just looping over 1, 2, 3 and finding out what has been repeated only once? 14:29
grimler32 Evil People Messed with my LIFE! Are there any universe editors here with access to the 4 bit 3 dimensional god code at the multiverse level?? 14:42
gfldex m : say bag(1,1,2).repeated 14:45
m: say bag(1,1,2).repeated
camelia ()
gfldex m: say bag(1,1,2).list.sort.repeated
camelia ()
gfldex m: say bag(1,1,2).list.grep(*.value > 1)».key; 14:50
camelia (1)
gfldex andinus: like so ^^^ ? 14:51
andinus hmm that does what i want, thanks 14:57
Altreus grimler32: r/fifthworldproblems
Xliff Is there a setlocale() analog for Raku? 15:26
dakkar Xliff: the C function? what are you trying to accomplish? 15:50
m: use NativeCall;sub setlocale(int32 $category,Str $locale --> Str) is native {*};say setlocale(6,"") 15:54
camelia LC_CTYPE=en_US.UTF-8;LC_NUMERIC=C;LC_TIME=C;LC_COLLATE=C;LC_MONETARY=C;LC_MESSAGES=C;LC_PAPER=C;LC_NAME=C;LC_ADDRESS=C;LC_TELEPHONE=C;LC_MEASUREMENT=C;LC_IDENTIFICATION=C
dakkar (6 is LC_ALL on my machine, it seems to be LC_CTYPE on that one) 15:55
m: use NativeCall;sub setlocale(int32 $category,Str $locale --> Str) is native {*};say setlocale(1,"")
camelia C
dakkar m: use NativeCall;sub setlocale(int32 $category,Str $locale --> Str) is native {*};say setlocale(2,"")
camelia C
dakkar (ah, the joy of C macros used as enums…)
Xliff use NativeCall;sub setlocale(int32 $category,Str $locale --> Str) is native {*};say setlocale(9,"") 18:30
m: use NativeCall;sub setlocale(int32 $category,Str $locale --> Str) is native {*};say setlocale(9,"")
camelia C
Xliff dakkar: ^^ That, but in a way that will work for different environments.
tellable6 Xliff, I'll pass your message to dakkar
Xliff Unfortunately, I think this may be another one of those things that has to be compiled into a helper lib because macros are not accessible by NativeCall without cheats. 18:31
tonyo what are you doing that you want to modify the user's environment? 18:32
Geth doc/supply-batch-ms-3744: 9fc243e169 | (Stoned Elipot)++ | doc/Type/Supply.pod6
Note ms granularity for Supply.batch ref #3744
21:47
doc: stoned++ created pull request #3878:
Note ms granularity for Supply.batch ref #3744
21:48