»ö« 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.
uzl .tell dolmen Concerning colabti.org/irclogger/irclogger_lo...6-27#l293, why don't you try using a slurpy hash? 00:25
yoleaux uzl: I'll pass your message to dolmen.
uzl .tell dolmen Like this: perl6 -e 'unit sub MAIN(Str $arg1, *%flags) {put %flags.values}' --flag=X --flag=Y --flag=Z A
yoleaux uzl: I'll pass your message to dolmen.
uzl Can somebody show an example of an our-declared class variable and its use across a class hierarchy? As alluded here: docs.perl6.org/language/classtut#State 00:28
AlexDaniel xinming: we're getting there! 01:15
Xliff m: my @a = (Any, Nil, Any, Any).grep({ .defined }).elems.say 02:18
camelia 0
Xliff m: my @a = (Any, Nil, Any, Any, ()).grep({ .defined }).elems.say
camelia 1
Xliff .tell jnthn Is this a known issue for IO::Socket::Async -> Type check failed for return value; expected OpenSSL::Bio::BIO_METHOD but got Whatever (*) 03:23
yoleaux Xliff: I'll pass your message to jnthn.
Xliff .tell jnthn Is there a workaround?
yoleaux Xliff: I'll pass your message to jnthn.
lizmat weekly: blogs.perl.org/users/laurent_r/2019...tates.html 04:34
notable6 lizmat, Noted!
lizmat weekly: ajs.github.io/tools/perl-6-list-concat-op/ 04:34
notable6 lizmat, Noted!
lizmat weekly: blogs.perl.org/users/athanasius/201...e-014.html 09:27
notable6 lizmat, Noted!
pmurias For use foo:from<node.js> (and for the equivalents for other dynamic languages) I'm considering two approaches: 1. forbid accessing foo at compile time and 2. allow it but reload the module at runtime with forgot state 10:25
Which of those too seem sane?
hmm, I could allow either using it at runtime or at compile time (so if you use it before it's serialized then it's a stub at runtime) 10:26
Geth p6-sake: 31303e400e | (Aleks-Daniel Jakimenko-Aleksejev)++ | 2 files
Let users have their own help task

Without an override mechanism, the error for duplicate task names prevents users from creating their own help task.
Resolves #22, but I'd be happy to see a better solution.
12:35
AlexDaniel gosh I love tests in sake :) 12:36
Xliff AlexDaniel: Is sake designed to be an alternative to Test? 13:39
yoleaux 12:46Z <jnthn> Xliff: Did you mean IO::Socket::Async::SSL? I've not seen that error before; please open an issue.
kawaii `Type check failed in assignment to $how-many; expected Int but got Str ("1")` 14:16
uh, are these kind of things not supposed to just coerce automatically? 14:17
`my Int $how-many = $cmd-obj.args;` got passed a string of "1", I assumed it would not freak out about this 14:18
If I remove the `Int` constraint, I get `Use of uninitialized value of type Any in numeric context` 14:19
sena_kun kawaii, you need to coerce in this case 14:20
sena_kun you can use allomorphs 14:21
m: my Int $a = <1>; my Str $b = <1>; say $a; say $b;
camelia 1
1
sena_kun m: my Int $a = <1>; my Str $b = <1>; say $a; say $b; my Str $b = $a; 14:22
camelia Potential difficulties:
Redeclaration of symbol '$b'
at <tmp>:1
------> 3 Str $b = <1>; say $a; say $b; my Str $b7⏏5 = $a;
1
1
kawaii sena_kun: `Type check failed in assignment to $how-many; expected IntStr but got Str ("\$cmd-obj.args")` 14:23
I don't think I got it :) `my IntStr $how-many = <$cmd-obj.args>;`
sena_kun no-no
you need to populate `args` with a number in <1> in the first place 14:24
kawaii ahhh okay
sena_kun of course, 1 is change-able
though I am not sure what to do with something other than constants...
timotimo if you want the <1> semantics, you need the "val" sub
automatic coercion happens with operators usually, because operators tend to carry with them an intended type 14:25
like + in perl6 is always numeric in nature, that's why "a" + "b" is wrong instead of giving "ab"
sena_kun m: my $input = '1234' #`(get may be here); my $a = IntStr.new($input.Int, $input); say $a ~~ Int; say $a ~~ Str; 14:26
camelia True
True
kawaii I think I'm getting closer... `Type check failed in assignment to $how-many; expected IntStr but got Str ("3")`
`my IntStr $how-many = <1>; $how-many = $cmd-obj.args;`
so it got passed the first part, and died on the actual value
timotimo yeah, that variable will only accept an actual IntStr, rather than coercing 14:27
kawaii method purge-messages($cmd-obj) { 14:28
my %payload = $cmd-obj.payload;
my $channel = %payload<channel>;
my IntStr $how-many = <1>;
$how-many = $cmd-obj.args;
return content => "$channel $how-many";
}
ugh, oops
timotimo i recommend just using +$cmd-obj.args if you want to coerce the value to an Int 14:29
m: my Int() $foo = "123" # ISTR this doesn't work? 14:31
camelia 5===SORRY!5=== Error while compiling <tmp>
Coercion Int(Any) is insufficiently type-like to qualify a variable
at <tmp>:1
------> 3my Int() $foo7⏏5 = "123" # ISTR this doesn't work?
expecting any of:
constraint
kawaii trying to call this method here github.com/shuppet/p6-api-discord/...m6#L82-L98 15:04
have tried not awaiting and awaiting, get the same issue each time
` No such method 'fetch-messages' for invocant of type 'Promise'`
from ` my @messages = await $channel.fetch-messages($how-many);
`
jnthn dd @messages 15:06
kawaii uh well, @messages is what I've declared as the result of the method, and I assume it dies when I call it with the $how-many param 15:08
so not sure if that will give you anything useful jnthn
timotimo you may want (await $channel).fetch-messages($how-many)
jnthn Ah, right...yes, founds like $channel is the Promise 15:09
kawaii timotimo: you were right :)
now back to grappling with type cast issues
Seems like nothing I do will coerce $how-many to be an Int :( www.irccloud.com/pastebin/gsqHrZul/ 15:10
jnthn <(\d+)> / just means there's an integer somewhere in the string, not that it would coerce to an Int successfully becasue that's all that is in there 15:12
Add ^ and $ to make sure of that
kawaii like `^<(\d+)>$` or did I misinterpret jnthn? :) 15:13
jnthn Yes, like that, but I don't see why <( and )> are needed in that case :) 15:14
kawaii right that still works but in any case, it's a string still 15:15
jnthn Well, sure, you've just checked if the string matches a pattern; you'd need to stick on .Int to coerce it 15:17
The pattern is just saying, "supposing I tried to .Int this thing, would it work?"
kawaii ah okay so this no longer errors but doesn't return anything, progress! 15:18
so I notice that when between double-quotes, $variables evaluate but @arrays do not? 15:21
jnthn Correct, you'd need something like @arrays[] to force that 15:26
Or @arrays.join(',') or whatever if you want to specify the joiner
nadim good afternoon P6! 15:27
Woodi reported that rendering a HTML file with DDT grabbed 4 GB, I also noticed that it uses loads of memory and is Sloooow.
Any tips, tools that can help? or someone helping me to learn how to not botch up the job and write proper P6 15:28
Xliff m: my @a = <a b c>; @a.VAR.name.say 15:30
camelia @a
kawaii method purge-messages($cmd-obj) { 15:34
my %payload = $cmd-obj.payload;
my $channel = %payload<channel>;
my $how-many = $cmd-obj.args;
unless $how-many ~~ / ^\d+$ / { return content => 'You must provide an Int value for this command.'; }
my @messages = (await $channel).fetch-messages($how-many.Int);
#(await $channel).bulk-delete(@messages);
my $debug = @messages.join(',');
return content => "$debug";
}
I really wish my client would stop doing that
anyhow, the contents of $debug was literally `Promise<140146062359872>` jnthn 15:35
Xliff m: my @a = <a b c>; say "Hi, @a"; 15:44
camelia Hi, @a
Xliff m: my @a = <a b c>; say "Hi, {@a}";
camelia Hi, a b c
Xliff Huh! I've always used {}, so didn't realize that...
moritz m: my @a = <a b c>; say "Hi, @a[]"; 15:45
camelia Hi, a b c
moritz m: my @a = <a b c>; say "Hi, @a[1]";
camelia Hi, b
ugexe m: say "Hi {$++}" for 1..10; 16:01
camelia Hi 0
Hi 0
Hi 0
Hi 0
Hi 0
Hi 0
Hi 0
Hi 0
Hi 0
Hi 0
ugexe m: say "$++"
camelia 5===SORRY!5=== Error while compiling <tmp>
Non-variable $ must be backslashed
at <tmp>:1
------> 3say "7⏏5$++"
expecting any of:
argument list
double quotes
prefix
term
sjm_uk nbd 16:33
jmerelo releasable6: status 17:42
releasable6 jmerelo, Next release will happen when it's ready. R6 is down. At least 1 blocker. 262 out of 666 commits logged (⚠ 1 warnings) 17:43
jmerelo, Details: gist.github.com/e599840beffbcd52a4...d8870f4720
timotimo doesn't even know what R6 is 18:00
sena_kun timotimo, github.com/perl6/whateverable/blob...le.p6#L137 and the URL being fail.rakudo.party/release/blockers.json 18:14
which is indeed down
moritz yes, that's an old zoffix domain 18:15
AlexDaniel timotimo: you might like this rant: colabti.org/irclogger/irclogger_lo...06-29#l194 18:16
btw Zoffix's server is still working, from what I can tell 18:17
it's just that a bunch of services are down, I think
so if that's accidental and we kindly ask to bring them back up…
timotimo i'm not sure where the complaint about "with cuid 1 has not appeared" comes from in that context 18:20
oh
there it is
irced eyes the couch. 18:21
AlexDaniel point is, it's easy and cute to give things some obscure names, but IMO there are better ways to do things 18:22
which is why I like “bisectable” :)
like it could've been janice or any other random name, right 18:23
irced asks Camelia out for a date.
lizmat AlexDaniel: I've updated my commits in the Changelog Draft 18:24
AlexDaniel lizmat: thank you! I'll get the changelog finished asap
kawaii: is it done now? 18:25
timotimo i'm not sure i see the value in making an error about a QAST::Block being referenced but not showing up in the final tree that the compiler gets fed more easily understood to an outsider. it's not like there's any action they could take if they weren't already a core developer for a long time 18:26
AlexDaniel timotimo: I'm talking about a general problem when it's OK to give things obscure names for no good reason 18:29
it's just a single example and maybe not the best one, sure
but to overturn this some minds need to be changed, and your remark is not exactly helping 18:30
timotimo i'm sure there's examples where it makes a lot more sense to have more easily understood terms 18:31
AlexDaniel timotimo: honestly, I have a problem with many terms that we have. Like most of them. Maybe I'll put them all in a list so that it's easier to see which ones can be changed without too much pain 18:38
but even the basic stuff, like “roast”
goddamit just call it perl6-spec
ugexe that wont be confusing with perl6/specs 18:39
AlexDaniel sure won't be
because that'll be perl6/old-design-docs
ugexe thats one way to kill more backlinks i guess 18:40
AlexDaniel it depends
“We keep redirects for moved and renamed repos indefinitely” 18:41
so it won't break unless you create a new repo with the same name
irced votes for all unique hexadecimal names.
AlexDaniel but I mean, what's the alternative 18:42
keeps old-design-docs as specs forever?
irced votes for all unique (floating point) hexadecimal names.
ugexe have you ever heard of the term bug compatibility?
timotimo be compatible with camelia? 18:43
AlexDaniel it's not like our whole infrastructure just collapsed and nothing is working and most of the links are broken
and we care about links to outdated design docs
irced insect compatibility! 18:44
lizmat weekly: perl6.eu/van-eck-state.html
notable6 lizmat, Noted!
AlexDaniel and it's not like RT is shutting down
but we can't move a fresh issue tracker because links are going to break 18:45
ugexe RT shutting down isn't a license to clean house
its easy to say just use the latest greatest. the hard part is someone coming up with a real plan of how such a thing can be accomplished, including how various pitfalls will be handled. 18:46
AlexDaniel you need a license to clean a house? 18:47
AlexDaniel :) 18:47
ugexe the maid must sign a CLA before stepping foot into my house 18:50
irced whoa maids that that not only clean code but will implement as well! I feel like I missed the future! 18:54
irced asks multiple people what date it is. 18:55
lizmat irced: it's the last day of the first half
irced not the mention the kitchen sink, countertop, carpet, windows, etc.
irced thanks lizmat heartily confusedly. 18:56
irced envisions an advertisements: mobile maids, we clean and refactor on the go! 1800-ref-actor. 19:03
jmerelo It hasn't moved for a few days, so please last answers for the Perl 6 user survey docs.google.com/forms/d/e/1FAIpQLS...g/viewform 19:20
I'll be processing and publishing results next week
Kaiepi i forgot about that
tadzik www.nntp.perl.org/group/perl.perl5...55336.html this is a very valid point :( 20:05
I remember it being the case with the perl6 bugtracker too 20:06
it's also a bit of a symbol: if the Perl community can't be expected to endorse/support Perl products, how can it expect anyone else to do the same
lizmat tadzik: fwiw, RT for Perl 6 is being shut down as well: github.com/perl6/problem-solving/issues/49 20:11
tadzik lizmat: yeah. Somehow I found it less troubling, as perl 6 is already developed on github anyway 20:13
ugexe could always set up an email bot, similar to how the discord bot works in irc 20:15
timotimo "bugbear" 20:17
lizmat perhaps gitreports.com is a solution ? 20:31
privately hosted as part of the Perl 6 infrastructure ? 20:32
Kaiepi when's the next weekly? 20:48
wait thought it was monday, not sunday
lizmat it's still Sun here :-) 21:00
tadzik oh gitreports is nice 21:03
AlexDaniel lizmat: they can also come here, tell us about the problem and someone will help file a bug report 21:09
lizmat well, sometimes, when channels are being spammed, it's not so easy to report something on IRC either
AlexDaniel I do understand where they are coming from, and I agree to some extent, but I somehow doubt that a github-less way of submitting tickets is worth the trouble 21:10
lizmat well... fwiw, I think the potential for high quality bug reports is higher with people who consciously refuse to use Github :-) 21:11
AlexDaniel I doubt it 21:12
means they never file any bug reports
because everyone is using github nowadays
lizmat but a low maintenance solution would be creating an email address for bug reporting that would get passed on to some core developer "on duty" :-)
AlexDaniel lizmat: just add you email address here and that's it: rakudo.org/bugs 21:13
or well, encourage someone else to volunteer :) 21:14
lizmat I don't think it would be a good idea to publish a non perl6.org mail address for this
I would not be against receiving all of that mail (including spam) for the foreseeable future 21:15
Kaiepi m: sub foo { (:$key, :$value) }; say foo :1a 23:07
camelia 5===SORRY!5=== Error while compiling <tmp>
Variable '$key' is not declared
at <tmp>:1
------> 3sub foo { (:7⏏5$key, :$value) }; say foo :1a
Kaiepi oh
i was misreading the code in #perl6-dev, was confused why that "worked" 23:08
timotimo ha
Kaiepi m: sub foo { say $^a, ' ', $^b }; foo 'ayy', 'lmao' 23:09
camelia ayy lmao
Kaiepi m: sub foo { say $^a, $^b, $_ }; foo 'ayy', 'lmao' 23:11
camelia ayylmao(Any)
Kaiepi m: sub scream-obscenities( (:$filthy-remark) ) { say $filthy-remark.uc }; class Obscenity { has $.filthy-remark }; my Obscenity $obs .= new: filthy-remark => "Why don't you just use node.js instead of worrying about threads? It's non-blocking."; scream-obscenities $obs 23:22
camelia WHY DON'T YOU JUST USE NODE.JS INSTEAD OF WORRYING ABOUT THREADS? IT'S NON-BLOCKING.
Kaiepi huh
didn't know you could do that
m: sub test( (:$^name) ) { say $^name }; test &test 23:25
camelia 5===SORRY!5===
In signature parameter $^name, it is illegal to use the ^ twigil
at <tmp>:1
------> 3sub test( (:$^name7⏏5) ) { say $^name }; test &test
Placeholder variable '$^name' cannot override existing signature
at <tmp>:1
-…
Kaiepi m: sub test( (HOW => (:$name)) ) { say $name }; test &test
camelia 5===SORRY!5=== Error while compiling <tmp>
Invalid typename 'HOW' in parameter declaration.
at <tmp>:1
------> 3sub test( (HOW7⏏5 => (:$name)) ) { say $name }; test &tes
Kaiepi m: sub test( (:HOW{:$name}) ) { say $name }; test &test 23:26
camelia 5===SORRY!5=== Error while compiling <tmp>
Missing block
at <tmp>:1
------> 3sub test( (:7⏏5HOW{:$name}) ) { say $name }; test &test
Kaiepi m: sub test( (:HOW(:$name)) ) { say $name }; test &test
camelia Cannot unpack or Capture `&test`.
To create a Capture, add parentheses: \(...)
If unpacking in a signature, perhaps you needlessly used parentheses? -> ($x) {} vs. -> $x {}
or missed `:` in signature unpacking? -> &c:(Int) {}
in sub test at …
Kaiepi m: sub test( (:$HOW(:$name)) ) { say $name }; test &test
camelia 5===SORRY!5=== Error while compiling <tmp>
Shape declaration with () is reserved;
please use whitespace if you meant a subsignature for unpacking,
or use the :() form if you meant to add signature info to the function's type
at <tmp>:1…
Kaiepi m: sub test( (:$HOW) ) { say $HOW.name }; test &test 23:27
camelia Cannot unpack or Capture `&test`.
To create a Capture, add parentheses: \(...)
If unpacking in a signature, perhaps you needlessly used parentheses? -> ($x) {} vs. -> $x {}
or missed `:` in signature unpacking? -> &c:(Int) {}
in sub test at …
ugexe not to mention .name takes 1 not 0 argument 23:31
Kaiepi oh right 23:31
Kaiepi m: sub test( ($name = $_.HOW.name($_), |) ) { say $name }; test &test 23:39
camelia Cannot unpack or Capture `&test`.
To create a Capture, add parentheses: \(...)
If unpacking in a signature, perhaps you needlessly used parentheses? -> ($x) {} vs. -> $x {}
or missed `:` in signature unpacking? -> &c:(Int) {}
in sub test at …
Kaiepi m: sub test( ($name = $_.HOW.name($_), |) ) { say $name }; test Promise.new
camelia Any
Kaiepi m: sub test(:$name = *.HOW.name(*)) { say $name }; test Promise.new 23:40
camelia Too many positionals passed; expected 0 arguments but got 1
in sub test at <tmp> line 1
in block <unit> at <tmp> line 1
timotimo where would that $_ come from, i wonder
Kaiepi m: sub test($, :$name = *.HOW.name(*)) { say $name }; test Promise.new
camelia Whatever
timotimo using the * in the method call like that will pass a literal Whatever constant