»ö« 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.
00:07 cpan-p6 left, cpan-p6 joined 00:21 cpan-p6 left, cpan-p6 joined 00:27 lucasb left 00:35 cpan-p6 left, cpan-p6 joined 00:50 cpan-p6 left, cpan-p6 joined 00:55 w_richard_w joined 01:05 cpan-p6 left, cpan-p6 joined 01:20 cpan-p6 left, cpan-p6 joined 01:27 aindilis left 01:30 aindilis joined 01:32 nekomune left, nekomune joined 01:39 aindilis left 01:40 aindilis joined 01:47 cpan-p6 left 01:48 cpan-p6 joined 01:53 nekomune left, nekomune joined 01:59 leont left 02:00 mephinet left 02:01 cpan-p6 left, cpan-p6 joined 02:15 cpan-p6 left 02:16 cpan-p6 joined 02:21 Ven`````` left 02:29 cpan-p6 left 02:30 cpan-p6 joined 02:31 MidCheck joined 02:43 cpan-p6 left 02:44 cpan-p6 joined 02:58 cpan-p6 left 02:59 cpan-p6 joined 03:02 zakharyas joined 03:12 cpan-p6 left 03:13 cpan-p6 joined 03:19 Maylay joined 03:20 ufobat_ joined 03:22 ufobat left 03:25 aindilis left 03:26 aborazmeh joined, aborazmeh left, aborazmeh joined, cpan-p6 left 03:27 aindilis joined, squashable6 left, cpan-p6 joined, squashable6 joined, ChanServ sets mode: +v squashable6 03:29 zacts joined 03:41 cpan-p6 left 03:42 cpan-p6 joined 03:56 cpan-p6 left 03:57 cpan-p6 joined 04:02 molaf joined 04:10 cpan-p6 left 04:11 cpan-p6 joined, epony left 04:22 xinming_ joined 04:24 epony joined 04:25 xinming left, cpan-p6 left 04:26 cpan-p6 joined 04:30 genese left 04:31 skaji left, hfjvjffju left, skaji joined 04:32 mithaldu_ left, Spot_ left, PotatoGim left, success joined, kawaii left, PotatoGim joined, isacl___ joined, syntaxman joined 04:33 success is now known as Guest34016, joy_ left, isacl__ left, Guest19311 left 04:34 kawaii joined, hfjvjffju joined, mithaldu_ joined, Spot_ joined 04:38 MidCheck left, joy_ joined 04:39 cpan-p6 left 04:40 cpan-p6 joined 04:42 kst left 04:45 zacts left 04:46 molaf left 04:53 cpan-p6 left 04:54 cpan-p6 joined 05:07 cpan-p6 left 05:08 cpan-p6 joined 05:21 cpan-p6 left 05:22 cpan-p6 joined 05:30 aborazmeh left 05:32 sauvin joined 05:46 kurahaupo left 05:47 kurahaupo joined 05:56 cpan-p6 left, cpan-p6 joined 06:02 syntaxman left 06:11 cpan-p6 left 06:12 cpan-p6 joined 06:25 cpan-p6 left 06:26 cpan-p6 joined, robertle left 06:32 aindilis left 06:33 aindilis` joined 06:38 cpan-p6 left, cpan-p6 joined 06:49 jmerelo joined 06:52 cpan-p6 left, cpan-p6 joined, aindilis` left 06:53 aindilis joined, kurahaupo left 06:55 domidumont joined 07:07 cpan-p6 left, cpan-p6 joined 07:12 aborazmeh joined, aborazmeh left, aborazmeh joined 07:21 cpan-p6 left 07:22 cpan-p6 joined 07:29 antoniogamiz joined
antoniogamiz good morning o/ 07:29
jmerelo antoniogamiz: hey! 07:35
07:36 jmerelo left
masak morning, #perl6 07:37
07:46 epony left 07:53 aborazmeh left 07:55 netrino_ joined, cpan-p6 left 07:56 cpan-p6 joined 08:09 rindolf joined 08:11 cpan-p6 left 08:12 cpan-p6 joined 08:28 cpan-p6 left, netrino_ left, cpan-p6 joined 08:31 w_richard_w left 08:33 aborazmeh joined, aborazmeh left, aborazmeh joined 08:42 cpan-p6 left, cpan-p6 joined 08:56 cpan-p6 left 08:58 cpan-p6 joined 09:05 ravenousmoose joined 09:06 Xliff left 09:07 ravenousmoose_ left 09:11 rindolf left, cpan-p6 left, cpan-p6 joined
antoniogamiz well, after some time traveling from issue to issue, I think I've more or less complete my proposal :) 09:18
the first sketch at least \o/
anyone insterested in the doc system can check it out here: github.com/antoniogamiz/perl6-gsoc-application 09:19
09:19 rindolf joined
antoniogamiz tbrowder: I'm very insterested in your feedback about it, when you have some free time please tell me :) 09:19
09:24 cpan-p6 left, cpan-p6 joined 09:28 yqt joined 09:35 samcv left 09:36 zakharyas left 09:38 cpan-p6 left, cpan-p6 joined, samcv joined
xinming_ 'does' will make object does the role, 'but' will make a new object and apply that role. Is there a good way to memorize this? Since I'm always confused about does-vs-but 09:39
I always need to check up the doc to confirm, which makes me think I need to find a better way to remmeber this. 09:40
09:43 robertle joined 09:50 aborazmeh left
xinming_ I just now get the idea, the does will do 'does' to class, which modifies the class itself, which is same as %var does ... 09:51
then, but is the other way.
09:53 cpan-p6 left
moritz xinming_: "but does the same as does, *but* it also clones first" 09:53
09:53 cpan-p6 joined
moritz that's my mnemonic for it 09:53
xinming_ Ok, both works. :-) 10:02
m: my @history = <c d e f>; @history[* - 1, * - 2].perl.say; Is there a shortcut for * - 1, * - 2 in this case? 10:04
camelia 5===SORRY!5=== Error while compiling <tmp>
Two terms in a row
at <tmp>:1
------> 3 Is there a shortcut for * - 1, * - 27⏏5 in this case?
expecting any of:
infix
infix stopper
xinming_ m: my @history = <c d e f>; @history[* - 1, * - 2].perl.say; # Is there a shortcut for * - 1, * - 2 in this case?
camelia ("f", "e")
10:10 cpan-p6 left 10:13 cpan-p6 joined 10:14 leont joined 10:17 ravenousmoose left 10:22 ravenousmoose joined 10:26 cpan-p6 left 10:27 ravenousmoose left 10:28 ravenousmoose joined 10:32 ravenousmoose left 10:33 cpan-p6 joined, ravenousmoose joined
tbrowder antoniogamiz: that is looking good to me. good idea to use a mini-docs. just make sure of complete doc tree coverage. the issue of pod parsing without execution is also a big seller. 10:35
10:35 pecastro joined
tbrowder SmokeMachine: i am not making progress. i can't keep working on red while the real-world case needs more immediate attention. this evening i plan to change the case into 3 parts: (1) the background, data and problem description and data modeling, (2) the crud description and implemention using curt tilmes' DBD::SQLite, and (3) the 10:48
crud solution with red.
10:50 ambs joined 10:51 yqt left
SmokeMachine tbrowder: what's the problem you are having? 10:51
10:51 cpan-p6 left, cpan-p6 joined 10:52 domidumont left
antoniogamiz tbrowder: thanks for your opinion :) 10:52
tbrowder it seems to be the relationships. i went back and tried to lay out the tables for sql as accurately as i can. then i tried to translate that to red using your suggestions as a guide. but i cannot successfully create a new person.attends entry. i cannot update thr PR until this evening, but i will push the current state then. 10:56
antoniogamiz: you are welcome
SmokeMachine: given my lack of rdbms experience, the whole problem may be in my basic layout of the tables. at least with my new plan i can understand modeling errors better before i introduce an orm approach. 11:01
11:02 eseyman left
tbrowder with red and its deep ast approach, maybe it could eventually do step 3 from the user's sql (which is almost there now i know). 11:03
11:07 epony joined, eseyman joined 11:08 cpan-p6 left, cpan-p6 joined
SmokeMachine tbrowder: the problem seems to be a Red bug... :( 11:22
tbrowder ok, sorry, but that makes me feel a bit better :) 11:24
easily fixable?
SmokeMachine tbrowder: I hope so... 11:29
tbrowder: is this what you are having?
www.irccloud.com/pastebin/StJaMxpJ/
tbrowder: that's not a fix (Ill still fix it) but probably if you change the name of the column `first` it will work... 11:33
tbrowder: ^^
11:48 cpan-p6 left
SmokeMachine tbrowder: fixed! github.com/FCO/Red/commit/2a4d4e5d...70d84fb0fc 11:48
11:52 cpan-p6 joined
SmokeMachine tbrowder: thank you for your help! 11:54
12:05 cpan-p6 left, cpan-p6 joined 12:06 Alchemy joined 12:07 kaare__ joined 12:10 tinita_ joined 12:12 oodani_ joined 12:14 spacedbat left, daemon left, oodani left, tinita left, sergot left, kaare_ left, Alchemy is now known as daemon 12:17 dotdotdot left 12:19 dotdotdot joined 12:20 spacedbat joined 12:22 cpan-p6 left, cpan-p6 joined 12:27 rindolf left, rindolf joined
tbrowder SmokeMachine: that error looks familiar! i’ll check yr fix tis evening, thanks! 12:33
12:39 cpan-p6 left, AlexDaniel left, robertle left 12:40 AlexDaniel joined, lucasb joined, cpan-p6 joined 12:53 domidumont joined 12:55 zakharyas joined 12:57 cpan-p6 left 12:58 cpan-p6 joined
titsuki bisectable: class A { has @.a; submethod BUILD(:@!a) {} }; class B { has @.b; submethod BUILD(:@!b) {} }; class C is A is B { method plot { say @.a; say @.b; } }; C.new(:b([1,2,3])).plot 13:00
bisectable6 titsuki, Bisecting by output (old=2015.12 new=787d5bf) because on both starting points the exit code is 0
titsuki, bisect log: gist.github.com/94b94708e110ee633a...c2c33dc22e
titsuki, (2017-10-07) github.com/rakudo/rakudo/commit/16...81067d3f8c
13:06 patrickb joined 13:07 antoniogamiz left, zakharyas left 13:14 cpan-p6 left 13:15 cpan-p6 joined 13:20 rindolf left 13:21 reach_satori joined 13:24 rindolf joined, rindolf left 13:27 rindolf joined 13:28 cpan-p6 left, cpan-p6 joined 13:44 cpan-p6 left 13:47 rindolf left 13:49 cpan-p6 joined 13:58 rindolf joined 14:04 rindolf left
xinming_ my (%last, %prev) := @history[* - 1, * - 2]; <--- Is use of := operator valid in this case? 14:04
Imean binding both %last and %prev
14:07 cpan-p6 left 14:08 robertle joined, Possum left, Possum joined 14:09 cpan-p6 joined, rindolf joined 14:11 jeromelanteri joined
moritz m: my @h = {:1a}, {:2a}; my (%l, %p) := @h; say %p 14:12
camelia {a => 2}
moritz seems it should work
14:18 TimToady left 14:26 cpan-p6 left
xinming_ Is the binding affects the var inside the declaration? 14:27
I hope so.
14:27 TimToady joined
xinming_ m: my @h = %({}); @h.perl.say; 14:28
14:28 cpan-p6 joined
camelia [] 14:28
xinming_ Why is this example won't create an empty hash inside the array?
m: my @h = %({}),; @h.perl.say; 14:29
camelia [{},]
xinming_ This version worked.
binding works for var declared 14:30
which is really nice. :-)
timotimo it's the "single argument rule" that causes the assignment to iterate the "outermost" iterable, which is the hash itself 14:31
yoleaux 02:59Z <MasterDuke> timotimo: if you check the logs here colabti.org/irclogger/irclogger_lo...9-03-22#l5 you'll see some discussion i had with ugexe about weird profile/spesh log results. you might have some comment
14:36 MasterDuke left 14:41 cpan-p6 left, cpan-p6 joined 14:42 Black_Ribbon left, jeromelanteri left 14:48 scimon joined 14:59 cpan-p6 left, cpan-p6 joined 15:01 AlexDaniel left, AlexDaniel joined 15:16 cpan-p6 left 15:18 cpan-p6 joined
tony-o notable6: libcsv module github.com/tony-o/perl6-libcsv 15:29
notable6 tony-o, Noted!
15:31 cpan-p6 left, cpan-p6 joined 15:48 MidCheck joined
lizmat tony-o: is there any reason you're not uploading to CPAN ? 15:56
16:04 zacts joined 16:07 cpan-p6 left 16:08 cpan-p6 joined, tinita_ is now known as tinita 16:10 robertle left 16:12 domidumont left 16:13 yqt joined 16:16 ravenousmoose left
kawaii Probably for the same reasons my modules aren't on CPAN, it's antiquated compared to just doing releases on github 16:19
16:21 jmerelo joined 16:24 reach_satori left
SmokeMachine m: class Bla:api<42> {}; class Ble:ble<42> {} # shouldn't it say 'ver', 'auth' and 'api'? 16:25
camelia 5===SORRY!5=== Error while compiling <tmp>
Cannot use adverb ble on a type name (only 'ver' and 'auth' are understood)
at <tmp>:1
------> 3class Bla:api<42> {}; class Ble:ble<42>7⏏5 {} # shouldn't it say 'ver', 'auth' and
expecti…
lizmat SmokeMachine: good catch 16:27
will fix
SmokeMachine :) 16:28
I think it should be a way to add possible adverbs to your class... 16:30
possible custom adverbs...
16:30 p6lert left
lizmat updated, but Geth appears to be AWOL 16:30
16:30 dalek joined, ChanServ sets mode: +v dalek, synopsebot joined, ChanServ sets mode: +v synopsebot, p6lert joined, Geth joined, ChanServ sets mode: +v Geth, cpan-p6 left 16:31 cpan-p6 joined
cpan-p6 New module released to CPAN! XML-XPath (0.9.3) by 03UFOBAT 16:32
tony-o lizmat: i don't have a cpan id 16:34
ugexe what is the use case for custom adverbs instead of using attributes?
lizmat tony-o: pause.perl.org/pause/query?ACTION=request_id :-) 16:35
ugexe tony-o: arent you metacpan.org/author/YNOTO ? 16:36
lizmat :-) 16:37
SmokeMachine ugexe: migration Bla:from<0.1>:to<0.2> { ... }
ugexe i do stuff like that via `role META[$version where * == 1] { }; role META[$version where * == 2] { }; META[...].new(...)` 16:38
SmokeMachine ugexe: but now Im thinking of: migration Bla:ver<0.2> { method from(v0.1) { ... } }
tony-o ah, i suppose..i don't recall getting an email about that going through 16:39
jmerelo ugexe: could that be a possible solution to this? stackoverflow.com/questions/552652...ed-subsets A bunch of roles would have to be defined, though... 16:40
SmokeMachine: you want Dockerfile phased building in Perl 6 syntax...
tony-o jmerelo: libyaml should build now, something weird happening in those makefiles with Build.pm/LibraryMake 16:41
SmokeMachine jmerelo: no, this: github.com/FCO/Red/issues/15 16:43
jmerelo tony-o: I'll try to check it out. Thanks for telling me.
16:44 cpan-p6 left
jmerelo SmokeMachine: I wouldn't complicate syntax more that it is now. You can simply keep using whatever you want to use from previous versions, and use IS DEPRECATED for whatever you want to stop using. 16:44
16:45 cpan-p6 joined, zacts left
SmokeMachine jmerelo: you think Red shouldn't make it easy to transform and move data from old version of a model to a new one? 16:47
16:52 patrickb left, zacts joined
jmerelo SmokeMachine: OK, I see what you mean. But you are using the metamodel to do that kind of things. Why don't you add an attribute via metamodel? 16:54
SmokeMachine jmerelo: what do you mean? 16:55
16:56 zacts left
jmerelo SmokeMachine: I'm not sure. I guess you don't want to use class attributes because they are reserved to the actual things stored in the database, but you could use something like class.^ver and class.^from to migrate 16:56
16:56 zacts joined
lizmat tony-o: mail to YNOTO is bounced with <<< 554 5.7.1 [email@hidden.address] Recipient address rejected: Access denied 16:57
SmokeMachine jmerelo: that's what Im doing here: github.com/FCO/Red/issues/15#issue...-475078080 17:04
jmerelo SmokeMachine: great :-) 17:05
SmokeMachine but this way can't handle some changes, as written here: github.com/FCO/Red/issues/15#issue...-475564988
jmerelo: ^^
jmerelo: so Im thinking of using the type Migration for encapsulate the models and the changes (as suggested by Xliff) 17:06
jmerelo: Im trying to see what would be the best way to do that... 17:07
jmerelo SmokeMachine: good luck! :-)
SmokeMachine jmerelo: `migration:from<1>:to<2>` is one way I thought be good... but that's not possible...
jmerelo: and I think it should be possible... :( (even if I don't use it...) 17:08
ugexe you'll never have 2 "Migration" types of different from/to in the same lexical scope at once? 17:09
you cant `use Foo:ver<1>; use Foo:ver<2>;` for instance -- its `{ use Foo:ver<1> }; { use Foo:ver<2> }`
17:10 cpan-p6 left
ugexe m: class Foo:ver<1> { }; class Foo:ver<2> { }; 17:10
camelia 5===SORRY!5=== Error while compiling <tmp>
Redeclaration of symbol 'Foo'
at <tmp>:1
------> 3class Foo:ver<1> { }; class Foo:ver<2>7⏏5 { };
expecting any of:
generic role
17:13 cpan-p6 joined, scimon left
SmokeMachine ugexe: yes, I know... I’m not sure yet what I should do for it... 17:16
17:17 sauvin left
ugexe you have two pieces of logic. $from for ultimately creating logic for *reading* the current format, and $to for ultimately creating logic for the output format. $to and $from don't need to be coupled 17:19
no one wants to create a migration for from=1 to=3 *AND* from=2 to=3 17:20
if you want to couple them then there is no need for from= at all, since it should always be $to - 1 17:22
and you apply each migration in sequence 17:23
17:34 cpan-p6 left
vrurg m: my Int $a; say $a > 0 17:35
camelia Invocant of method 'Bridge' must be an object instance of type 'Int', not a type object of type 'Int'. Did you forget a '.new'?
in block <unit> at <tmp> line 1
vrurg Not the best error message one could expect. ;)
17:38 cpan-p6 joined
jmerelo vrurg: not really... 17:42
vrurg: but I think the problem is that $a is not initialized, so contains something that can't be really converted to Int. That could be a better message, of course... 17:43
vrurg jmerelo: it's an easy thing to fix. Real operators are defined with :D where they should have it.
m: my Str $s; say $s ne "foo"
camelia Use of uninitialized value of type Str in string context.
Methods .^name, .perl, .gist, or .say can be used to stringify it to something meaningful.
True
in block <unit> at <tmp> line 1
vrurg This is more like it.
jmerelo vrurg: and Bridge is a Real method: docs.perl6.org/routine/Bridge 17:45
vrurg jmerelo: yep, it is.
I just have tried infix:«>» with Real:D and got more consistent message: 17:46
Use of uninitialized value of type Int in numeric context
in block <unit> at -e line 1
False
This is how it must be, I think.
jmerelo vrurg: the problem is probably in the context conversion. string context is clear. But in numeric context, there are multiple types of numbers. Default numeric context seems to be Real, so you're going to get those weird messages
m: my Rat $a; say $a > 0 17:47
camelia Cannot look up attributes in a Rat type object
in block <unit> at <tmp> line 1
jmerelo Now that's weird.
my Real $a; say $a > 0
m: my Real $a; say $a > 0
camelia Invocant of method 'Bridge' must be an object instance of type 'Real', not a type object of type 'Real'. Did you forget a '.new'?
in block <unit> at <tmp> line 1
vrurg With Real:D: Use of uninitialized value of type Rat in numeric context 17:48
17:48 zachk joined
tony-o notable6: deathbyperl6.com/whats-in-an-orm/ 17:48
notable6 tony-o, I cannot recognize this command. See wiki for some examples: github.com/perl6/whateverable/wiki/Notable
AlexDaniel use weekly: foo 17:49
vrurg I mean, if you constrain operators to act on defined Reals you'll get consistent error message across types – would it be any kind of number, or string.
tony-o weekly: deathbyperl6.com/whats-in-an-orm/
notable6 tony-o, Noted!
tony-o thanks AlexDaniel
AlexDaniel maybe notable6 should be called weeklyable :X
nobody is using it for any other purpose
tony-o lizmat: i tried signing up for cpan a couple of times, every time i never get an email with the password
jmerelo AlexDaniel: do you think it would be worth the while to add to the problem-solving-repo something about Rakudo's PRs and issues? 17:50
AlexDaniel jmerelo: like what?
17:50 cpan-p6 left
jmerelo AlexDaniel: like addressing them 17:50
17:51 cpan-p6 joined
AlexDaniel jmerelo: hmm… I don't understand the question, maybe I'm missing some context? 17:51
jmerelo AlexDaniel: there's like 1 issue closed every 3 days, and 3 issues opened every day. Some of them might be interesting, some not. Some of them are not even labelled.
AlexDaniel: some PRs are 6 years old. They should probably be closed. 17:52
tony-o password reset on cpan gives me: Sorry, the PAUSE failed to send an email.
Administration has been notified.
jmerelo AlexDaniel: I know the priority is to get the new versions going, but at some point in time something should be done about those issues. If they are not legitimate issues, just close them or "won't fix" is enough. 17:53
AlexDaniel jmerelo: lucasb++ worked hard on making the labels more useful and labeling unlabeled things (during the last two weeks or so)
jmerelo AlexDaniel: still. Look at this one: github.com/rakudo/rakudo/issues/1209
AlexDaniel jmerelo: yes, there's a problem 17:54
jmerelo AlexDaniel: not labeled, lizmat waiting for her question to be answered... At least that one is (somewhat) addressed...
17:55 zacts left
jmerelo AlexDaniel: look at the first one, which mentions fail.rakudo.party github.com/rakudo/rakudo/issues/1199 Either change it to blin, or close it... 17:55
17:55 adu joined
AlexDaniel jmerelo: fail.rakudo.party is still a thing, and I think it's a good idea to list github tickets there… 17:56
jmerelo AlexDaniel: OK, but that's not my point. If that's the case, it should maybe get addressed... to check that out and close it. 17:57
AlexDaniel jmerelo: yeah, but so is the case with many other tickets
jmerelo: now, what's the connection with problem-solving repo? 17:58
jmerelo AlexDaniel: the thing would be to ask for a part of the time devoted to new releases to go instead to solving old issues and PRs. Mainly PRs, but also issues.
AlexDaniel: have whoever is the patch pumpkin assign them to whoever is active at every moment, for instance. Or have a policy of having people review them. 17:59
AlexDaniel jmerelo: you wanna create a ticket like “We get more new tickets than we close”, and discuss our options?
jmerelo AlexDaniel: do _something_ about them, anyway.
AlexDaniel: That's the gist of it, yes. 18:00
AlexDaniel jmerelo: sure! Feel free to
jmerelo AlexDaniel: OK
18:02 kst joined 18:11 gregf_ left
Geth doc: 30b1bfd095 | (JJ Merelo)++ | 2 files
Leaving references to PREVIEW

It's a explanation of pragma. Added some clarification about where it can be found. Also reflow and some corrections.
18:18
18:26 MidCheck left 18:36 leont left 18:38 chakli joined
chakli p6: my $a="1-2 , ABCa!"; $a ~~ s/<[0..9 , \s ! - ]>+//; say $a 18:39
camelia ABCa!
chakli why is ! not replaced here? 18:40
timotimo probably needs a :g for "global" 18:42
tony-o p6: my $a="1-2 , ABCa!"; $a ~~ s:g/<[0..9 , \s ! - ]>+//; say $a 18:44
camelia ABCa
18:44 cpan-p6 left
chakli oh, Yeah. Thanks. 18:45
18:45 cpan-p6 joined 18:56 adu left, adu joined, adu left 18:57 adu joined, adu left 18:58 adu joined, netrino joined, adu left, adu joined 18:59 adu left, adu joined, adu left 19:00 cpan-p6 left, cpan-p6 joined 19:01 chakli left 19:02 sena_kun joined
sena_kun m: class M does Positional {}; class A { multi method a(M $a) { say "M" }; multi method a(Positional $pos) { say "Pos" } }; A.a((1,2,3)); A.a(M.new); 19:03
camelia Pos
M
cpan-p6 New module released to CPAN! Grammar-PrettyErrors (0.0.1) by 03BDUGGAN
sena_kun I can rely on this win of M, right?
19:04 robertle joined 19:13 cpan-p6 left
tony-o should be able to 19:15
sena_kun I hope so, Perl 6 wouldn't betray me over something so simple. :) 19:17
19:33 cpan-p6 joined
cpan-p6 New module released to CPAN! db-xoos (0.0.13) by 03YNOTO 19:33
19:35 hankache joined 19:46 cpan-p6 left 19:47 cpan-p6 joined, Grauwolf left, reach_satori joined, Grauwolf joined
hankache Hello #perl6 19:54
19:56 jmerelo left 19:59 haukex joined
hankache m: class a {has Int @.a-val;}; class b {has Int @.b-val;}; class ab is a is b {method plot {say @.a-val;say @.b-val;}} ;my $ab = ab.new(a-val => (10,9,11,8,7,10), b-val => [9,8,10,7,6,9]); $ab.plot; 20:00
camelia [10 9 11 8 7 10]
[]
hankache why is this not working?
sena_kun 6c: class a {has Int @.a-val;}; class b {has Int @.b-val;}; class ab is a is b {method plot {say @.a-val;say @.b-val;}} ;my $ab = ab.new(a-val => (10,9,11,8,7,10), b-val => [9,8,10,7,6,9]); $ab.plot; 20:02
20:02 supernovus joined
committable6 sena_kun, gist.github.com/d99c829cd85f182e85...e16ae6b008 20:02
sena_kun that's a regression
timotimo proofread my blog post? :) 20:03
wakelift.de/p/2dc5d8df-2b40-4706-8...d90d569b7/
sena_kun hankache, you should file a rakudo issue with this code.
hankache sena_kun will do. thanks 20:04
Geth ecosystem: 11112316a0 | (Timothy Totten)++ | META.list
Add XML::Entity::HTML to ecosystem

See github.com/supernovus/xml-entity-html
ugexe m: class A { has $.a; }; class B { has $.b }; class C is A is B { }; say C.new(:a(1), :b(2)) 20:05
camelia C.new(a => 1, b => Any)
ugexe a bit shorter
sena_kun m: class A { has $.a; }; class B { has $.b }; class C is B is A { }; say C.new(:a(1), :b(2)) 20:06
camelia C.new(b => 2, a => Any)
hankache 6c: class A { has $.a; }; class B { has $.b }; class C is B is A { }; say C.new(:a(1), :b(2)) 20:07
20:07 cpan-p6 left
committable6 hankache, gist.github.com/e854d4a6c9b0be9078...0dd76ec0f7 20:07
20:07 cpan-p6 joined
hankache ugexe thanks 20:07
ugexe looks like it was already bisected colabti.org/irclogger/irclogger_lo...03-22#l267
hankache was it reported or should i open an issue? 20:09
Geth doc: 234352b270 | (Trey Harris)++ | doc/Type/Signature.pod6
Type/Signature: changed confusing variable name

The variable `$closure` seems a bit prone to creating confusion here; while the variable itself _is_ participating in a closure, closing over the returned anonymous sub, we usually use "a closure" in the nounal form to refer to a function enclosing something or ocassionally to refer to a variable whose use is integral and obvious to the ... (20 more lines)
synopsebot Link: doc.perl6.org/type/Signature
20:09 haukex left
hankache issue submitted 20:18
20:20 Black_Ribbon joined 20:22 cpan-p6 left, cpan-p6 joined 20:26 supernovus left 20:47 cpan-p6 left 20:48 cpan-p6 joined 20:57 reach_satori left 20:58 hankache left, reach_satori joined 21:02 cpan-p6 left
guifa Is there a way to refer to take objects inside of a gather other than storing them in a list prior to taking them? 21:02
21:02 cpan-p6 joined
guifa something like, my @foo = lazy gather { for @bar { take $_ unless $_ (elem) @foo } 21:03
sena_kun well 21:06
oh, I failed. never mind me.
ugexe how would that even work? 21:07
checking that an element exists in the array you havent populated
before adding it
which means you have to understand beforehand that you are inside of a lazy iteration and that referring to @foo could only possibly mean the lazy values created up until that point 21:08
guifa ugexe: that was actually the point :-)
moritz but checking with (elem) would reify @foo, which blocks the 'gather', so deadlock
21:09 Xliff joined
Xliff \o 21:09
guifa Basically to only grab the unique values from @foo, but lazily (.unique doesn’t work, because the take bit isn’t a straight assignment)
Xliff m: sub a(Str @a) { say "Hi!"; }; a((1, 2, 3))
camelia Type check failed in binding to parameter '@a'; expected Positional[Str] but got List ($(1, 2, 3))
in sub a at <tmp> line 1
in block <unit> at <tmp> line 1
Xliff m: sub a(Str @a) { say "Hi!"; }; a(<a b c>) 21:10
camelia Type check failed in binding to parameter '@a'; expected Positional[Str] but got List ($("a", "b", "c"))
in sub a at <tmp> line 1
in block <unit> at <tmp> line 1
ugexe unique works
Xliff m: sub a(Str @a) { say "Hi!"; }; a(<a b c>.Array)
camelia Type check failed in binding to parameter '@a'; expected Positional[Str] but got Array ($["a", "b", "c"])
in sub a at <tmp> line 1
in block <unit> at <tmp> line 1
Xliff m: sub a(@a) { say "Hi!"; }; a(<a b c>.Array)
camelia Hi!
Xliff m: sub a(@a) { die "Dur!" unless @a.all ~~ Str; say "Hi!"; }; a(<a b c>.Array)
camelia Hi!
21:10 reach_satori left
Xliff m: sub a(@a) { die "Dur!" unless @a.all ~~ Str; say "Hi!"; }; a((1, 2, 4)) 21:10
camelia Dur!
in sub a at <tmp> line 1
in block <unit> at <tmp> line 1
guifa .unique is lazy, even after .map’ing it?
ugexe m: my $foo := unique gather for (1,2,3,4,4,4,4,5) { take $_ }; say $foo
camelia (1 2 3 4 5)
Xliff m: sub a(@a) { die "Dur!" unless @a.all ~~ Str; say "Hi!"; }; a(('a', 4))
camelia Dur!
in sub a at <tmp> line 1
in block <unit> at <tmp> line 1
21:11
Xliff m: sub a(@a) { die "Dur!" unless @a.all ~~ Str; say "Hi!"; }; a(('a', 'b'))
camelia Hi!
ugexe why wouldn't unique be lazy? its not like sort 21:12
not be lazy^
21:12 yqt left
TreyHarris If you need something fancier than unique can manage (though the :as and :with make it hard to understand what would be fancier), you can use a state array or *Hash variable in the gather, push each value you take, and do your check as needed. 21:13
ugexe that is also not the same memory wise 21:14
21:14 reach_satori joined 21:15 cpan-p6 left, cpan-p6 joined
TreyHarris I can't think what the gather's block would have that unique's :as and :with wouldn't have access to--in the case of a lazy, they'd be called at the same time, I believe? 21:18
ugexe you could certainly code a similar unique, but that is not what implementing with an array and hash really implies 21:21
sena_kun m: my Array[Int] $a = Array[Int].new(1,2,3); $a = $a.map(* + 2); 21:22
camelia Type check failed in assignment to $a; expected Array[Int] but got Seq ($((3, 4, 5).Seq))
in block <unit> at <tmp> line 1
TreyHarris Right, the unique is better--I was trying to imagine a case unique couldn't handle. I can't think of a non-contrived one. But if you could come up with one, it could be solved albeit less performantly
sena_kun is there a way to map values but preserve the type container?
timotimo guifa: you can use the sequence operator with a generator code block that takes a slurpy array argument, that will have all values so-far in it 21:24
ugexe ah for some reason i thought you were suggesting something else
sena_kun oooh, I probably can workaround it unrolling the map by hands.
guifa I think ugexe’s will actually probably work. I think I’m just going a bit crazy coding this logic 21:26
guifa . o O ( this must be why the RFC didn’t include many samples )
timotimo i only looked at the initial question, tbh; i didn't look at what other suggestions there were 21:27
21:28 cpan-p6 left, cpan-p6 joined 21:29 Possum left 21:31 Possum joined
sena_kun m: my $type = Int; my Array[$type] $ints = Array[$type].new 21:35
camelia Type check failed in assignment to $ints; expected Array[Any] but got Array[Int] (Array[Int].new())
in block <unit> at <tmp> line 1
sena_kun what am I missing?
lizmat m: BEGIN my $type = Int; my Array[$type] $ints = Array[$type].new 21:36
camelia ( no output )
lizmat sena_kun: the parameterization happens at compile time. At that moment, $type is not set yet 21:37
adding the BEGIN makes it set **before** the parametarization happens, so then it works
m: BEGIN my $type = Int; dd my Array[$type] $ints = Array[$type].new
camelia Array[Int] $ints = Array[Int].new()
sena_kun no workaround besides this? 21:38
lizmat EVAL ?
sena_kun the issue is that BEGIN won't help me here.
lizmat m: BEGIN my $type = Int; dd my Array[$type] $ints .= .new
camelia 5===SORRY!5=== Error while compiling <tmp>
Malformed mutator method call
at <tmp>:1
------> 3$type = Int; dd my Array[$type] $ints .=7⏏5 .new
expecting any of:
dotty method or postfix
lizmat m: BEGIN my $type = Int; dd my Array[$type] $ints .= new 21:39
camelia Array[Int] $ints = Array[Int].new()
sena_kun hmmm... actually, I can probably create a custom container that will hold an array and a type.
lizmat in any case, that would be shorter
sena_kun oh, I see the issue with my approach. ok, thanks. 21:40
21:52 cpan-p6 left 21:54 cpan-p6 joined
TreyHarris From the docs, these would seem to be kosher, but isn't: 22:04
m: sub make-array(::D $item --> Array[D]) { my Array[D] $f .= new($item); return $f }; say "compiled"; my $a = make-array(42);
camelia compiled
Died with X::TypeCheck::Assignment
in sub make-array at <tmp> line 1
in block <unit> at <tmp> line 1
Geth doc: uzluisf++ created pull request #2691:
Revise examples in the intro to lists.
22:09
22:09 lucasb left
TreyHarris Am I misreading the docs on capturing types in signatures? Or is the above a rakudo issue? 22:14
22:17 cpan-p6 left
TreyHarris m: sub make-int(Int $item --> Int:D) { return $item.clone }; my $s = make-int(42); say $s; 22:18
camelia 42
22:18 cpan-p6 joined
TreyHarris With explicit typing it works fine 22:18
Or I guess more closely 22:19
m: sub make-array(Int:D $item --> Array[Int]) { my Array[Int] $f .= new($item); return $f }; say "compiled"; my $a = make-array(42); say $a 22:20
camelia compiled
[42]
TreyHarris m: sub generic-sub(::T $item) { my T $x = $item; return $x }; say generic-sub(42) 22:24
camelia 42
22:24 sena_kun left
TreyHarris m: sub generic-sub(::T $item) { my T $x = $item.perl; return $x }; say generic-sub(42) 22:25
camelia Type check failed in assignment to $x; expected Int but got Str ("42")
in sub generic-sub at <tmp> line 1
in block <unit> at <tmp> line 1
TreyHarris Hmm... So T can be used in the body, but not in the signature?
that's not right either: 22:28
m: sub generic-sub(::T $item1, T $item2) { my $x = ($item1, $item2); return $x }; say generic-sub(42,40); say generic-sub(42, "Forty-two")
camelia (42 40)
Type check failed in binding to parameter '$item2'; expected Int but got Str ("Forty-two")
in sub generic-sub at <tmp> line 1
in block <unit> at <tmp> line 1
TreyHarris Huh, even this doesn't work for some reason, it's typing T as Int, not Cool: 22:32
m: my Cool \one = 42; my Cool \two = "Forty-two"; sub generic-sub(::T $item1, T $item2) { my $x = ($item1, $item2); return $x }; say generic-sub(42,40); say generic-sub(one, two) 22:33
camelia (42 40)
Type check failed in binding to parameter '$item2'; expected Int but got Str ("Forty-two")
in sub generic-sub at <tmp> line 1
in block <unit> at <tmp> line 1
tobs m: my Cool \one = 42; say one.^name 22:34
camelia Int
tobs (not that I know more than this about the issue, TreyHarris :-/) 22:35
TreyHarris tobs: good point, I'm having trouble getting a Cool value no matter how I write it--it seems to collapse to its constituent type as quickly as possible... like `sub whats-Cool(Cool() $x) { say $x.WHAT }` never says Cool 22:40
timotimo published that blog post: wakelift.de/2019/03/22/intermediat...snapshots/ 22:41
lizmat weekly: wakelift.de/2019/03/22/intermediat...snapshots/ 22:42
notable6 lizmat, Noted!
22:43 cpan-p6 left 22:44 cpan-p6 joined
TreyHarris m: sub foo(Cool(::T) $x, Cool(T) $y) { return ($x, $y) } 22:44
camelia 5===SORRY!5=== Error while compiling <tmp>
Unable to parse expression in typename; couldn't find final ')' (corresponding starter was at line 1)
at <tmp>:1
------> 3sub foo(Cool(::T) $x, Cool(7⏏5T) $y) { return ($x, $y) }
Geth marketing: uzluisf++ created pull request #24:
Add alternate logo
22:45
TreyHarris The Cool thing seems like a separate issue though, I was just trying to create a common supertype without creating my own classes in the example
22:53 MasterDuke joined
TreyHarris I think type constraints are checked in a way that's unintuitive to me. I mean, it feels to me like this should work, but it doesn't 22:53
m: sub hm(Bool $p) { say "$p as {Str($p)} is {so $p}." }; hm(42 but False);
camelia Type check failed in binding to parameter '$p'; expected Bool but got Int+{<anon|1>} (42)
in sub hm at <tmp> line 1
in block <unit> at <tmp> line 1
22:53 MasterDuke left, MasterDuke joined
TreyHarris m: sub hm(Bool $p) { say "$p as {Str($p)} is {so $p}." }; hm(False but 42); 22:54
camelia False as False is False.
TreyHarris m: sub hm(Bool $p) { say "$p as {Str($p)} is {so $p}." }; hm(False but "True"); # truly odd?!? 22:57
camelia True as True is True.
22:57 cpan-p6 left 22:58 cpan-p6 joined 23:04 rindolf left
TreyHarris m: sub hm(Bool $p) { if $p {say "YES, $p as {Str($p)} is {so $p}."} else {say "NO, $p as {Str($p)} is {so $p}."} }; my $x = False but "True"; hm($x); say "yes" if $x; say "no" unless $x; 23:06
camelia NO, True as True is True.
no
TreyHarris It gets weirder and weirder. 23:07
ugexe `42 but False` <-- what do you think this does that 42 should be a Int|Bool ? 23:09
23:11 Artie joined, cpan-p6 left 23:12 cpan-p6 joined
TreyHarris well, going by the examples that Larry first presented, vs 23:14
m: my $z = 42 but 'forty-two'; say $z; say "{+ $z}"; say $z + 0; say $z.WHAT;
camelia forty-two
forty-two
42
(Int+{<anon|1>})
TreyHarris It seems a bit reversed 23:15
tobs that makes sense to me. 23:17
TreyHarris In particular, I don't quite get why (0+$z).Str and (+$z).Str are different
timotimo +$z on an Int probably just returns self 23:18
tobs well that, I can only speculate that since $z is Int, +$z is a real no-op, whereas 0+$z constructs a new Int
tony-o think i have a patch for `require xyz:file<path>;` merging symbols to `xyz` 23:23
ugexe m: my $x = 42 but "fourty-two"; say $x.Int 23:26
camelia fourty-two
ugexe m: my $x = 42 but "fourty-two"; say $x.Num
camelia 42
ugexe thats certainly interesting
TreyHarris I understand why `42 but False` is an ad-hoc mixin type. I don't understand why it _can't_ be `(Int|Bool)+{<anon|*>}`. And I don't understand why the output «NO, True as True is True.␤no␤» was produced above. 23:27
It feels like "42 but False" is saying you want the value to be conformant to Bool as well as to Int, and not just by dint of Ints being generally conformant to Bool 23:28
ugexe wouldn't such a type have to be known at compile time? sure that can probably be determined from `but False` but for more general `but ...`?
TreyHarris Well, since the 'but' syntax was motivated by kludgey "0 but true" return values... 23:29
I mean, I recognize Failure is used in those contexts and is a better solution to the motivation. But that doesn't make the behavior less surprising 23:30
tobs `$x but $obj` creates and mixes in a new role that has "a single method named the same as $obj.^name and that returns $obj". If $obj is a Bool, that role is not the same as a Bool (Bool isn't even a role). 23:31
ugexe did you know? you can do `0 but True` from CLI! 23:32
sub MAIN(:$number) { say $number; say so $number }
evalable6 (Any)
False
ugexe --/number=1
m: sub MAIN(:$number) { say $number; say so $number }; BEGIN @*ARGS="--/number=1" 23:33
camelia 1
False
ugexe (thats really 1 but False but whatever)
23:36 cpan-p6 left 23:37 cpan-p6 joined
ryanth m: (5... ^10).join(',').say; # This is how my day's been going. 23:37
camelia 5,4,3,2,1,0,1,2,3,4,5,6,7,8,9
timotimo haha 23:39
TreyHarris tobs: Sure, but roles autopun from values and vice versa
timotimo m: (1 ... 10 ... 4 ... 20).join(",").say
camelia 1,2,3,4,5,6,7,8,9,10,9,8,7,6,5,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20 23:40
ryanth Heh, yeah that's definitely a fun operator. Slightly less fun after spending half an hour tracking down a single whitespace character bug. ;-) 23:41
TreyHarris It's a bit like the Cool stuff I was messing with above; it seems that you can't control coercion from the calling side, the best you can do is create a second temporary value of the exact type you want the coercion to see
timotimo ryanth: i wish i had an idea for how to make that easier to figure out :| 23:43
ryanth Indeed. I thought maybe an easily disabled warning if there is whitespace around ... but that has problems of its own. 23:44
ugexe m: sub whats-Cool(Cool(Mu) $x) { say $x.WHAT }; whats-Cool(Cool.new) # you said this never says Cool :P 23:46
camelia (Cool)
timotimo comma could highlight it ;)
tobs TreyHarris: yes, scratch my last half-sentence. What I wanted to say is that "but False" merely changes how the value coerces to Bool by mixing in a role derived from the value False. I wouldn't expect that to add Bool as an alternative to the value's type.
TreyHarris Perl's almost never had whitespace sensitivity in any place that everyday code tidying might affect; this is unusual in being a case where it has a big effect.
ryanth ^
I'm still trying to get my head out of Perl5 and into Perl 6 though, so I'm still extremely biased. :-) 23:47
timotimo i'm not sure i understand; what about foo(blah) vs foo (blah)?
you might be tempted to split the opening parenthesis off when splitting an argument list across multiple lines perhaps? 23:48
tobs m: ^10 ==> map { $_ ** 2 }␤==> my @a; say @a # ever been bitten by this? :-)
camelia 5===SORRY!5=== Error while compiling <tmp>
Bogus statement
at <tmp>:2
------> 3^10 ==> map { $_ ** 2 }7⏏5<EOL>
expecting any of:
postfix
prefix
statement end
term
tobs m: ^10 ==> map { $_ ** 2 } ==> my @a; say @a
camelia [0 1 4 9 16 25 36 49 64 81]
TreyHarris ugexe: I meant with values of subtypes of Cool... I'm not sure "Cool.new" is useful. Cool.new("str") or Cool.new(1) throws errors 23:49
tobs Vertical whitespace is significant there. After a closing brace it acts like a semicolon
23:50 ryanth_ joined, ryanth left
ugexe i code using *only* Cool.new -- its turing complete 23:50
TreyHarris ryanth: I don't think "Perl 6 is whitespace-sensitive in ways that Perl 5 is not" is an expected part of the headspace retraining, though
Certainly not in the way that if you're learning Python, you're told up front you need to care about whitespace 23:51
ryanth_ The "Traps" page is pretty good, but it could perhaps be organized a bit better. There is a "Whitespace" section near the top, but the bit about the ... operator is under the Operators section. I already knew about it and it was just a typo in my case, but I could see this information being easily missed by someone new. 23:53
docs.perl6.org/language/traps#Operators 23:54
23:54 cpan-p6 left 23:55 cpan-p6 joined