🦋 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:01 Doc_Holliwould joined 00:05 Doc_Holliwood left, aborazmeh joined, aborazmeh left, aborazmeh joined 00:08 AlexDaniel left 00:09 AlexDaniel joined, AlexDaniel left, AlexDaniel joined 00:17 colomon_ left 00:27 jio joined, jio left 00:28 mowotter left 00:33 jmcgnh left 00:38 frot-lab joined, Doc_Holliwould left, Black_Ribbon joined, jmcgnh joined 00:46 xinming_ left 00:47 xinming_ joined 00:53 zacts left 01:07 molaf left 01:11 xinming_ left 01:13 xinming_ joined 01:20 molaf joined 01:21 _jrjsmrtn joined 01:22 __jrjsmrtn__ left 01:23 JJAtria[m] left, AlexDaniel` left, ThaEwat left, unclechu left, CIAvash left, suzusime[m] left 01:24 kiti_nomad[m] left, Roamer` left 01:26 JJAtria[m] joined, CIAvash joined 01:27 suzusime[m] joined 01:29 BenGoldberg left, BenGoldberg joined 01:30 kiti_nomad[m] joined 01:32 Roamer` joined 01:36 Benett left 01:38 Benett joined 01:41 unclechu joined, ThaEwat joined
rypervenche Is there a short way to do: $var = -$var; ? 01:47
timotimo you can *= -1 01:56
02:01 xinming_ left, xinming_ joined 02:05 Manifest0 left 02:06 Manifest0 joined 02:09 gdonald left 02:14 unclechu left, JJAtria[m] left, spycrab0 left, caasih left, rjeli left, zostay left, timeless left, PotatoGim left, evalable6 left, rir left 02:15 spycrab0 joined, rir joined, caasih joined, zostay joined, rjeli joined, timeless joined 02:16 PotatoGim joined, unclechu joined 02:17 dmc00 left 02:18 JJAtria[m] joined 02:19 xinming_ left, ggoebel left 02:20 evalable6 joined 02:21 xinming_ joined
rypervenche Oooh 02:28
Thank you much.
Why might this give me "Use of Nil in numeric context"? my Int:D $operand = +$<integer> // 0; Shouldn't it use 0? 02:31
02:32 xinming_ left, xinming_ joined
rypervenche Oh, it's the + . Hmmm. 02:34
02:38 leont left
timotimo yeah, if you want you can "quietly" that to get rid of the warning message, otherwise maybe you like "my Int:D $operand = 0; $operand = +$_ with $<integer>" 02:44
m: my Int:D $op = +$<integer> orelse 0; 02:46
camelia WARNINGS for <tmp>:
Useless use of constant integer 0 in sink context (line 1)
Use of Nil in numeric context
in block <unit> at <tmp> line 1
timotimo m: my Int:D $op = (+$<integer> orelse 0);
camelia Use of Nil in numeric context
in block <unit> at <tmp> line 1
timotimo m: my Int:D $op = try +$<integer> orelse 0;
camelia WARNINGS for <tmp>:
Useless use of constant integer 0 in sink context (line 1)
Use of Nil in numeric context
in code at <tmp> line 1
timotimo m: my Int:D $op = try +$<integer> // 0;
camelia Use of Nil in numeric context
in code at <tmp> line 1
02:51 xinming_ left
rypervenche Guess I'll do that then. 02:52
02:52 xinming_ joined
timotimo i mean, if you have a grammar you may have different ways to react to how you parsed the input 02:54
even in a normal regex, you can use code blocks inside an alternation
rypervenche Yeah, I'm using a regex. Oh! I should probably be doing this in a with statement actually. 02:57
guifa What about 02:58
$<integer>.?Int instead?
Weird. That still produces it 02:59
Also, I thought Nil was suppsoed to return Nil on all method calls ? 03:00
timotimo isn't .?blah more about "does a blah method exist"
rypervenche This is essentially what I'm working on. Just a little practice project. gist.github.com/rypervenche/8b325e...2b9a52ed0e 03:02
timotimo ah 03:05
rypervenche You'll have to excuse the poorly named variables as well, haha. I challenged myself to do a friend's homework in Raku.
timotimo i'd say the "with $<operator>" line is a good approach
since that implies that something matched \d+
03:05 xinming_ left
timotimo in general, you could even put all the work into an actions class 03:06
rypervenche Yeah, that might be better. Hmm, I'll have to create the variable outside of the with statement, or make it a dynamic variable if I want this to work this way... 03:09
03:09 xinming_ joined
timotimo grammars + action classes let you put parsing of input together with "reacting to the shape of parse results" 03:09
if you move operator + operand into its literal own method that has only the two things, the corresponding action method will only ever be called when operator and operand are both valid 03:12
alternatively, you can do the "code block inside of an alternation" thing i mentioned earlier, it's kind-of-sort-of the same thing as an action method 03:13
guifa timeless: the .?Int is supposed to be see if the method exists, and if so, call it, otherwise, return Nil 03:17
m: class A { method a { ‘aaa’ } }; say A.?a 03:18
camelia aaa
guifa m: class A { method a { ‘aaa’ } }; say A.?b
camelia Nil
timeless looks up 03:20
nope. not me. 03:21
guifa timeless: oops, sorry, meant timotimo
I was too quick with the tab :-)
timeless sorry about the delay, irccloud sends notifications to my phone on delay
timeless can be faster to complain ;-)
03:52 ex_nihilo joined
rypervenche Nice, used an actions and turned both possible outputs into a list. 03:54
And I think my last question for the night: There's no way to shorten this, is there? $!current-value = ($!current-value ÷ $num).Int; 03:58
timotimo you can use div, that does integer division 04:02
moon-child could go for $!current-value ÷= $num; $!current-value .= Int 04:03
04:11 frot-lab left 04:32 skids left 04:45 BenGoldberg left 04:55 frot-lab joined 04:58 ex_nihilo left 04:59 zacts joined 05:11 aluaces joined 05:17 molaf left 05:27 bocaneri joined 05:41 BenGoldberg joined, xinming_ left 05:42 xinming_ joined 05:44 clarjon1 left 05:48 xinming_ left 05:49 xinming_ joined 05:52 pepl joined 05:54 jmerelo joined 05:58 xinming_ left 05:59 xinming_ joined 06:02 ufobat__ joined 06:15 BenGoldberg left 06:19 dog_star left 06:20 dog_star joined, aluaces left 06:22 xinming_ left 06:24 frot-lab left, xinming_ joined 06:30 xinming_ left, frot-lab joined 06:31 xinming_ joined 06:50 aluaces joined, Sgeo left 06:52 xinming_ left, xinming_ joined 07:01 aborazmeh left 07:02 sena_kun joined 07:03 aborazmeh joined, aborazmeh left, aborazmeh joined 07:15 pierrot_ joined, pierrot left 07:16 benchable6 left, sourceable6 left, sourceable6 joined, benchable6 joined 07:28 domidumont joined 07:31 abraxxa left 07:32 abraxxa joined 07:37 rindolf joined 07:41 Doc_Holliwould joined 07:46 dakkar joined 07:50 stoned75 joined 07:52 ufobat joined 07:53 ufobat__ left 08:04 xinming_ left, xinming_ joined, stoned75 left 08:08 frot-lab left 08:12 xinming_ left 08:15 xinming_ joined 08:29 frot-lab joined 08:33 frot-lab left 08:34 frot-lab joined 08:47 MasterDuke joined 08:48 Doc_Holliwould left 09:02 xinming_ left 09:04 xinming_ joined 09:06 BenGoldberg joined 09:08 cpan-raku left 09:11 cpan-raku joined, cpan-raku left, cpan-raku joined 09:14 xinming_ left, xinming_ joined 09:30 sena_kun left 09:32 Black_Ribbon left 09:35 finsternis left 09:36 greppable6 left, quotable6 left, notable6 left, nativecallable6 left, coverable6 left, finsternis joined, coverable6 joined, quotable6 joined, notable6 joined, nativecallable6 joined, greppable6 joined 09:40 BenGoldberg left 09:45 sena_kun joined 09:46 stoned75 joined 09:54 Doc_Holliwould joined 09:56 synthmeat joined 10:21 xinming_ left 10:22 xinming_ joined 10:29 AlexDaniel left 10:41 xinming_ left 10:42 xinming_ joined 10:47 leont joined 10:53 gugod left, gugod joined 11:00 xinming_ left 11:01 xinming_ joined 11:25 synthmeat left 11:26 synthmeat joined 11:27 synthmeat left 11:32 leont left 11:35 natrys joined 11:45 frot-lab is now known as hungrydonkey
rypervenche I've got $.current-value set as an Int:D though, so that wouldn't work. Oh, div! That does the job. 12:20
timotimo: Thank you much :)
12:29 xinming_ left 12:31 xinming_ joined, synthmeat joined, BenGoldberg joined 12:38 Doc_Holliwould left 12:48 ingy joined 12:54 leont joined 12:57 jmerelo left 13:05 BenGoldberg left 13:06 xinming_ left 13:07 xinming_ joined 13:10 pamplemousse__ joined 13:37 pamplemousse__ left 13:41 Altai-man joined 13:43 sena_kun left 13:51 aluaces left 14:10 aborazmeh left 14:20 aluaces joined, pamplemousse__ joined 14:23 ensamvarg3 joined 14:24 hungrydonkey left
[Coke] TIL why they call small alerts on a web page "Toast" 14:26
timotimo is it because they jump up from the bottom like a toast would from a toster? 14:27
14:27 sjaveed left 14:29 sjaveed joined, Sgeo joined 14:31 gnufr33dom joined 14:33 sjaveed left
[Coke] YES 14:35
tadzik I had no idea they're called toasts :o 14:36
14:36 pamplemousse__ is now known as pamplemousse
tadzik I know about snackbars though, and I've no idea what do they have to do with snacks 14:36
pamplemousse That makes so much sense! 14:37
I think snackbars are because you have a bunch of different small options in a row, like you would at a snackbar 14:38
Like a snackbar at a deli, etc 14:39
tadzik hm, but the website snackbar is basically a small strip of text that disappears quickly
like a fortune from a fortune cookie :)
tobs let's not forget breadcrumbs! 14:44
timotimo hamburger menu 14:47
i think that's just because the symbol is typically ≡
14:54 gnufr33dom left 14:55 molaf joined, molaf left 14:57 Doc_Holliwould joined 15:02 pamplemousse left 15:09 patrickb joined, sjaveed joined
patrickb .tell tony-o Have you seen github.com/tony-o/perl6-pluggable/pull/17 ? 15:10
tellable6 patrickb, I'll pass your message to tony-o
patrickb rba: The rakubrew releases still didn't make it to the website. :-( Can I poke you again? 15:11
15:14 sjaveed left 15:15 xinming joined, pamplemousse joined, jmerelo joined 15:18 xinming_ left 15:20 pamplemousse left 15:25 pamplemousse joined 15:29 skids joined 15:32 Doc_Holliwould left
tbrowder TIL TIL 15:36
guifa Is there a built in way to check if a given value matches a parameter? 15:38
$value ~~ $parameter doesn’t work
15:38 Possum joined 15:40 patrickb left 15:42 Doc_Holliwould joined
timotimo you can try matching against a signature 15:45
15:49 jmerelo left 15:52 molaf joined 15:57 BenGoldberg joined 16:00 sjaveed joined
guifa` timotimo: yeah, I knew that, it's surprising I can't directly against a single parameter too 16:02
guifa` is creating a trait that allows for unordered positionals, assuming they're different types
I can write a routine to do the check manually, just feels like it should be built in ha 16:03
timotimo well, Parameter ~~ Parameter would surely check if one parameter accepts the same (or more?) things than another, but perhaps Any ~~ Parameter could do what you want? 16:04
guifa` Yeah, that was what I had tried, but it just returns false for everything that's not a parameter. Ah well. 16:07
timotimo right, it's not yet in the language obviously
but a parameter should also let you get the type check stuff it has
guifa` Doing it via smart match though would get you the weird case that you have a parameter whose type constraint is parameter. But I guess Signature has the same issue probably. I might code that up and see if folks think it worthy for core. 16:10
timotimo haha
oh my
16:10 natrys left
guifa` All of this because I was thinking about how to make language tag creation easier :-) 16:12
16:20 patrickb joined 16:23 sjaveed left, sjaveed joined 16:27 ensamvarg3 left
moritz
.oO( guifa` is playing tag with language creators? :D )
16:28
16:28 mowcat joined
guifa` taps moritz on the shoulder, screams "TAG" and runs off 16:29
moritz feels at a TAGtical disadvantage
16:31 BenGoldberg left
MasterDuke are you wearing a TAG Heuer watch? that should help 16:32
16:33 dakkar left, kylese joined 16:34 domidumont left 16:40 pamplemousse left 16:42 ufobat left, ufobat joined 16:43 abraxxa left 16:45 aluaces left
[Coke] ... feeling very attagged right now. 16:49
17:06 pamplemousse joined 17:10 molaf left 17:16 pamplemousse left 17:18 aluaces joined 17:20 approaching236 joined 17:22 patrickb left
moritz [Coke]: no wonder, you're our attagé here :D 17:24
17:34 jmerelo joined, pamplemousse joined 17:41 sena_kun joined 17:43 Altai-man left 17:54 zacts left 18:05 natrys joined, approaching236 left, vgrato_ joined 18:06 andrzejku joined
andrzejku hi 18:07
tellable6 2020-09-23T18:24:43Z #raku <Xliff> andrzejku: The pieces are there to make some really nice games in Raku.
2020-09-23T18:25:11Z #raku <Xliff> andrzejku: However Raku's performance issues (particularly compiling) are offputting to most game developers.
2020-09-23T18:26:07Z #raku <Xliff> andrzejku: I actually wrote a generic card deck class a while ago. Never took the time to make a formal game out of it.
andrzejku I wanted to ask if status in raku gaming has changed?
Doc_Holliwould Are there any low level input libraries yet? 18:11
Methinks these are essential for a game
tadzik SDL bindings have been around for a while 18:12
18:12 abraxxa joined
andrzejku tadzik: mmm 18:14
tadzik: raku gaming would be great
tadzik: you wrote a snake, right? 18:15
tadzik I wrote something...
18:21 bocaneri left 18:37 pepl left
gfldex guifa`: like so? gist.github.com/gfldex/b94039d4bd5...4a23683ef1 18:40
guifa` gfldex: basically yeah :-) I'm doing a bit more checking (handling constraints, definedness, optionality, etc) and then wrapping it in a trait 18:43
gfldex .oO( is-unorderly ) 18:50
18:55 timlegge left 19:03 jmerelo left 19:07 kylese left 19:22 stoned75 left, BenGoldberg joined 19:24 stoned75 joined 19:30 xinming left 19:31 abraxxa left, xinming joined 19:33 abraxxa joined
timotimo andrzejku: SDL2::Raw has a snake as an example 19:38
it's also got a simple particle system 19:39
andrzejku timotimo: nice 19:46
timotimo also something kind of resembling a vertical scrolling shmup 19:47
rypervenche guifa`: So I ran generate-template.raku and merged my changes into it, but I get this message when I simply import my module: gist.github.com/rypervenche/2b4dc5...f49fd2b1ec 19:53
guifa` rypervenche: unfortunately, there's a few of them that require some extra work before the first compile is successful =/ I've got notes on all them, but a quick way to find them all is look for SlurpySentry and $! (private vars). Annoying, I know 19:55
rypervenche guifa`: I also noticed that your update scripts have pm6 hardcoded into them, but don't work since you renamed to rakumod.
guifa` oops :-)
guifa` has been a bit scatter brained lately 19:56
19:56 BenGoldberg left
rypervenche Is generate-template the best way to get a template file? The README says there's a template.rakumod file there, so I guess that also needs to be updated. 19:57
19:58 xinming left 19:59 xinming joined
guifa` That one I believe is the most updated one. 20:00
timotimo well, i haven't brained at all lately
so you're already ahead of me
guifa` The issue is just that the template copys verbatin what's in the Exceptions.pm6 file 20:01
rypervenche guifa`: You're saying that template.rakumod is the most up-to-date? Because it doesn't exist anymore.
guifa` And a few of them reference private stuff, which causes an error until you switch them to public. I'm just not sure yet how to consistently handle that on the generation 20:02
20:08 mark[m]1 left 20:15 natrys left 20:21 molaf joined 20:23 xinming left 20:25 xinming joined 20:33 pamplemousse left 20:40 squashable6 left, squashable6 joined 20:55 xinming left 20:56 xinming joined 21:00 xinming left 21:01 xinming joined 21:02 andrzejku left 21:07 pamplemousse joined 21:09 rindolf left 21:10 MasterDuke left 21:13 xinming left 21:15 xinming joined 21:17 ufobat left 21:19 xinming left 21:21 xinming joined 21:26 finsternis left 21:28 finsternis joined 21:36 pamplemousse left 21:41 Altai-man joined 21:42 timlegge joined 21:43 sena_kun left
rypervenche guifa`: I've got the first part of zh-TW ready and wanted to submit a PR. I've changed all ! to . but can't figure out the SlurpySentry bit. Still gives the same error. 22:12
22:28 xinming left, xinming joined 22:41 Altai-man left, Black_Ribbon joined 22:47 BenGoldberg joined 23:11 dmc00 joined 23:21 BenGoldberg left 23:26 xinming left
guifa rypervenche: go ahead and submit the PR and I’ll do a quick modification right after accepting it 23:27
23:28 xinming joined
rypervenche guifa: Will do, would you like it with or without the ! to . change? 23:34
guifa with please 23:35
23:38 cpan-raku left, cpan-raku joined, cpan-raku left, cpan-raku joined 23:57 stoned75 left
rypervenche guifa: Done. 23:58
23:58 aborazmeh joined, aborazmeh left, aborazmeh joined