»ö« Welcome to Perl 6! | perl6.org/ | evalbot usage: 'p6: say 3;' or /msg camelia p6: ... | irclog: irc.perl6.org or colabti.org/irclogger/irclogger_log/perl6 | UTF-8 is our friend! 🦋
Set by Zoffix on 25 July 2018.
Kaiepi news.perlfoundation.org/2019/03/gra...votes.html 01:23
i got the grant!
MasterDuke Kaiepi++ 01:25
timotimo heck yeah 01:26
3 votes of 5, that's pretty good
timotimo i hope yours doesn't end up taking much longer than anticipated like mine did 01:32
patrickb Congratulations Kaiepi! 02:08
guifa Kaiepi++ 02:09
So I have a class A. Under special conditions, A.new should return a class B is A. How do I define them so that they work? A can’t compile because B hasn’t been defined, but I can’t stub B is A { … } because A hasn’t been declared. But if I declare A as a stub, then B’s stub fails because it requires a composed class. 02:18
errr ignore all that I didn’t mean to send anything until I tried a few other things 02:19
guifa (Answer stub role A, stub class A-generic does A, stub class B does A, then actually define A with a new method that decides which type to return, and then define classes A-generic and B that do A) 02:23
vrurg guifa: Not sure if got your problem correctly, but perhaps dynamic obtainting of a type with ::('B') could work for you. In this case the class would be resolved at run time. 02:39
Then stubbing should be ok.
guifa ooh! I didn’t think about that 02:40
I finally got it to work but I quite rather like that solution because it’s not quite as messy. I’m sure it’s smidgen slower but for what i’m doing that overhead isn’t bad
vrurg You could speed things up by pre-caching the resolved type somewhere – in a class variable, for example. 02:42
guifa vrurg++ 02:43
vrurg m: class C { }; my \CC = C; my $a = CC.new; say $a.WHAT 02:44
camelia (C)
guifa I just tried that and it worked — with much cleaner code that all the stubbed stuff
vrurg I know. Looks like I went through similar issue once. Though I needed a typecheck – a child to validate its parent. 02:45
But otherwise it's same kind cyclic class dependency which could only be resolved with a loose link. 02:46
guifa oh hey, you can apparently throw it in a CHECK phaser. 02:48
So it’s basically as close to compile time as possible 02:49
Heck, I’d pretty much just call that compile time.
$foo = (CHECK ::(‘bar’)).new: @xyz 02:50
Xliff guifa: Got code? I'd love to take a look. 05:16
Kaiepi: Congratulations on the grant!
m: $*PERL.comipler.version.say 05:17
camelia No such method 'comipler' for invocant of type 'Perl'. Did you mean 'compiler'?
in block <unit> at <tmp> line 1
Xliff m: $*PERL.compiler.version.say
camelia v2018.12.321.g.845433.b.47
ToddAndMargo Hi All. I would like to write a regex that will find an Esc (27) and whack it and the next three letters too (don't care what they are). So far I have this. What am I doing wrong? 05:50
$ p6 'my $x="123"~chr(27)~"abcdefg"; say $x; $x~~s:g/"{chr(27)}"**4//; say $x;'
Figured it out. Use dots for any character. ]$ p6 'my $x="123"~chr(27)~"abcdefg"; say $x; $x~~s:g/ "{chr(27)}" ... //; say $x;' 123bcdefg 123defg 05:52
moritz nana na nana 06:22
sorry, wrong chat
m: say chr(27)
camelia
jmerelo releasable6: status 06:31
releasable6 jmerelo, Next release will happen when it's ready. 2 blockers. 319 out of 321 commits logged
jmerelo, Details: gist.github.com/bdb5aa01a35e7851ea...60d773f815
jmerelo squashable6: status
squashable6 jmerelo, ⚠🍕 Next SQUASHathon in ≈5 hours (2019-03-02 UTC-14⌁UTC+12). See github.com/rakudo/rakudo/wiki/Mont...Squash-Day
Geth doc: c4eff3c7ad | (JJ Merelo)++ | doc/Language/classtut.pod6
Adds a new example, closes #2617
07:02
synopsebot Link: doc.perl6.org/language/classtut
rindolf Hi all! How can I fix this line - if (my ($s, $e, $sum) = $l ~~ m:P5/^start = (\d+) ; end = (\d+) ; sum = (\d+)$/) 09:27
sena_kun what is "fix"? "port? 09:30
rindolf sena_kun: yes
sena_kun give me some seconds...
m: with ('1;2;3' ~~ /(\d)';'(\d)';'(\d)/) { my ($s, $e, $sum) = ($0, $1, $2); say "$s;$e;$sum"; } 09:31
camelia 1;2;3
sena_kun I'd write it like this.
sena_kun if I understand you correctly. And my understanding of P5 regexes is not the best too, so please explain further if something is missing. :) 09:32
rindolf sena_kun: i want to return several vars as captures 09:33
sena_kun well, $s, $e and $sum contain Match objects. 09:34
they are stringified because of "", but those are not strings.
rindolf perlbot: eval: if (my ($s, $e) = "12 ; 34" =~ /^(\d+) ; (\d+)\z/) { say $s,$e} else { die;} 09:35
perlbot rindolf: 5===SORRY!5=== Error while compiling /tmp/iDYkahINWQ Unsupported use of =~ to do pattern matching; in Perl 6 please use ~~ at /tmp/iDYkahINWQ:1 ------> 3if (my ($s, $e) = "12 ; 34" =~7⏏5 /^(\d+) ; (\d+)\z/) { say $s,$e} else { [Exited 1]
rindolf perlbot: eval5: if (my ($s, $e) = "12 ; 34" =~ /^(\d+) ; (\d+)\z/) { say $s,$e} else { die;}
perlbot: p5eval: if (my ($s, $e) = "12 ; 34" =~ /^(\d+) ; (\d+)\z/) { say $s,$e} else { die;} 09:36
sigh
sena_kun sorry, I don't know Perl anyway. :(
rindolf perlbot: stupid bot
sena_kun if you want it to `die` if no match is given, just `without {die}` will be enough.
m: with ('1;2;3' ~~ /(\d)';'(\d)';'(\d)/) { my ($s, $e, $sum) = ($0, $1, $2); say $s.postmatch } 09:37
camelia ;2;3
rindolf perlbot: eval: 1+1
perlbot rindolf: WARNINGS for /tmp/HTr4zXkapG: Useless use of "+" in expression "1+1" in sink context (line 1)
sena_kun m: with ('1;2;' ~~ /(\d)';'(\d)';'(\d)/) { my ($s, $e, $sum) = ($0, $1, $2); say $s.postmatch } else { die 'Too bad' }
camelia Too bad
in block <unit> at <tmp> line 1
sena_kun m: with ('1;2;3' ~~ /(\d)';'(\d)';'(\d)/) { my ($s, $e, $sum) = ($0, $1, $2); say $s.postmatch } else { die 'Too bad' }
camelia ;2;3
rindolf simcop2387: hi, how do i eval p5 here? 09:38
sena_kun m: with (my ($match) = ('1;2;3' ~~ /(\d)';'(\d)';'(\d)/)) { say $match[2] } 09:39
camelia 「3」
rindolf perlbot: help eval
perlbot rindolf: The eval plugin. Evaluates various different languages. Syntax, eval: code; also pleval deparse. You can use different perl versions by doing eval5.X, e.g. eval5.5: print "$]"; You can also add s or w to the eval to quickly add strict or warnings. sweval: print $foo;
rindolf perlbot: eval5.18: if (my ($s, $e) = "12 ; 34" =~ /^(\d+) ; (\d+)\z/) { say $s,$e} else { die;}
perlbot rindolf: ERROR: Can't locate object method "say" via package "12" (perhaps you forgot to load "12"?) at (IRC) line 1.
rindolf perlbot: eval5.18: use 5.018; if (my ($s, $e) = "12 ; 34" =~ /^(\d+) ; (\d+)\z/) { say $s,$e} else { die;} 09:40
perlbot rindolf: 1234
rindolf hallelujah
sena_kun: is there anyway to avoid using $0, $1, etc. and return a list? 09:41
sena_kun oh, there is 09:42
give me a second...
rindolf sena_kun: thanks 09:43
sena_kun m: with (my ($s, $e, $sum) = ('1;2;3' ~~ /(\d)';'(\d)';'(\d)/).list) { say $s }
camelia 「1」
sena_kun :)
m: with (my ($s, $e, $sum) = ('1;2;3' ~~ /(\d)';'(\d)';'(\d)/).list) { say $s; say $sum; say $sum.^name }
camelia 「1」
「3」
Match
rindolf sena_kun: thanks 09:44
sena_kun \o/
never thought about it before and firstly it was like "Hmm, I don't think there may be such a thing", but then "Ok, let's try to apply .list on it, maybe it'll work out".
rindolf sena_kun: it works 09:45
lizmat weekly: blogs.perl.org/users/swiss_perl_wor...-2019.html 10:22
notable6 lizmat, Noted!
cpan-p6 New module released to CPAN! perl6-cache-async (0.1.6) by 03ROBERTLE 11:04
discord6 <Vendethiel> I should book some tickets to switzerland..:) 12:59
rindolf hi all, so i wrote this in p6 today - paste.debian.net/1070851 - a bit ugly but gets the job done 13:26
sena_kun: thanks again 13:27
sena_kun :>
lucasb rindolf: hello. you used m:P5, was there a need for it? :) 13:29
patrickb .seen salortiz 13:30
yoleaux I haven't seen salortiz around.
rindolf lucasb: i haven't studied p6 native patterns yet
lucasb rindolf: ah, ok. I just wanted to warn you that the P5 patterns have uncertain future in Perl 6 13:31
sena_kun and there is a proposal about moving it out from core into a module 13:32
rindolf lucasb: ah 13:34
patrickb .seen sortiz 13:35
yoleaux I saw sortiz 20 Feb 2019 23:13Z in #perl6-dev: <sortiz> AlexDaniel: Thank you for the original report
guifa Xliff: bit.ly/2UdxAU3 13:39
Line 6 you’ll see it, (CHECK ::(‘UnicodeLocaleExtension’)).new: @subtags 13:40
Geth perl6-examples/games-shebang: 2bf3958714 | (Daniel Mita)++ | 6 files
Add shebang to games and make executable
13:50
perl6-examples: mienaikage++ created pull request #60:
Add shebang to games and make executable
13:52
leont rindolf: yeah, it doesn't look very sixish 14:07
e.g. my @l = lines($log); 14:08
rindolf leont: ah 14:13
leont And in a p6 regex it's usually most convenient to capture by name 14:14
tobs not sure if this use of `react for` is hammering something or creating a bottleneck somewhere but it's damn convenient hastebin.com/atipemorex.pl 14:26
rindolf tobs: hastebin.com/raw/atipemorex.pl is slow 15:39
Geth perl6-examples: 2bf3958714 | (Daniel Mita)++ | 6 files
Add shebang to games and make executable
perl6-examples: 6750c63ccf | (Aleks-Daniel Jakimenko-Aleksejev)++ (committed using GitHub Web editor) | 6 files
Merge pull request #60 from perl6/games-shebang

Add shebang to games and make executable
tobs rindolf: yah, do you know why? 15:40
rindolf tobs: no 15:41
tobs: error
tobs: use paste.debian.net/
rindolf tobs: i have no control over hastebin 15:42
tobs ah, the domain.
tobs sorry, I've already gone home and the file is on my work computer 15:43
rindolf tobs: ah 15:44
tobs: use github/etc next time
which reminds me that i need to clean my ~/* files 15:45
jmerelo squashable6: status 15:57
squashable6 jmerelo, 🍕🍕 SQUASHathon is in progress! The end of the event in 1 day and ≈22 hours. See github.com/rakudo/rakudo/wiki/Mont...Squash-Day
jmerelo OK, who's in? 15:58
squashable6: log
squashable6 jmerelo, Nothing there yet
AlexDaniel o yay
good morning
jmerelo AlexDaniel: hi!
Just back from a meeting
leont What is the state of 2019.02? 16:03
rindolf AlexDaniel: hi 16:06
jmerelo releasable6: status 16:07
releasable6 jmerelo, Next release will happen when it's ready. 2 blockers. 319 out of 321 commits logged
jmerelo, Details: gist.github.com/be5b28e61a236831c3...f1ae48d49b
jmerelo leont: ^^^^^^
AlexDaniel leont: waiting for a moarvm release 16:08
squashable6 🍕 JJ++ wrote a comment on “Checklist for 6.d”: github.com/perl6/doc/issues/2632#i...-468717045 16:09
🍕🍕🍕 First contribution by JJ++! ♥
AlexDaniel rindolf: hello!
leont: basically, all the technical bits are ready, so it will be out as soon as all bureaucracy is handled 16:10
squashable6 🍕 JJ++ edited issue “Checklist for 6.d”: github.com/perl6/doc/issues/2632
🍕 JJ++ edited issue “Checklist for 6.d”: github.com/perl6/doc/issues/2632 16:11
🍕 JJ++ edited issue “Checklist for 6.d”: github.com/perl6/doc/issues/2632 16:13
🍕 JJ++ edited issue “Checklist for 6.d”: github.com/perl6/doc/issues/2632 16:14
🍕 JJ++ edited issue “Checklist for 6.d”: github.com/perl6/doc/issues/2632 16:15
Geth doc: 655e4025b0 | (JJ Merelo)++ | 2 files
Clarifies deprecation IO.path subst-mutate refs #2632
squashable6 🍕 JJ++ edited issue “Checklist for 6.d”: github.com/perl6/doc/issues/2632 16:16
squashable6 🍕 JJ++ edited issue “Checklist for 6.d”: github.com/perl6/doc/issues/2632 16:17
🍕 JJ++ edited issue “Checklist for 6.d”: github.com/perl6/doc/issues/2632 16:18
pmurias wouldn't the :P5 regex syntax be usefull too for porting regexes from other languages that have Perl 5 compatible regexes?
leont The flatmap deprecation still annoys me
squashable6 🍕 JJ++ edited issue “Checklist for 6.d”: github.com/perl6/doc/issues/2632 16:19
jmerelo AlexDaniel++ 16:20
leont: it's not big deal. flat and map do the same. And you have duckmap, which has a duck. 16:21
leont But it's syntactically rather convenient 16:22
AlexDaniel convenient to write? 16:23
leont Maps (any kind) tend to read nice at the tail IME 16:25
Especially when combined with colon method syntax
AlexDaniel so is there anything wrong with `flat @foo.map(…)` or `@foo.map(…).flat` ? 16:29
leont Only aesthetically ;-) 16:32
flat @foo.map is what I ended up doing 16:33
squashable6 🍕 JJ++ edited issue “Checklist for 6.d”: github.com/perl6/doc/issues/2632 16:37
leont @foo.map({ bsdkjlafhaslfhs;kjnaskjdflkfdsjhalskjfhlasjfdkADasdhkjashd }).flat has a rather important thing too far to the end
Geth doc: c2daa96626 | (JJ Merelo)++ | doc/Type/IO/Path.pod6
Clarifies deprecation child refs #2632
doc: 529383f7ed | (JJ Merelo)++ | doc/Type/Str.pod6
Clarifies deprecation :count refs #2632
synopsebot Link: doc.perl6.org/type/IO::Path
Link: doc.perl6.org/type/Str
doc: 899e840cfe | (JJ Merelo)++ | doc/Type/Test.pod6
Adds description for is_approx

And also deprecation notice... Refs #2632.
synopsebot Link: doc.perl6.org/type/Test
AlexDaniel m: say <a b c d e>.flatmap({ $_ xx 2 }) 16:41
camelia (a a b b c c d d e e)
AlexDaniel m: say <a b c d e>.map({ $_ xx 2 }).flat
camelia (a a b b c c d d e e)
AlexDaniel m: say <a b c d e>.map({ slip $_ xx 2 })
camelia (a a b b c c d d e e)
AlexDaniel m: say <a b c d e>.map({ |($_ xx 2) })
camelia (a a b b c c d d e e)
AlexDaniel m: say flat <a b c d e>.map({ $_ xx 2 })
camelia (a a b b c c d d e e)
AlexDaniel m: say() <== flat() <== <a b c d e>.map({ slip $_ xx 2 }) 16:42
camelia (a a b b c c d d e e)
squashable6 🍕 JJ++ opened issue “Document environment variables for testing”: github.com/perl6/doc/issues/2637 16:45
squashable6 🍕 JJ++ wrote a comment on “Checklist for 6.d”: github.com/perl6/doc/issues/2632#i...-468730347 16:46
🍕 JJ++ edited issue “Checklist for 6.d”: github.com/perl6/doc/issues/2632 16:49
squashable6 🍕 JJ++ wrote a comment on “Checklist for 6.d”: github.com/perl6/doc/issues/2632#i...-468732439 16:52
🍕 JJ++ edited issue “Checklist for 6.d”: github.com/perl6/doc/issues/2632 16:53
🍕 AlexDaniel++ wrote a comment on “Checklist for 6.d”: github.com/perl6/doc/issues/2632#i...-468733351 16:55
🍕🍕🍕 First contribution by AlexDaniel++! ♥
squashable6 🍕 JJ++ wrote a comment on “Checklist for 6.d”: github.com/perl6/doc/issues/2632#i...-468734716 16:59
🍕 JJ++ edited issue “Checklist for 6.d”: github.com/perl6/doc/issues/2632 17:02
Geth doc: 64849995ee | (JJ Merelo)++ | doc/Type/Channel.pod6
Adds 6.d behavior refs #2632
synopsebot Link: doc.perl6.org/type/Channel
doc: 1697e0f7c6 | (JJ Merelo)++ | doc/Language/concurrency.pod6
Clarifies whenever thanks @AlexDaniel refs 2632
synopsebot Link: doc.perl6.org/language/concurrency
squashable6 🍕 Leont++ wrote a comment on “Checklist for 6.d”: github.com/perl6/doc/issues/2632#i...-468737420 17:07
🍕🍕🍕 First contribution by Leont++! ♥
squashable6 🍕 JJ++ opened issue “Incongruous sentence in Channel.close”: github.com/perl6/doc/issues/2638 17:15
squashable6 🍕 JJ++ edited issue “Checklist for 6.d”: github.com/perl6/doc/issues/2632 17:22
🍕 JJ++ edited issue “Checklist for 6.d”: github.com/perl6/doc/issues/2632 17:31
Geth doc: 9cb4be7a95 | (JJ Merelo)++ | doc/Language/variables.pod6
Adds deprecation for (), thanks @leont, refs #2632
17:32
synopsebot Link: doc.perl6.org/language/variables
doc: a0b3055b9f | (JJ Merelo)++ | doc/Language/nativetypes.pod6
Adds clarification on native init, refs #2632
synopsebot Link: doc.perl6.org/language/nativetypes
jmerelo OK, I'll stick around, but no more commits for a while. Anyone wants a Camelia plush toy? Join the squashathon! 17:35
timotimo oh, the squashathon is nao 17:51
jmerelo timotimo: right! 17:53
discord6 <kawaii> beginner question: I have a race condition somehow between two synchronous routines, how do I go about debugging this? :] 20:04
<kawaii> well, two routines I think are synchronous.. 20:05
<kawaii> (they are both within a react/whenever block however
timotimo print debugging, lol 20:06
AlexDaniel kawaii: maybe you can show some code? 20:17
vrurg Is there a switch which makes 'use fatal' the default? 20:22
discord6 <kawaii> AlexDaniel: here we go, pushed some code: github.com/kawaii/pd-keiken/blob/m...ken.p6#L37 my issue is that the grant-level-roles routine seems to execute before grant-experience has even finished, which I did not think possible 20:24
<kawaii> and then I end up with output like this bliantehshark gained 18 experience points! bliantehshark needs level NaN 5 is role ID 534153805441269761 10 is role ID 534153833404956683
<kawaii> it takes the NaN and decides to just assign the user ALL of the roles in the hash 20:25
discord6 <kawaii> (this is a situation where the user has 0 experience points, and therefore no entry in the database until grant-experience has finished, if that wasn't clear) 20:29
AlexDaniel kawaii: this is weird 20:35
discord6 <kawaii> AlexDaniel: my code or the issue? ;} 20:36
AlexDaniel the issue
discord6 <kawaii> i'm correct in thinking these specific routines of my code are entirely synchronous right? there shouldn't be room for a race condition yet there it is 20:37
rindolf squashable6: status
squashable6 rindolf, 🍕🍕 SQUASHathon is in progress! The end of the event in 1 day and ≈17 hours. See github.com/rakudo/rakudo/wiki/Mont...Squash-Day
AlexDaniel what does `next` do in that case?
squashable6 rindolf, Log and stats: gist.github.com/fa1eb37f87feee9f47...bf952f5107
timotimo vrurg: does -Mfatal work?
vrurg timotimo: No. 20:38
AlexDaniel kawaii: yes, you are correct, that's the point of `react` block
timotimo d'oh
discord6 <kawaii> AlexDaniel: the next there means to not proceed to the rest of the code
<kawaii> i.e. if they ran a command, catch it there and don't proceed to give them exp etc... 20:39
AlexDaniel kawaii: does `next` work with whenevers? 20:39
vrurg timotimo: it's a tricky case. I'm trying to fix subsets and the warning comes from some core location.
I just can't find that location...
timotimo you can catch the warning and print a backtrace 20:40
m: sub check-it-out { CONTROL { Backtrace.new.full.say }; Str + Int }; check-it-out
camelia in code at SETTING::src/core/Backtrace.pm6 line 85
in method new at SETTING::src/core/Backtrace.pm6 line 85
in block at <tmp> line 1
in any at <tmp> line 1
in sub warn at SETTING::src/core/control.pm6 line 188
in method Numeri…
discord6 <kawaii> AlexDaniel: it seems to be doing what it is supposed to, if a message is prefixed with ! it is caught by the commands unit module and then other logic executes 20:41
vrurg timotimo: Doesn't work either. I'm working with S02-types/subset.t from specs and it's the only plave where I can install the CONTROL. but it didn't help. 20:42
vrurg is gonna bisect with debug prints now.
AlexDaniel kawaii: interesting… I don't think that is documented…
I also don't think that it works right 20:43
let me double check…
discord6 <kawaii> @altreus™ told me about it, he might know more than I do :]
AlexDaniel oh, it works, yeah 20:44
timotimo vrurg: you can try the debugserver! \o/
vrurg timotimo: CLI debugging? My all-time nightmare. 20:45
timotimo if you have Comma, you can do it with a gui
AlexDaniel so if you put `next` in a subroutine, it will either next a loop or next a whenever depending on where you call it xD
timotimo tbh the CLI of the debugserver client is ... really quite not so great
AlexDaniel jnthn: ↑ there's no way that could be a good idea, right? 20:46
timotimo but a whenever is a loop
discord6 <altreus™> perl5 warns you that you're nexting a loop that you're dynamically but not lexically in 20:47
timotimo oh, it does?
discord6 <altreus™> shouldn't use next in a subroutine because subroutines can be run from without a loop
<altreus™> It actually says exiting subroutine via next but it's the same set of circumstances 20:48
timotimo we don't have checked exceptions :P
discord6 <altreus™> ok back to recording
AlexDaniel m: sub foo() { next }; foo
camelia ===SORRY!===
next without loop construct
AlexDaniel well, what a shitty error message :)
discord6 <altreus™> @kawaii can haltingly explain things
AlexDaniel m: sub foo() { last }; foo
camelia ===SORRY!===
last without loop construct
timotimo that's a compile time error
i thought it would work out fine 20:49
i suppose it has to be inside a loop lexically
AlexDaniel timotimo: except that it's not
squashable6 🍕 coke++ opened issue “split spellcheck for code”: github.com/perl6/doc/issues/2639
🍕🍕🍕 First contribution by coke++! ♥
AlexDaniel rule of thumb: if you're seeing a SORRY without a line number, it's not a compile-time error :D
m: sub foo() { last }; say ‘compile-time my arse’; foo 20:50
camelia compile-time my arse
===SORRY!===
last without loop construct
timotimo d'oh
sorry about that
Geth doc: 65952caa4f | Coke++ | 2 files
learn new words
vrurg timotimo: No, I haven't got Comma yet. Waiting for the community edition to give it a try begore buying. 20:52
AlexDaniel but you don't need Comma for that 20:53
or am I missing something?
timotimo you do not
it just gives you a gui
AlexDaniel I remember debugging things successfully just using the command line
not the most convenient process, I admit, but it does work. Kinda wish somebody integrates it into emacs perl6-mode eventually
AlexDaniel also definitely not too inconvenient 20:54
AlexDaniel RT#130442 20:55
synopsebot RT#130442 [new]: rt.perl.org/Ticket/Display.html?id=130442 [REGRESSION] [LTA] redo without a loop no longer prints the line number, also claims it is a compile-time error (redo)
Geth ecosystem: 45dcebc869 | (Salvador Ortiz)++ (committed using GitHub Web editor) | META.list
Add NativeLibs to ecosystem

See github.com/salortiz/NativeLibs
20:56
AlexDaniel OK now that's R#2725 20:58
synopsebot R#2725 [open]: github.com/rakudo/rakudo/issues/2725 [LTA][regression] next/last/redo without loop constructs prints a bad error message
discord6 <kawaii> nice unintentional find there 21:06
guifa Okay okay so it’s not quite the same but …  21:41
guifa finally squashed an insanely annoying overly eager/greedy grammar bug in his module
AlexDaniel kawaii: let me know if you figure it out 21:46
it's likely an issue in your logic somewhere, not a problem in rakudo
but who knows
discord6 <kawaii> AlexDaniel: well, I'm now working on making my code safer to these NaN issues, I have a problem where both NaN || 0; and NaN // 0; return NaN and not the 0 I want though. :] 21:55
<kawaii> m: NaN || 0; 21:56
AlexDaniel m: say NaN || 0
camelia NaN
AlexDaniel m: say NaN.isNaN ?? 42 !! 0
camelia 42
discord6 <Rogue> NaN is truthy so it will do that
AlexDaniel m: my $x = NaN; say $x.isNaN ?? 42 !! $x
camelia 42
AlexDaniel m: my $x = 50; say $x.isNaN ?? 42 !! $x
camelia 50
AlexDaniel yeah you have to use isNaN
discord6 <Rogue> me no likey this: 21:57
<Rogue> m: say NaN == NaN
<Rogue> oh, the bot doesn't work with the bridge, right
<Rogue> anyway NaN != NaN but NaN === NaN 21:58
<kawaii> so something like if @xp[0] == NaN { return 0; }?
AlexDaniel m: say NaN == NaN 22:01
camelia False
AlexDaniel m: say NaN === NaN
camelia True
discord6 <Rogue> That rubs me very wrongly 22:03
AlexDaniel Rogue: why? 22:06
“Value identity operator.”
seems to be identical to me
discord6 <Rogue> == is the numeric equality operator, and NaN is a number in a sense (NaN ~~ Numeric, after all) 22:08
<Rogue> NaN == NaN ought to be true, and I frankly can't fathom what oddity is amking it false
<kawaii> return @xp[0] unless @xp[0].isNaN { return 0 }; pointer on where I'm going wrong here?
<Rogue> you can't have a block after an unless like that 22:09
<kawaii> I've used blocks after unless in the past though 🤔 is this somehow different? 22:10
MasterDuke Rogue: it's like nil in SQL. you can't do `where foo == null`, you have to do `where foo is null`
discord6 <Rogue> Are you against the ternary for any reason? Could do `return @xp[0].isNaN ?? @xp[0] !! 0;``
<kawaii> @Rogue first time I've come across it just now, however it still returns NaN apparently Directive d not applicable for type Num 22:13
<Rogue> Oh, oops, it should be the other way round
<Rogue> ... ?? 0 !! @xp[0] 22:14
Geth doc: f250c6c99d | Coke++ | doc/Type/IO/Path.pod6
remove stray ', syntax error
synopsebot Link: doc.perl6.org/type/IO::Path
masak Rogue: NaN should be unequal to itself according to the IEEE 754 spec.
Rogue: what's cool about Perl 6 is that it (correctly) distinguishes `==` (numerical identity) from `===` (actual identity)
so you don't get the typical problem where you can't even check against NaN 22:15
discord6 <kawaii> @Rogue hey that works! many thanks
<Rogue> Yeah, I get that and that's great, but still, it seems odd to have something of type Numeric have such counterintuitive behavior on a "numeric equality" operator 22:16
masak again, it's not Perl 6, it's IEEE 754. that's just how NaN is supposed to behave.
discord6 <Rogue> I do wonder about their rationale 22:17
masak and it makes some weird amount of sense too, because two arithmetical failures shouldn't compare as being the same failure
^ that's the rationale
discord6 <Rogue> I suppose so
masak that's also why there are many separate possible NaN values, of which NaN is just the privileged one
masak m: say Inf - Inf; say 0 * Inf; say Inf - Inf == 0 * Inf 22:18
camelia NaN
NaN
False
masak I'd rather that comparison be False than True, to be honest 22:19
guifa The nice thing though is that if you don’t like it, you could always override the comparison :-)
masak just like if you don't enjoy the fact that 2 + 2 == 4... :P
m: multi infix:<+>(2, 2) { 5 }; say 2 + 2
camelia 5
masak grins evilly 22:20
discord6 <Rogue> Sneak that one into your next module
masak well, usually these things are lexically scoped ;)
discord6 <Rogue> * and export it 22:21
guifa waits for someone to create a cardinality module for Inf 22:22
tony-o is someone here on the rakudo org for docker? 22:26
yoleaux 16 Feb 2019 08:55Z <jmerelo> tony-o: how can we be expected to write plugins a) without documentation on how to do it or a reference implementation and b) if the interface to them will change?
tony-o .tell jmerelo you can write plugins by looking at any of the plugins currently available or you can be patient for the interface change (documentation will be generated for how to write a plugin after that) and then read the docs 22:27
yoleaux tony-o: I'll pass your message to jmerelo.
ToddAndMargo Question on docs.perl6.org/language/exceptions...exceptions I added the code to the top(ish) of my program and it does work with Timo's corrections. Problem: the lines numbers of the errors it reports are shy by about the number of lines this code added. Should this code be placed at the bottom of my program, not the top? 22:46