🦋 Welcome to Raku! raku.org/ | evalbot usage: 'p6: say 3;' or /msg camelia p6: ... | irclog: colabti.org/irclogger/irclogger_log/raku
Set by ChanServ on 14 October 2019.
00:08 caterfxo left 00:10 caterfxo joined 00:20 Doc_Holliwould left 00:21 markoong left 00:37 AlexDani` joined 00:39 AlexDaniel left 00:43 rbt is now known as rbtca 00:51 rbtca left, rbt joined 00:52 rbt left, rbtca joined 00:53 rbtca left, rbtca joined 00:59 lichtkind left 01:03 molaf joined 01:23 aborazmeh left 01:43 k-man left 01:46 NODE left 01:48 molaf left 01:49 k-man joined, NODE joined 02:00 molaf joined 02:10 hungrydonkey left 02:34 mowcat left 02:45 cpan-raku left, cpan-raku joined, cpan-raku left, cpan-raku joined 02:55 hungrydonkey joined 03:09 TeamBlast left 03:10 rbtca left 03:11 rbtca joined 03:16 TeamBlast joined 03:32 hungrydonkey left 03:43 hungrydonkey joined 03:52 hungrydonkey left, hungrydonkey joined 04:13 pilne left 04:28 hungrydonkey left, hungrydonkey joined 04:37 poohman joined 04:52 PacoLinux left 05:20 Doc_Holliwould joined 05:30 hungrydonkey left 05:37 hungrydonkey joined 05:40 sauvin joined 05:50 hungryd36 joined 05:51 hungrydonkey left 06:05 poohman left 06:16 wamba joined 06:35 xinming_ left 06:36 xinming_ joined 06:43 poohman joined 06:46 PacoLinux joined 06:48 benlittle left 07:01 benlittle joined 07:03 hungryd36 left 07:07 Doc_Holliwood joined 07:10 xinming_ left, xinming_ joined 07:15 poohman left 07:16 hungrydonkey joined 07:20 hungrydonkey left 07:28 markoong joined 07:32 xinming_ left, xinming_ joined 07:36 hungrydonkey joined 07:45 ttkp6 joined, ttkp6 left, markong joined 07:46 rindolf joined 07:48 hungrydonkey left 07:49 markoong left 07:50 markoong joined 07:51 markong left 08:03 molaf left 08:39 molaf joined 08:43 wamba left 08:49 poohman joined 09:07 rindolf left 09:08 poohman left 09:12 rindolf joined, Altai-man_ joined 09:22 sena_kun joined, lgtaube left 09:23 lgtaube1 joined, Altai-man_ left 09:30 lgtaube1 is now known as lgtaube 09:37 angelds joined 09:56 girafe left 09:57 hacktor left 09:59 aborazmeh joined, aborazmeh left, aborazmeh joined 10:06 girafe joined 10:08 natrys joined 10:17 Doc_Holliwould left, Doc_Holliwood left, Doc_Holliwood joined, Doc_Holliwould joined 10:28 regreg joined
tbrowder hi, #raku 10:40
10:42 wamba joined
tbrowder just learned the value of routine "clone" after spending WAAAy too much time debugging a class that i couldn't add a hash to its rows attr without the hash losing its contents. 10:43
color me stupid for that not being a clue but i have never used clone before and i only remembered it by searching for "raku deep copy" and up popped words about damian and perl and "clone" and bingo! case solved. whew! 10:46
lizmat :-)
tbrowder all along i thought raku would just handle it cause every thing is an object, and simple cases all worked ok which lulled me into false sense of security. 10:49
morning, lizmat! why doesn't raku automatically do the clone?
lizmat could you show the code that lulled you into a false sense of security ? 10:50
10:50 rbtca left 10:51 rbtca joined
tbrowder yes, it will take a while, a few errands to do after this strenuos exercise. the effort is to help me in tax prep taking a csv file from a finance record dump and rewriting into proper form for irs and accountant. should be relatively simple, but was i wrong--alice and the rabbit hole... 10:54
lizmat ;-(
tbrowder be back in a while...bye
oh, i am using tony-o' CSV::Parser which works fine after i learned how to work with it (i need to study his tux slang info...) 10:56
11:00 aborazmeh left 11:14 Doc_Holliwould left, Doc_Holliwood left 11:15 Doc_Holliwould joined, Doc_Holliwood joined 11:20 angelds left, m_athias2 left 11:21 Altai-man_ joined 11:23 sena_kun left 11:25 chloekek joined 11:28 lichtkind joined 11:29 m_athias joined 11:35 Xliff joined, AlexDani` is now known as AlexDaniel, AlexDaniel left, AlexDaniel joined 11:38 MasterDuke left 11:39 molaf left 11:41 patrickb joined 11:48 MasterDuke joined 12:13 caterfxo left, hungrydonkey joined
hungrydonkey l 12:13
12:14 pecastro joined 12:15 poohman joined 12:34 vike left 12:35 oneeggeach joined 12:40 caterfxo joined, samcv left 12:45 rindolf left, rindolf joined 12:50 poohman left 13:09 epony left 13:12 NODE left 13:13 poohman joined 13:14 xNetX0 joined 13:16 hungrydonkey left 13:22 epony joined, sena_kun joined 13:23 hungryd12 joined 13:24 Altai-man_ left 13:35 daxim left, vike joined 13:40 xinming joined 13:41 aborazmeh joined, aborazmeh left, aborazmeh joined, daxim joined, oneeggea_ joined 13:43 samcv joined, xinming_ left
AlexDaniel jmerelo: can we finaly get a redirect from docs.perl6.orgdocs.raku.org? I keep hitting old links 13:43
tellable6 AlexDaniel, I'll pass your message to jmerelo
AlexDaniel jmerelo: mainly from my own browser history, but it's really annoying
tellable6 AlexDaniel, I'll pass your message to jmerelo
13:44 Doc_Holliwould left, Doc_Holliwood left 13:45 oneeggeach left 13:46 oneeggea_ left, rindolf left 13:47 wamba left 13:50 rindolf joined 13:51 samcv left 13:53 samcv joined 14:05 Doc_Holliwould joined, Doc_Holliwood joined 14:17 aborazmeh left 14:45 poohman left 14:46 poohman joined
chloekek p6: my $x𓀀 = 1; say $x 14:52
camelia 5===SORRY!5=== Error while compiling <tmp>
Variable '$x' is not declared
at <tmp>:1
------> 3my $x𓀀 = 1; say 7⏏5$x
chloekek p6: my $𓀀 = 1; say $𓀀
camelia 1
chloekek Nice.
unidump: 𓀀 14:54
unicodable6 chloekek, gist.github.com/d652b635db67672382...6020b1e516
14:56 samcv left, samcv joined
tbrowder m: my %h=2=>1,10=>2;say %h.keys.sort 15:15
camelia (10 2)
15:16 xinming left
chloekek p6: my %h{Int} = 2 => 1, 10 => 2; say %h.keys.sort 15:17
camelia (2 10)
15:17 xinming joined
tbrowder m: my %h=2=>1,10=>2; say %h.keys.map({my $a=$_;$a.=Int}).sort 15:17
camelia (2 10)
15:19 Doc_Holliwould left, Doc_Holliwood left 15:21 Altai-man_ joined
tbrowder chloekek: thanks. yrs works when you have access to the declaration. i was passed the hash after construction 15:22
chloekek p6: my %h = 2 => 1, 10 => 2; say %h.keys.sort(&[<=>]) 15:23
camelia (2 10)
15:23 sena_kun left
chloekek p6: my %h = 2 => 1, 10 => 2; say %h.keys.map(+*).sort 15:24
camelia (2 10)
15:24 ufobat_ joined, colomon left 15:26 colomon joined
tbrowder thnks, that's what i was looking for! but is there an easy way to convert a passed hash to int keys? 15:27
15:28 ufobat__ left
tbrowder even better! you should add those examples to the docs!! 15:29
tobs m: my %h = 2 => 1, 10 => 2; dd %h.&{ my %{Int} = +«.keys Z=> .values } # optimized for funny symbols 15:33
camelia Hash[Any,Int] % = (my Any %{Int} = 2 => 1, 10 => 2)
15:36 colomon left
chloekek p6: my %h = 2 => 1, 10 => 2; my %i{Int} = %h.pairs.map({ +.key => .value }); say %i.raku 15:38
camelia (my Any %{Int} = 2 => 1, 10 => 2)
15:38 colomon_ joined 15:46 xinming left 15:49 xinming joined
poohman m: "M00".Int !~~ Failure 15:54
camelia ( no output )
poohman If I use something like this in code, a warning is generated 15:57
m: if ("M00".Int !~~ Failure) then return True; 15:58
camelia 5===SORRY!5=== Error while compiling <tmp>
Missing block
at <tmp>:1
------> 3if ("M00".Int !~~ Failure)7⏏5 then return True;
expecting any of:
block or pointy block
infix
infix stopper
poohman m: if ("M00".Int !~~ Failure) then {return True};
camelia 5===SORRY!5=== Error while compiling <tmp>
Missing block
at <tmp>:1
------> 3if ("M00".Int !~~ Failure)7⏏5 then {return True};
expecting any of:
block or pointy block
infix
infix stopper
poohman m: if ("M00".Int !~~ Failure) {return True}; 15:59
camelia ( no output )
poohman the WARNING Im getting is -> Unhandled Failure detected in DESTROY 16:02
how can I avoid this? 16:03
m: if ("M00".Int !~~ Failure && "N00".Int !~~ Failure) {return True}; 16:07
camelia ( no output )
poohman The problem is that writing this warning each time to the slows the execution considerably 16:08
16:09 daemon is now known as Alchemy, Alchemy is now known as realm
poohman m: if ("M00".Int !~~ Failure).Bool {return True}; 16:14
camelia ( no output )
poohman a .Bool seems to supress the warnings 16:15
was too soon - that didnt work either
16:17 realm is now known as cortana 16:18 melezhik joined
Geth doc: af50b53198 | (JJ Merelo)++ | 2 files
:delete working on lazy arrays #2632
16:30
linkable6 DOC#2632 [open]: github.com/Raku/doc/issues/2632 [Hacktoberfest][RFE][big][docs][good first issue][help wanted][new][⚠ Top Priority ⚠] Checklist for 6.d
16:32 melezhik left 16:36 cortana is now known as viBSD 16:42 xinming_ joined
MasterDuke poohman: does `quietly` help with what you're trying to do? 16:43
16:46 xinming left 16:47 aborazmeh joined, aborazmeh left, aborazmeh joined 16:48 Doc_Holliwould joined, Doc_Holliwood joined
poohman MasterDuke: let me try reading about that 16:56
strange- that does not seem to help as well 17:02
17:04 xinming_ left
timotimo m: without "M00".Int { return true } 17:05
camelia 5===SORRY!5=== Error while compiling <tmp>
Undeclared routine:
true used at line 1
timotimo m: without "M00".Int { return True }
camelia Attempt to return outside of any Routine
in block <unit> at <tmp> line 1
timotimo m: without "M00".Int { say "it was a failure, oh no" }
camelia it was a failure, oh no
timotimo m: without "".Int { say "it was a failure, oh no" }
camelia ( no output )
timotimo m: say "".Int
camelia 0
timotimo if that's acceptable to you
17:05 xinming_ joined
poohman timotimo 17:07
:
The problem is that if I use "M00".Int or $a.Int and if $a turns out to be non numeric I get a runtime error and execution stops 17:08
that is why I introduced a check 17:09
timotimo m: sub testsub { say "M00".Int; say "survived?" }; try { testsub }; say "eop"
camelia eop
timotimo m: sub testsub { say "M00".Int; say "survived?" }; testsub; say "eop"
camelia Cannot convert string to number: base-10 number must begin with valid digits or '.' in '3⏏5M00' (indicated by ⏏)
in sub testsub at <tmp> line 1
in block <unit> at <tmp> line 1
timotimo ^- exception handling can help you by causing the Failure object to be thrown 17:10
poohman ok thats one route to take
17:11 viBSD is now known as daemon
timotimo the direct inside of a try block will also have "use fatal" active, which causes things to explode more quickly 17:11
m: sub testsub { use fatal; my $res = "M00".Int; say "result obtained"; say "result is $res" }; testsub
camelia Cannot convert string to number: base-10 number must begin with valid digits or '.' in '3⏏5M00' (indicated by ⏏)
in sub testsub at <tmp> line 1
in block <unit> at <tmp> line 1
timotimo m: sub testsub { my $res = "M00".Int; say "result obtained"; say "result is $res" }; testsub 17:12
camelia result obtained
Cannot convert string to number: base-10 number must begin with valid digits or '.' in '3⏏5M00' (indicated by ⏏)
in sub testsub at <tmp> line 1
in block <unit> at <tmp> line 1
timotimo ^- see how in the second one, without the "use fatal", the "result obtained" line still runs
poohman ok 17:14
timotimo m: say try "M00".Int 17:15
camelia Nil
timotimo ^- you can also use try without making a full block out of it
17:18 maggotbrain joined
patrickb ping tadzik 17:20
17:22 sena_kun joined 17:23 Altai-man_ left 17:30 xNetX0 left
tadzik patrickb: oh hey :) 17:31
17:31 xNetX0 joined
tadzik patrickb: so, would you be okay with something like "this project is no longer maintained, you should probably use [rakubrew] instead" in the readme? 17:31
17:33 aborazmeh left
patrickb tadzik: My question was an open question. It's just that *if* we decide to have rakubrew as the official successor and consequently deprecate rakudobrew, then the links on raku.org and rakudo.org should be changed and like you said add some text to the rakudobrew repo. 17:36
SmokeMachine hi guys! I'm getting some strange errors while running a code with .race (without the .race it works 100% of the time)... it works 80%ish of the tries, but it can break with 3 different errors... it seems a bug... is it? gist.github.com/FCO/47c1db273cfb49...702f695803 17:38
17:38 mowcat joined 17:39 PacoLinux left
jnthn SmokeMachine: Normally means a hash is being unsed unsafely (maybe an array too). I wonder if `is cached` (which is experimental, try removing use of that) is threadsafe. 17:40
17:41 xinming_ left
SmokeMachine jnthn: yes... no errors until now without the is cached trait... 17:42
17:42 xinming_ joined
patrickb tadzik: But yeah, something like that in the readme would be sensible. 17:45
17:46 lichtkind left 17:48 aborazmeh joined, aborazmeh left, aborazmeh joined
SmokeMachine jnthn: would this be the best way of doing that? gist.github.com/FCO/9083a5f04dba5f...b0f130724f 17:49
AlexDaniel chloekek: oh, I didn't expect 𓀀 to work 17:53
17:53 lichtkind joined
chloekek :) 17:54
AlexDaniel “Lo” category, hmm
17:54 lichtkind left
AlexDaniel I guess it means that other… interesting characters… can also be used for variable names :) 17:54
18:00 molaf joined 18:04 hungryd12 left 18:10 rbtca left 18:11 rbtca joined
tbrowder lizmat: after working up a detailed demo i cannot dup my original "problem". back to work on the original and see if i can make progress. will check in again if i can shed any light. 18:19
chloekek: i filed a doc issue on the hash key sort. if i get some time i'll try to add something to the docs. thanks for your help. the "map(+*)" trick is sweet and noise-free (at least to me). 18:22
18:27 aborazmeh left 18:30 camelCaser joined, camelCaser left, wamba joined 18:31 camelCaser joined 18:40 cpan-raku left 18:41 cpan-raku joined, cpan-raku left, cpan-raku joined
Altreus Is there a reason not to create multiple supplies tapping the same supply, as opposed to creating a single supply and returning it? 19:14
Does that make sense
e.g. instead of having a $.messages property on my object and emitting onto it, have a method messages { supply whenever $!websocket.messages { ... } } 19:15
Is it worth saving supplies? :)
timotimo i'd say it is 19:18
19:21 Altai-man_ joined
Altreus k 19:21
emit is dynamic though yes? :)
eh I might just merge the methods
19:23 sena_kun left
Altreus I did it like this then, rather than creating a new supply every time messages is requested github.com/shuppet/p6-api-discord/...n.pm6#L112 19:32
refactoring a lot because I'm tearing my hair out trying to figure out why it won't reconnect properly :( 19:33
19:44 helit left 19:53 vike left 19:56 caterfxo is now known as mrwisdom
timotimo sorry about that :< 20:11
Altreus hrm my refactor doesn't work but I don't understand why 20:12
20:12 mjsir911 left
Altreus I used to have something along the lines of: start react whenever { $websocket.messages { ... $!messages.emit($json) } } 20:14
Now I have $!messages = supply whenever $websocket.messages { ... emit $json }
and now I never seem to receive anything from the websocket 20:15
20:15 helit joined, mjsir911 joined
Altreus am I now blocking? 20:15
timotimo m: my $messages = supply { say "supply block!"; whenever Promise.in(4) { emit "lol" } }; $messages.tap(*.say); $messages.tap(*.say); $messages.tap(*.say) 20:17
camelia supply block!
supply block!
supply block!
timotimo ^- this could be your issue
tapping the supply runs the supply block again; you end with another supply each time anyway 20:18
try .share on the supply instead
m: my $messages = supply { say "supply block!"; whenever Promise.in(4) { emit "lol" } } .share; $messages.tap(*.say); $messages.tap(*.say); $messages.tap(*.say)
camelia supply block!
Altreus ah hmm
timotimo m: my $messages = supply { say "supply block!"; whenever Promise.in(2) { emit "lol" } } .share; $messages.tap(*.say); $messages.tap(*.say); $messages.tap(*.say); sleep 3
camelia supply block!
lol
lol
lol
Altreus I have much to learn :)
also, I think perhaps I am replacing the original supply with a new one 20:19
Because!
I can't set up the message supply until several WS message have arrived
20:19 Black_Ribbon joined
Altreus Eh, maybe I can but I'll have to refactor more 20:19
DrGuifa is super blind.
Where is the definition for Raku’s Regex slang?
20:19 DrGuifa is now known as guifa
guifa . o O ( celebration time is mostly over haha ) 20:20
MasterDuke guifa: pretty sure it's all in nqp
guifa MasterDuke: I’m trying to do a work up for a binary regex and I wanted to follow standard regex grammar as closely as possible 20:21
aka ruthlessly and shamelessly copy and paste
20:23 pilne joined
MasterDuke github.com/Raku/nqp/tree/master/sr...ex/P6Regex is probably a good place to start 20:24
guifa Aaaaah. I was hunting around in rakudo rather than Raku on github
20:24 Xliff left 20:30 rindolf left
timotimo yeah, nqp lives outside the rakudo org 20:36
20:36 mrwisdom is now known as caterfxo
guifa Looking it over I might start by doing a baby implementation. There’s quite a bit to handle if I want to match it exactly, but the core of token + quantifier + basic grouping should be easy enough to handle in a simple grammar 20:38
Altreus OK, one of the things I did fixed my supply :D 20:41
I'm going to assume it was .shared
If nothing else at least the code is a bit more tidy 20:46
so people can help me with it <3
daemon :) 20:47
Altreus daemon: gonna watch stardew tomorrow? there may be awful scottish accents again 20:55
daemon Altreus, as long as it does not collide with my mp stream ;p
Altreus less important
daemon I found out earlier though that tf2 is pretty fun 20:56
not the default mode but the invasion mode
Altreus :)
let's not flood raku with strim chat tho 20:57
20:57 PacoLinux joined
Altreus 'm off to bed while I wait for my bot to crash again 20:57
daemon :)
21:07 wamba left 21:09 chloekek left 21:16 poohman left 21:22 sena_kun joined, Xliff joined 21:23 vike joined, Altai-man_ left 21:30 aborazmeh joined 21:31 aborazmeh left, aborazmeh joined 21:32 xinming_ left 21:33 xinming_ joined 21:46 natrys left 21:57 patrickb left 22:29 _jrjsmrtn joined 22:31 mowcat left, __jrjsmrtn__ left 22:32 mowcat joined, mowcat left 22:40 xinming_ left 22:41 xinming_ joined 22:49 xinming_ left 22:51 xinming_ joined, mowcat joined 22:53 mowcat left 22:54 mowcat joined 22:55 mowcat left, pecastro left 22:56 mowcat joined 22:59 rbtca left 23:00 rbtca joined 23:03 mowcat left 23:04 mowcat joined 23:21 Altai-man_ joined 23:23 sena_kun left 23:24 hungrydonkey joined 23:26 regreg left 23:38 aborazmeh left 23:52 xelxebar left