»ö« Welcome to Perl 6! | perl6.org/ | evalbot usage: 'p6: say 3;' or rakudo:, or /msg camelia p6: ... | irclog: irc.perl6.org or colabti.org/irclogger/irclogger_logs/perl6 | UTF-8 is our friend!
Set by moritz on 22 December 2015.
00:00 greppable6 joined, squashable6 joined, ChanServ sets mode: +v squashable6, committable6 left, committable6 joined, ChanServ sets mode: +v committable6, committable6 left
jnthn You can .^lookup the method and, iirc, .cando passed a Capture will give all of the canidates that could match. Then iterate over them and call them. Alternatively, could just put nextsame or callsame at the end of each candidate. 00:00
00:00 committable6 joined, ChanServ sets mode: +v committable6
jnthn sleep time; 'night 00:00
Kaiepi night 00:01
SmokeMachine m: class C { multi method bla(% (:$a, |)) {"a"}; multi method bla(% (:$b, |)) {"b"} }; my $c = C.new; say C.^lookup("bla").candidates.map: {.($c, {a => 1, b => 2})} 00:02
camelia (a b)
SmokeMachine jnthn: great! thanks! 00:03
Kaiepi ok this documentation is great
00:05 comborico1611 joined 00:06 skids joined
SmokeMachine m: multi bla(% (:$a!, |)) {"a"}; multi bla(% (:$b!, |)) {"b"}; say &bla.candidates.grep(*.cando: \({:1a, :2b}))>>.({:1a, :2b}) # :) 00:11
camelia (a b)
Voldenet I'd force my way with slightly more javascriptish solution 00:12
m: class C { method bla(Hash $c) { $c.map({ %!x{.key}(.value) }) }; has %!x = { a => {"A: $^a"}, b => {"B: $^b" } }}; say C.new.bla: {a => 1, b => 2}
camelia (A: 1 B: 2)
00:12 konsolebox left
Voldenet not that it's very elegant 00:13
and doesn't support multiple args, sadly 00:16
00:24 markong left 00:26 konsolebox joined 00:28 lizmat left 00:44 pierre_ joined 00:49 comborico1611 left 01:04 Cabanossi left 01:05 Cabanossi joined 01:09 aborazmeh joined, aborazmeh left, aborazmeh joined
Geth doc: 9a718ea10e | (Zoffix Znet)++ (committed using GitHub Web editor) | doc/Type/Str.pod6
Make linkable things links in subst-mutate desc
01:12
synopsebot Link: doc.perl6.org/type/Str
01:22 noganex left 01:23 rindolf left 01:29 cdg_ joined 01:32 cdg left 01:34 cdg_ left 02:06 cdg joined 02:11 cdg left, Actualeyes joined 02:15 konsolebox left, Lynx_ left
SmokeMachine m: my $c = class C {has Int $.a handles * = 3}.new; say $c.is-prime; $c does role :: {}; $c.is-prime 02:15
camelia True
No such method 'is-prime' for invocant of type 'C+{<anon|75388240>}'
in block <unit> at <tmp> line 1
SmokeMachine handles is being lost on "does"
02:16 Lynx_ joined 02:17 konsolebox joined 02:20 jeromelanteri joined
Geth doc: e79d237af6 | (Zoffix Znet)++ | doc/Type/Str.pod6
Clarify return of Str.subst-mutate with multi-match options

Rakudo fix: github.com/rakudo/rakudo/commit/77794a28aa
   github.com/rakudo/rakudo/commit/e0d39321e1
Spec: github.com/perl6/roast/commit/c537763529
   github.com/perl6/roast/commit/8c358cfc87
02:20
synopsebot Link: doc.perl6.org/type/Str
02:46 ilbot3 left 02:55 pierre_ left 02:57 ilbot3 joined, ChanServ sets mode: +v ilbot3 02:59 pierre_ joined 03:01 aborazmeh left 03:17 pierre_ left 03:19 pierre_ joined 03:34 cdg joined 03:39 Actualeyes left 03:42 Kaiepi left 03:50 Kaiepi joined 04:07 Cabanossi left 04:09 Cabanossi joined 04:15 espadrine left 04:20 pierre_ left, pierre joined 04:37 skids left 04:46 cdg left 05:08 khw left 05:18 eliasr left 05:24 xinming left 05:26 xinming joined 05:28 Actualeyes joined 05:35 AlexDaniel left 05:46 wamba joined, curan joined 05:50 pierre left, pierre joined 06:10 konsolebox left 06:12 konsolebox joined 06:16 AlexDaniel joined 06:17 konsolebox left 06:18 konsolebox joined 06:23 konsolebox left, konsolebox joined 06:31 konsolebox left 06:32 konsolebox joined 06:46 cdg joined 06:50 cdg left
Geth doc: 653a7994d3 | (JJ Merelo)++ | doc/Type/Signature.pod6
Un-confusing Signature example

Inverting the order by using $sig in the `given` clause, I expect to make it a bit less confusing. Also inclusing the `default` clause, just in case. Moved `mismatch` to the first, to show that it's checked against. Hope this closes #1777, if it does not, just let me know.
07:06
synopsebot Link: doc.perl6.org/type/Signature
07:08 wamba left 07:09 darutoko joined 07:17 abraxxa joined 07:18 abraxxa left 07:19 abraxxa joined 07:24 abraxxa left 07:26 sena_kun joined, tt left 07:27 tt joined, releasable6 left, releasable6 joined 07:30 espadrine joined 07:39 abraxxa joined, konsolebox left 07:40 konsolebox joined 07:47 noganex joined, konsolebox left 07:49 konsolebox joined, espadrine left 07:57 psychoslave joined 08:17 Voldenet left, wamba joined 08:18 notbenh left 08:22 notbenh joined 08:23 Voldenet joined, Voldenet left, Voldenet joined 08:24 lowbro joined, lowbro left, lowbro joined 08:40 konsolebox left 08:42 wamba left, konsolebox joined 09:07 cdg joined 09:12 cdg left, zakharyas joined 09:13 AlexDaniel left 09:14 kaare_ left 09:15 Guest8794 joined
Guest8794 ls 09:15
El_Che Desktop Documents Downloads Music Pr0n 09:16
09:16 pmurias joined, kaare_ joined
moritz lsb_release -a 09:18
09:20 TEttinger left, Guest8794 is now known as tiny 09:21 tiny is now known as Guest16234
Guest16234 ls 09:21
help
09:21 Guest16234 is now known as tiny`, tiny` is now known as tiny911
tiny911 ls 09:22
clear
ls
El_Che try this -> /quit
09:25 dakkar joined, rindolf joined 09:30 pmurias left, pmurias joined 09:34 psychoslave left 09:36 zakharyas left 09:37 zakharyas joined 09:38 pmurias left 09:42 ReadersDigest joined, tiny911 left 09:45 pmurias joined, koto joined 09:46 koto left
pmurias harc.github.io/seymour-live2017/ - fairly cool live programming work/hopefully we can hook it up to Perl 6 once it's language agnostic 09:46
09:47 sena_kun left
pmurias it's interesting if the slow parsing price Perl 6 pays for it's complex and pluggable grammar is worth the increased barrier to tooling in the long run 09:48
09:49 Lynx_ left
moritz that is a quetion I've asked myself multiple times, with no clear answer yet 09:55
09:58 psychoslave joined 09:59 troys left 10:12 konsolebox left 10:15 konsolebox joined
DrForr Well, I'm hoping to be able to give a more definitive answer in the near future. 10:22
10:31 zeddy_k joined, konsolebox left 10:33 konsolebox joined 10:46 abraxxa left
pmurias DrForr: how so? 10:48
DrForr I'm waiting to hear if the Apache Foundation is able to sponsor me to do syntax highlighting for Perl 6/Eclipse. 10:50
pmurias DrForr: using the builtin Perl 6 grammar or the usuall approach of having something adhoc that kind of works? 10:51
10:52 Lynx_ joined
DrForr pmurias: That's a good question actually. I haven't decided, although I suspect the usual suspects (too little time and its friends) will force hte latter. 10:54
10:56 psychoslave left 10:57 rindolf left 11:01 konsolebox left 11:03 konsolebox joined, Actualeyes left
tbrowder hi, #perl 11:03
11:07 rindolf joined
tbrowder can anyone running debian 8 please describe the base java packages they are running? i have been using the sun/oracle ones for years and need to get to version 1.8 (however that translates into the obscure java naming system). thanks. 11:07
11:10 konsolebox left
Kaiepi openjdk? 11:10
11:12 konsolebox joined
moritz openjdk-7-jre-headless 11:13
but that's version 7
openjdk-8-jre-headless is available in Stretch
dunno if there are jessie backports for it 11:14
Kaiepi would you be able to build it from source?
moritz according to serverfault.com/questions/830636/c...ian-jessie it works from backports
11:17 konsolebox left 11:18 Kaiepi left
tbrowder moritz: thanks for the link! 11:18
11:19 Kaiepi joined, konsolebox joined 11:32 konsolebox left 11:34 konsolebox joined 11:36 Kaiepi left, |Sno| joined 11:37 g- left
|Sno| jnthn: Hi 11:37
11:37 pierre left 11:38 cdg joined, pierre joined
|Sno| jnthn: We would like to provide space and coffee etc. around GPW2018 for a Perl6 Hackathon (act.yapc.eu/gpw2018/) 11:39
If you're interested ...
11:41 psychoslave joined
|Sno| Or anyone else here ... but I have sth. special in mind asking jnthn direktly ... 11:41
11:43 pierre left
DrForr Just prodded him elsewhere. 11:43
11:46 zeddy_k left 11:47 zeddy_k joined, pmurias left 11:49 pmurias joined
tbrowder moritz: jvm link directions worked flawlessly, thanks! 11:50
moritz tbrowder: that's great, yw
11:56 Kaiepi joined 12:03 cdg left 12:11 foldr joined 12:17 Kaiepi left 12:21 Zoffix joined
Zoffix e: temp.perl6.party/temp.txt 12:21
evalable6 Zoffix, Successfully fetched the code from the provided URL.
Str $!unit = "K"
(36.6 degrees ...K unit => C)
6
Zoffix I'm so baffled by these results: why is $!unit K? Why is the string that follows wrapped in parens. Why does it show "K unit => C" instead of just 6. Why is Bridge not called. Why is the final answer 6? 12:22
I bet it's something dumb like a missing semicolon somewhere :| 12:26
ah, I see it 12:27
missing colon on bless
timotimo oooh, indeed
Zoffix e: temp.perl6.party/temp.txt 12:28
evalable6 Zoffix, Successfully fetched the code from the provided URL.
Str $!unit = "C"
36.6 degrees ...C
7726.956
"Unit is C"
"Unit is F"
"Unit is K"
Zoffix \o/
SmokeMachine m: my $c = class C {has Int $.a handles * = 3}.new; say $c.is-prime; $c does role :: {}; $c.is-prime # "does" loses the "handles" 12:31
camelia True
No such method 'is-prime' for invocant of type 'C+{<anon|53096992>}'
in block <unit> at <tmp> line 1
Zoffix SmokeMachine: just file tickets for anything you think is a bug: github.com/rakudo/rakudo/issues/new 12:34
12:38 zakharyas left 12:39 cdg joined, Zoffix left 12:43 konsolebox left, cdg left 12:44 konsolebox joined 12:46 eliasr joined, psychoslave left, psychoslave joined 12:47 Kaffe left 12:49 Kaffe joined, abraxxa joined 12:51 psychoslave left, aborazmeh joined, aborazmeh left, aborazmeh joined, psychoslave joined 12:52 pmurias left, pmurias joined
jnthn |Sno|: Originally I wasn't sure I could make GPW. Think maybe I can make some of it (the last conf day and hang around for Hackathon on the Saturday after), however. 13:10
|Sno| jnthn: do you have a few minutes for a more private chat? 13:11
jnthn |Sno|: Kinda, /msg me 13:12
13:13 wamba joined
Geth doc: 7060b488eb | (Zoffix Znet)++ | doc/Type/Real.pod6
Document Real.Bridge

A bit long-winded, but includes a real-ish example of use.
Closes github.com/perl6/doc/issues/1690 D#1690 Part of github.com/rakudo/rakudo/pull/1522 R#1522
13:23
synopsebot Link: doc.perl6.org/type/Real
synopsebot D#1690 [closed]: github.com/perl6/doc/issues/1690 [docs] Method `Bridge` is undocumented
R#1522 [open]: github.com/rakudo/rakudo/pull/1522 Remove the Bridge method from the numeric classes
13:27 zakharyas joined, aborazmeh left 13:29 zakharyas left
Voldenet wow, it's the first time i've used big font (more than 8) on perl6 and I can finally see all the symbols :D 13:29
Geth doc: eebfb35b3d | (Zoffix Znet)++ | doc/Type/Real.pod6
Point out code example has a limitation
13:30
13:30 zakharyas joined
Voldenet I really could use a tool, that'd translate utf-8 perl into ascii 13:31
13:38 lizmat joined 13:43 Voldenet left
moritz write it :-) 13:47
13:48 Voldenet joined, Voldenet left, Voldenet joined, jeromelanteri left
El_Che utf8 perl could be one of the few uses of the bar on macbook pros 13:49
14:07 wamba left 14:13 sena_kun joined 14:21 Guest8556 joined 14:23 Guest8556 left 14:24 curan left, konsolebox left 14:25 konsolebox joined 14:26 zakharyas left 14:29 zakharyas joined
Ulti ctrl+cmd+space does the same job FYI 14:29
14:29 unicodable6 left
Ulti even without the fancy bar 14:29
14:29 unicodable6 joined
buggable New CPAN upload: IRC-Client-Plugin-UrlTitle-1.1.0.tar.gz by TYIL cpan.metacpan.org/authors/id/T/TY/...1.0.tar.gz 14:32
14:33 skids joined 14:42 konsolebox left 14:44 konsolebox joined 14:45 foldr left, leonzhou joined
leonzhou hej 14:45
i just started to learn perl 14:46
14:46 psychoslave left, psychoslave joined
tadzik hey 14:47
leonzhou hey man 14:49
tadzik
are u talking with me ?
i am new leaener , need help 14:50
tadzik I guess I am now, yes
sure what's the problem?
leonzhou cool , where are u
14:51 psychoslave left
tadzik I'm right here, on the internet :) 14:51
14:51 psychoslave joined
leonzhou just need some advices 14:51
[Coke] note that this is Perl 6, not Perl 5, just in case.
leonzhou i am your country
14:51 cdg joined
leonzhou i use perl 6 , 14:52
by the way , what is dig difference between 5 and 6
Geth doc: 51904c9281 | (Will "Coke" Coleda)++ | doc/Type/Signature.pod6
remove trailing whitespace
14:53
doc: e40b02a299 | (Will "Coke" Coleda)++ | doc/Type/Str.pod6
fix typo
synopsebot Link: doc.perl6.org/type/Signature
Link: doc.perl6.org/type/Str
14:54 evalable6 left, evalable6 joined 14:56 cdg left 15:01 AlexDaniel joined 15:02 Zoffix joined
Zoffix leonzhou: there're separate, wildly different language these days. The names are similar only because ~16 years ago Perl 6 was meant to be the next version of Perl 5, but eventually those goals diverged and we got a separate language, with Perl 5 making its own set of improvements. 15:04
m: print "0" && "I am a Perl 6 program\n" || "I am a Perl 5 program\n" 15:06
camelia I am a Perl 6 program
Zoffix Even as something as basic as ^ that prints differnt output if run with `perl` interpreter.
ilmari perlbot: eval: print "0" && "I am a Perl 6 program\n" || "I am a Perl 5 program\n" 15:07
perlbot ilmari: I am a Perl 6 program
ilmari perlbot: eval5: print "0" && "I am a Perl 6 program\n" || "I am a Perl 5 program\n"
perlbot ilmari: Stored eval5: print "0" && "I am a Perl 6 program\n" || "I am a Perl 5 program\n"
ilmari perlbot: eval5.26: print "0" && "I am a Perl 6 program\n" || "I am a Perl 5 program\n"
perlbot ilmari: I am a Perl 5 program 1
leonzhou hej camelia , it seems i use same as u 15:08
Zoffix m: print "I am a Perl ", 5+(!!"0"), " program\n" 15:09
camelia I am a Perl 6 program
Zoffix A bit shorter
ilmari perlbot: eval5.26: print "I am a Perl ", 5+(!!"0"), " program\n" 15:11
perlbot ilmari: I am a Perl 5 program 1
ilmari (the 1 is the return value from print)
15:11 leonzhou left
buggable New CPAN upload: IRC-Client-Plugin-UrlTitle-1.1.1.tar.gz by TYIL cpan.metacpan.org/authors/id/T/TY/...1.1.tar.gz 15:12
15:14 cdg joined
moritz lots of Perl 6 discussion on twitter right now: twitter.com/andrewshitov/status/96...9716774913 15:16
15:16 bisectable6 left, bisectable6 joined, ChanServ sets mode: +v bisectable6 15:17 AlexDaniel left, ReadersDigest left 15:18 Exodist left
Zoffix m: sub love {return}; print "I love Perl ", 5+!!(love(),), "\n" 15:19
camelia I love Perl 6
Zoffix perlbot: eval5.26: sub love {return}; print "I love Perl ", 5+!!(love(),), "\n"
15:19 Exodist joined
perlbot Zoffix: I love Perl 5 1 15:19
Zoffix Another diff :)
Oh wait, I'm overthinking it. 15:20
m: print "I love Perl ", 5+((),), "\n"
camelia I love Perl 6
Zoffix perlbot: eval5.26: print "I love Perl ", 5+((),), "\n"
perlbot Zoffix: I love Perl 5 1 💑
moritz I'm sure you can do fun things with 5 & 6 == 6 or so 15:23
Zoffix m: print "I love Perl ", (5, 6)[~1], "\n" 15:25
camelia I love Perl 6
Zoffix perlbot: eval5.26: print "I love Perl ", (5, 6)[~1], "\n"
perlbot Zoffix: I love Perl 5 1
Zoffix :)
15:27 Zoffix left 15:29 zakharyas left 15:34 huf left
caasih So is it unwise to learn Perl 6 and then Perl 5? If my final goal is to understand pugs and the diverged moment in my next 5 or 10 years. 15:37
moritz I don't see why you have to learn Perl 5 at all to understand Pugs 15:39
El_Che caasih: do you understand haskell? 15:40
caasih El_Che: I know some haskell. I know some basic type classes like functor and monad. But I can’t understand advanced topics like lenses. 15:42
El_Che pretty much the only thing I remember from pugs was that it was written in haskell
caasih moritz: Ok. So I just learn to program in Perl 6 first. And I can forget about Perl 5 for now. 15:43
15:43 huf joined
caasih El_Che: I read some dev logs about pugs but I can’t understand junctions at that moment. 15:43
Does Perl 5 have junctions? Why we need them? I didn’t notice them in other languages like C or JS. 15:45
moritz caasih: maybe docs.perl6.org/type/Junction.html helps?
El_Che clarify it a little for me. Are you a haskell afficionado, an Computer Science historian that want to figure how pugs worked? Or do you want to know how Junctions work in Perl 6?
moritz no, Perl 5 doesn't have them
El_Che if the latter, the Runtime of Perl 6 is Rakudo now. Pugs was abandoned
moritz and they are mostly a convience
15:46 zakharyas joined
caasih El_Che: I think I am the historian in this case. 15:47
El_Che caasih: ok, thx for clarifying 15:48
there are people around here that worked on pugs and may have some answers
caasih I may not use high level languages like Perl 6 or Haskell in my career. But I’d like to know stories about them in my free time. 15:49
El_Che++ cool, thanks for the advice. 15:50
moritz++ for the link
15:55 khw joined
Voldenet It isn't unwise to learn perl6 and then perl5, they are different languages 15:59
perl6 is a fun toy language
I believe perl5 to be used more in real world environments 16:02
16:02 wamba joined
El_Che Voldenet: of course is Perl 5 more widely used being a popular lang with 30y history. No need to call perl6 a "toy language" though 16:05
16:07 lucasb joined
Voldenet I call that every language that is fun to use 16:08
El_Che a 'it's not you, it's me" thing? 16:09
Voldenet Yeah, 't was meant to be complimentary :P 16:10
El_Che :)
lucasb Any type object can be coerced to Numeric and they will return integer zero (and emit a warning). Method .Numeric is inherited from Mu. 16:32
But what about the actual numeric types, can't they overload the .Numeric method to return a value of their type?
m: quietly say (.WHAT for +Num, +Rat, +Complex)
camelia ((Int) (Int) (Int))
lucasb wouldn't you like if this ^^ returned ((Num) (Rat) (Complex)) ? 16:33
the actual values returned would then be (0e0, 0.0, 0+0i) or (NaN, 0.0, 0+0i) 16:36
any opinions?
16:40 psychoslave left 16:43 troys joined 16:45 Zoffix joined
Zoffix lucasb: I recall chasing down the "undefined numerics are zero" thing a year or so ago and I recall rage-quitting and wishing we never carried over that feature from Perl 5. I forget the exact details tho. 16:46
m: Rat + 1 16:47
camelia WARNINGS for <tmp>:
Useless use of "+" in expression "Rat + 1" in sink context (line 1)
Cannot look up attributes in a Rat type object
in block <unit> at <tmp> line 1
Zoffix That probably was one of them. i.e., sure, you can make Rat.Numeric return <0/1>, but, Numeric isn't always used in operations
m: Int² 16:49
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
Zoffix And many operations don't work with type objects, so why do we even have "undef is zero" thing in some random places.
When is it useful? 16:50
m: class { method z (Rat $x) { say "Numerator is {.nude.head}" } }.new.z: Rat 16:52
camelia No such method 'nude' for invocant of type 'Any'. Did you mean any of these?
none
note

in method z at <tmp> line 1
in block <unit> at <tmp> line 1
Zoffix m: class { method z (Rat $x) { say "Numerator is {$x.nude.head}" } }.new.z: Rat
camelia Cannot look up attributes in a Rat type object
in method z at <tmp> line 1
in block <unit> at <tmp> line 1
Zoffix And there are plenty of custom places where type Numeric objects would explode instead of being coerced to 0. So really, I wish we'd remove this whole idea entirely. 16:53
pmurias Zoffix: do we have a lot of tests depend on that? 16:55
Zoffix I'm about to test it. 16:56
timotimo it looks like state variables in `perl6 -ne` don't behave right 16:57
Zoffix There's also RT#130383
synopsebot RT#130383 [new]: rt.perl.org/Ticket/Display.html?id=130383 [BUG] perl6 -n does not set $_ when it's interpolated via a block
16:58 lowbro left
Zoffix timotimo: what's the code that doesn't work? perl6 -ne 'say $++' and perl6 -ne 'state $x; say $x++' seem to work OK 16:59
And RT#130383 is just a mis-scoped QAST::Block 17:00
lucasb Zoffix: I guess I'm not surprised by "undef is zero" in the language. That's a behavior to be expected from a Perl language. I wouldn't mind if it goes away. I was just trying to make the already existent behavior a little more convenient. 17:02
Zoffix lucasb: is it really expected though? I imagine modern practices fatalize those warnings 17:03
(`use strictures 2;` doesn't tho) 17:04
jnthn I've had production code survive (desirably) in the case of missing data thanks to that
Rather than crash and burn
(Which wouldn't have been useful) 17:05
ZzZombo m: say Int+Str
camelia Use of uninitialized value of type Int in numeric context
0
in block <unit> at <tmp> line 1
Use of uninitialized value of type Str in numeric context
in block <unit> at <tmp> line 1
jnthn Certainly I prefer to handle such things explicitly, but sometimes things are unexpectedly missing.
Zoffix jnthn: I'd say that's pure luck. Had you used any of the ops that expect a :D value on that value, then it'd crash and burn.
jnthn Zoffix: I was thinking as much about Perl 5 as Perl 6 17:06
Zoffix pmurias: making Mu.Real and Mu.Numeric return 42 instead of 0 makes these stresstests fail: gist.github.com/zoffixznet/310e04b...0ff09cbbc6
jnthn Zoffix: Just saying that I'd lean towards "try to consistently warn and behave well" than "rip it out"
Zoffix Based on those tests results, it's probably too deeply ingraned to rip out by now 17:07
jnthn Yeah, I consider it a part of the forviging Perl-ish nature, so on that count I'd be hesitant to see it go 17:08
Zoffix Weird a bunch of S32-io/lock.t tests fail too :S
ZzZombo m: say Str++~Int.Bool 17:13
camelia Cannot resolve caller postfix:<++>(Str); the following candidates
match the type but require mutable arguments:
(Mu:U $a is rw)

The following do not match for other reasons:
(Bool:D $a is rw)
(Bool:U $a is rw --> Bool::False)…
17:13 setty1 joined
ZzZombo m: say Str++ 17:13
camelia Cannot resolve caller postfix:<++>(Str); the following candidates
match the type but require mutable arguments:
(Mu:U $a is rw)

The following do not match for other reasons:
(Bool:D $a is rw)
(Bool:U $a is rw --> Bool::False)…
ZzZombo m: say False++~Int.Bool
camelia Cannot resolve caller postfix:<++>(Bool); the following candidates
match the type but require mutable arguments:
(Mu:D $a is rw)
(Int:D $a is rw)
(Bool:D $a is rw)

The following do not match for other reasons:
(Bool:U $a…
ZzZombo m: say Int++~Int.Bool 17:14
camelia Cannot resolve caller postfix:<++>(Int); the following candidates
match the type but require mutable arguments:
(Mu:U $a is rw)

The following do not match for other reasons:
(Bool:D $a is rw)
(Bool:U $a is rw --> Bool::False)…
ZzZombo m: say ($=Int)++~Int.Bool
camelia 5===SORRY!5=== Error while compiling <tmp>
Pod variable $=Int not yet implemented. Sorry.
at <tmp>:1
------> 3say ($=Int7⏏5)++~Int.Bool
ZzZombo m: say ($= Int)++~Int.Bool
camelia 0False
ZzZombo m: say ($= Str)++~Int.Bool 17:15
camelia 0False
ZzZombo m: say ++$--
camelia 5===SORRY!5=== Error while compiling <tmp>
Operators '++' and '--' are non-associative and require parentheses
at <tmp>:1
------> 3say ++$--7⏏5<EOL>
expecting any of:
postfix
ZzZombo m: say ++($--) 17:16
camelia Cannot resolve caller prefix:<++>(Int); the following candidates
match the type but require mutable arguments:
(Mu:D $a is rw)
(Int:D $a is rw)

The following do not match for other reasons:
(Bool $a is rw)
(Mu:U $a is rw…
ZzZombo m: say ++(my $--)
camelia Cannot resolve caller prefix:<++>(Int); the following candidates
match the type but require mutable arguments:
(Mu:D $a is rw)
(Int:D $a is rw)

The following do not match for other reasons:
(Bool $a is rw)
(Mu:U $a is rw…
ZzZombo m: say ++(my $)--
camelia 5===SORRY!5=== Error while compiling <tmp>
Operators '++' and '--' are non-associative and require parentheses
at <tmp>:1
------> 3say ++(my $)--7⏏5<EOL>
expecting any of:
postfix
lucasb Zoffix, jnthn and others: I wish I could express my ideas a little better in english, but since I'm not a native speaker, it's difficult for me to continue the conversation. I'll try to put some effort in my writing skills... Just wanted to say that I appreciate all your comments. I learn a lot from you :)
ZzZombo m: say ++$ 17:17
camelia 1
ZzZombo m: say (++$)--
camelia Cannot resolve caller postfix:<-->(Int); the following candidates
match the type but require mutable arguments:
(Mu:D $a is rw)
(Int:D $a is rw)

The following do not match for other reasons:
(Bool:D $a is rw)
(Bool:U $a …
Zoffix ZzZombo: `$` is a anon state var. `my $` is an anon lexical var. ++ or -- on them return an Int. It's not in a writeable container, so you can't call another ++ or -- on it again. 17:20
17:20 zakharyas left 17:21 zakharyas joined
Zoffix lucasb: I'm stresstesting your proposal ATM FWIW 17:21
ZzZombo Ye, I got it, I just didn't read the messages right and thought they still complained about the parentheses.
lucasb Zoffix: which one? the "my num $x" defaulting to 0e0 or the overload .Numeric for number classes? 17:22
Zoffix: BTW, I appreciate your comment on that issue. I'll try to reply later. 17:23
Zoffix lucasb: the .Numeric for Numeric type objects. I'm against `num` defaulting to 0e0
Well, I'm -½ on it. No real strong feelings.
lucasb I found a new argument for my proposal. NaN is true! and I don't like that :) 17:24
m: say so my num $
camelia True
lucasb if it defaults to 0e0, then the uninitialized variable would false, which is more convenient, no?
m: say so my num $ = 0e0 17:25
camelia False
Zoffix hehe
OK, I'm -¼ on it then :)
lucasb just 0.25 to go :)
17:26 zeddy_k left
Zoffix m: dd <1.0>.Real 17:30
camelia RatStr.new(1.0, "1.0")
Zoffix Found a bug while I was at it :) lucasb++
17:30 zakharyas left 17:31 zakharyas joined 17:32 dakkar left 17:44 zakharyas left 17:47 zakharyas joined
Geth doc: fcd0359369 | (Zoffix Znet)++ | doc/Type/Numeric.pod6
Numeric does not provide .Real
18:00
synopsebot Link: doc.perl6.org/type/Numeric
18:05 zakharyas left
Zoffix ^ a second example for the Twitter convo moritz++ mentioned. Complex.Real throws X::Numeric::Real; Numeric.Real is not implemented. but the documentation doesn't document Complex.Real and erroneously claims Numeric.Real is both implemented and throws X::Numeric::Real if the coerced value does not equal to numeric :S 18:09
18:10 ZzZombo left
Zoffix And the Rakudo impl has Complex.coerce-to-real public method. It's not documented or specced... So, was it ever meant to be public? The implementor knew. 18:12
moritz m: say (2+0i).Real
camelia 2
Zoffix m: say (2+1i).Real
camelia Cannot convert 2+1i to Real: imaginary part not zero
in block <unit> at <tmp> line 1
moritz m: try (2+1i).Real; say $!.^name
camelia X::Numeric::Real
SmokeMachine where's stored the default value of a attribute? 18:14
moritz in the Attribute object, I believe 18:15
18:15 zakharyas joined
moritz m: say class { has $.x = 42 }.^attributes[0].default 18:15
camelia No such method 'default' for invocant of type 'Attribute'
in block <unit> at <tmp> line 1
moritz m: say class { has $.x = 42 }.^attributes[0].perl
camelia Attribute.new
Zoffix P.S.: I'm about to commit a fix to docs for that (not just complaining :))
moritz ++Zoffix 18:16
SmokeMachine: I can't find it right now :(
maybe it's in $!build_closure 18:17
jnthn build_closure iirc
SmokeMachine m: say class C {has $.a = 42}.^attributes.head.^methods
camelia (<anon> <anon> <anon> <anon> <anon> <anon> <anon> <anon> <anon> <anon> <anon> <anon> <anon> <anon> <anon> <anon> <anon> <anon> <anon> <anon> <anon> compose apply_handles get_value set_value container readonly package inlined WHY set_why Str gist)
SmokeMachine m: say class C {has $.a = 42}.^attributes.head.^attributes
camelia (str $!name int $!rw int $!ro Mu $!required int $!has_accessor Mu $!type Mu $!container_descriptor Mu $!auto_viv_container Mu $!build_closure Mu $!package int $!inlined int $!box_target int $!positional_delegate int $!associative_delegate Mu $!why Mu …
jnthn Yup, there it is 18:18
moritz m: my $attr := class { has $.x = 42 }.^attributes[0]; my $bc := $attr.^attributes.grep(*.name eq '$!build_closure); say $bc.get_value($attr)
camelia 5===SORRY!5=== Error while compiling <tmp>
Unable to parse expression in single quotes; couldn't find final "'" (corresponding starter was at line 1)
at <tmp>:1
------> 3build_closure); say $bc.get_value($attr)7⏏5<EOL>
expecting …
moritz m: my $attr := class { has $.x = 42 }.^attributes[0]; my $bc := $attr.^attributes.grep(*.name eq '$!build_closure'); say $bc.get_value($attr)
camelia No such method 'get_value' for invocant of type 'Seq'
in block <unit> at <tmp> line 1
jnthn I think there's a method to fetch it though
moritz m: my $attr := class { has $.x = 42 }.^attributes[0]; my $bc := $attr.^attributes.grep(*.name eq '$!build_closure')[0]; say $bc.get_value($attr)
camelia No such method 'get_value' for invocant of type 'BOOTSTRAPATTR'
in block <unit> at <tmp> line 1
jnthn Oh, the method is just called .build
moritz m: say class { has $.x = 42 }.^attributes[0].build 18:19
camelia 42
SmokeMachine m: say class C {has $.a = 42}.^attributes.head.build
camelia 42
SmokeMachine thank you all!!
thanks jnthn !
moritz m: say class { has $.y = 4; has $.x = 42 * $.y }.^attributes[1].build 18:21
camelia 5===SORRY!5=== Error while compiling <tmp>
Virtual method call $.y may not be used on partially constructed object (maybe you mean $!y for direct attribute access here?)
at <tmp>:1
------> 3 class { has $.y = 4; has $.x = 42 * $.y7⏏5 }.…
moritz m: say class { has $.y = 4; has $.x = 42 * $!y }.^attributes[1].build
camelia
moritz m: say class { has $.y = 4; has $.x = 42 * $!y }.^attributes[1].build.perl
camelia method (<anon|51721056> $: ;; Mu $_) { #`(Method|35573464) ... }
Geth doc: d291c495df | (Zoffix Znet)++ | 7 files
Document/Fix docs for .Real/.Numeric on Numerics

  - Fix up some inaccuracies about .Real on Complex/Numeric
  - Remove prose on allomorphs about coercions and smartmatch
   for Numeric. The method itself is not concerned with those concepts.
  - Document behaviour of methods on :U Numerics:
   - Impl: github.com/rakudo/rakudo/commit/1dc1f038f1
   - Spec: github.com/perl6/roast/commit/f2d745f1a8
Zoffix $ ./perl6 -e 'quietly say (.WHAT for +Int, +Num, +Rat, +FatRat, +Complex, +NumStr, +RatStr, +ComplexStr, +IntStr)' 18:23
((Int) (Num) (Rat) (FatRat) (Complex) (Num) (Rat) (Complex) (Int))
lucasb: ^ works now
lucasb: and I changed my mind on `num` defaulting to NaN. The fact that unitialized value is true is kinda bad. I think that's the single case of that being so in all of our types. 18:25
So +1 on changing it. You now need to convince others :)
Zoffix &
18:26 Zoffix left 18:28 TEttinger joined
lucasb awesome, thanks Zoffix! 18:28
Geth doc: 6e3763b89e | (JJ Merelo)++ | doc/Language/operators.pod6
Changed some examples to a case that feels a bit more real

And shows intent refs #1748. Also separates code in different examples, leaving the text as text, so it addresses 4 and 5. It closes
Still it should also show an example where the method chaining does not work by using some data structure that can be used as the last argument to something, but does not have that something as a method.
18:43
synopsebot Link: doc.perl6.org/language/operators
doc: 3d76648f29 | (JJ Merelo)++ | 7 files
Merge branch 'master' of github.com:perl6/doc
18:46 brrt joined, AlexDaniel joined
Geth doc: c15d37a876 | (JJ Merelo)++ | doc/Language/operators.pod6
Remove trailing whitespaces.

This really closes #1739 and tip'o'the hat to @coke who usually takes care of this.
18:49
18:49 zakharyas left 18:50 lucasb left 18:51 pharv joined 18:56 darutoko left, SyrupThinker joined
Xliff If I want a grammar token to match the name, ala: "token DEFAULT { 'DEFAULT' }" is there a shortcut way to do this? 18:56
18:57 pmurias left
Xliff Because I have to do it.... a lot. 18:57
Defining this as <sym>, maybe?
19:00 Ven`` joined
moritz you can use the sym mechanism, yes 19:01
at least in proto tokens
19:03 Ven` joined 19:05 Ven` left, Ven` joined
Xliff What's the difference between proto tokens and normal ones? 19:06
In the case of something like DDL, would you use that mechanism for things like NULL, SELECT, DEFAULT, and so forth? 19:07
SmokeMachine m: my $a = class C {has $.a}.^attributes.first: { .name ~~ q[$!a] }; $a.^attributes.first: { .name ~~ q[$!build_closure] } # what's wrong with this?
camelia Type check failed in binding to parameter 'value'; expected Any but got BOOTSTRAPATTR (BOOTSTRAPATTR.new)
in block <unit> at <tmp> line 1
19:08 Ven`` left, travis-ci joined
travis-ci Doc build errored. JJ Merelo 'Remove trailing whitespaces. 19:08
travis-ci.org/perl6/doc/builds/341572957 github.com/perl6/doc/compare/3d766...5d37a87675
19:08 travis-ci left
buggable [travis build above] ✓ All failures are due to: timeout (1 failure). 19:08
SmokeMachine m: my $a = class C {has $.a}.^attributes.first: { .name ~~ q[$!a] }; $a.^attributes.grep: { .name ~~ q[$!build_closure] }
camelia ( no output )
Xliff SmokeMachine: Why ".name ~~ q[$!build_closure]"?
SmokeMachine grep works but first doesn't...
Xliff: I looking for the attribute called $!build_closure 19:09
19:13 cdg left 19:17 abraxxa left 19:21 Ven` left 19:22 Ven`` joined 19:46 amalia___ left 20:02 SyrupThinker left 20:09 brrt left 20:10 perlpilot_ joined 20:13 Ven`` left 20:15 Ven`` joined 20:37 khw left 20:39 MasterDuke left 20:40 cpage left 20:44 zakharyas joined 20:46 perlpilot_ left 20:57 Actualeyes joined 21:00 khw joined 21:03 pharv left 21:05 zakharyas left, zakharyas joined 21:06 zakharyas left, pharv joined, zakharyas joined 21:16 pharv left, Ven`` left, pharv joined 21:20 cdg joined 21:25 espadrine joined 21:29 wamba left 21:31 cpage joined, Ven`` joined 21:37 rindolf left 21:43 von_cheam joined 21:44 zakharyas left 21:46 Ven`` left
von_cheam Using this <<subset Char of Str where (*.chars == 1);>> to create a subtype for single-character strings gives me the warning <<Useless use of "==" in expression ".chars == 1" in sink context>> 21:46
Is there maybe a better/more perlish way to do this? If not, any ideas as to what I'm doing/thinking wrong?
Is it maybe interpreting "== 1" as "== True"?
moritz m: subset Char of Str where { .chars == 1 }; for '', 'a', 'aa' { say $_ ~~ Char } 21:48
camelia False
True
False
moritz von_cheam: ^^ this seems to be what you want
m: subset Char of Str where .chars == 1; for '', 'a', 'aa' { say $_ ~~ Char }
camelia False
True
False
moritz or even without braces
von_cheam Okay, thanks! It works with braces; I'll go with that! 21:50
skids Do you really want 1 char, or 1 byte?
21:51 Ven`` joined
geekosaur or codepoint 21:57
22:01 Ven`` left 22:03 Zoffix joined
Zoffix m: subset Char of Str where (*.chars == 1); 22:03
camelia WARNINGS for <tmp>:
Useless use of "==" in expression ".chars == 1" in sink context (line 1)
Zoffix That's a bug innit?
22:05 Ven`` joined, Ven`` left
skids m: sub a ($f where (*.chars == 1)) { $f.say }; a("4") 22:06
camelia WARNINGS for <tmp>:
4
Useless use of "==" in expression ".chars == 1" in sink context (line 1)
22:06 von_cheam left 22:07 cdg_ joined
Zoffix m: dd (*.chars == 1); 22:08
camelia { ... }
timotimo m: my num $foo = 1;
camelia This type cannot unbox to a native number: P6opaque, Int
in block <unit> at <tmp> line 1
timotimo m: my Num $foo = 1;
camelia 5===SORRY!5=== Error while compiling <tmp>
Cannot assign a literal of type Int (1) to a variable of type Num. You can declare the variable to be of type Real, or try to coerce the value with 1.Num or Num(1), or just write the value as 1e0
at <…
Zoffix goes with yes :)
timotimo ^- someone want to port this to native variables?
22:09 brrt joined 22:11 cdg left
Zoffix R#1525 22:13
synopsebot R#1525 [open]: github.com/rakudo/rakudo/issues/1525 Useless useless when parens used around whatevercode in where 22:14
Zoffix timotimo: that looks to be an error from MoarVM innit? Is there a way to tweak it in HLL? I think apl "cannot unbox" errors could use an improvement 22:15
/apl/all 22:16
22:17 skids left
timotimo oh it is? one sec. 22:17
nope, it's X::Syntax::Number::LiteralType in rakudo 22:18
Zoffix No, I mean the "canmot unbox" one
timotimo oh yes
i think it'd actually be super easy to do this, hold on.
22:19 pharv left
Zoffix g2g 22:19
22:19 Zoffix left, brrt left 22:20 pharv joined
timotimo i may already have the implementation done 22:21
22:23 Kaiepi joined 22:24 Kaiepi left 22:25 Kaiepi joined 22:26 MasterDuke joined
Xliff timotimo++ # Supa fast! 22:29
Zoffix++ # Just coz.
22:29 pharv left 22:30 sena_kun left
timotimo yeah, except i'm still trying to get it to work :D 22:32
22:35 Kaiepi left
timotimo spews debug prints :) 22:38
potentially problematically this turns a runtime error into a compiletime error. not sure if that is wanted? 22:40
22:41 setty1 left, bwisti joined
timotimo also, right now it suggests num(1) or 1.num %) 22:42
m: say 1.num
camelia No such method 'num' for invocant of type 'Int'. Did you mean any of these?
Num
sum

in block <unit> at <tmp> line 1
timotimo m: say num(1) 22:43
camelia Cannot invoke this object (REPR: P6num; num)
in block <unit> at <tmp> line 1
timotimo thought so
22:49 pharv joined 22:50 Kaiepi joined 22:52 pharv left, pharv joined 22:53 comborico1611 joined
timotimo Cannot assign a literal of type Int (1) to a native variable of type Num. You can declare the variable to be of type Real, or try to coerce the value with 1.Num or Num(1), or just write the value as 1e0 22:56
seems good
huh, this is strange 22:57
m: my Num $a = <1/2>
camelia 5===SORRY!5=== Error while compiling <tmp>
Cannot assign a literal of type Rat (0.5e0) to a variable of type Num. You can declare the variable to be of type Real, or try to coerce the value with 0.5e0.Num or Num(0.5e0), or just write the value a…
timotimo how did it get that representation ...
jnthn <1/2> is a Rat literal 22:59
timotimo yeah, but why does it .perl to 0.5e0 there? 23:00
jnthn Oh...that's a very good question
m: say <1/2>.perl
camelia 0.5
timotimo yeah, it's not there :D
jnthn Yeah, it's fishy but not *that* fishy :)
timotimo oh, of course 23:05
i + that
inside the optimizer; maybe that uses smart_numify or something like that
m: my Num $a = <1/2+3/4i>
camelia 5===SORRY!5=== Error while compiling <tmp>
Cannot assign a literal of type Complex (<0.5+0.75i>) to a variable of type Num. You can declare the variable to be of type Numeric, or try to coerce the value with <0.5+0.75i>.Num or Num(<0.5+0.75i>)…
timotimo in that branch i call the actual .Numeric method 23:06
23:07 mirlur[m] joined
timotimo m: say <1/2>.^name 23:09
camelia Rat
timotimo m: say < 1/2 >.^name 23:10
23:10 epony joined
camelia RatStr 23:10
timotimo ah, that's how you get that kind
Cannot assign a literal of type Rat (RatStr.new(0.5, "1/2")) to a native variable of type Num.
what exactly should be the right way here is a little muddy 23:12
23:13 epony left
Xliff finally reaches the dreaded <expr> in the DDL spec. 23:19
23:20 Alikzus left
SmokeMachine m: use Test; class C is Any {...}; role R[::T] {}; my R[C] $a; class C {}; isa-ok $a, R[C] # should it be ok? 23:22
camelia not ok 1 - The object is-a 'R[C]'
# Failed test 'The object is-a 'R[C]''
# at <tmp> line 1
# Actual type: R[C]
timotimo hm, is this more interning failures?
SmokeMachine m: use Test; class C is Any {...}; role R[::T] {}; my R[C] $a; class C {}; ok $a ~~ R[C]
camelia ok 1 -
23:23 cdg_ left 23:25 Rawriful joined 23:36 cdg joined 23:42 cdg left 23:55 _kristian left 23:56 skids joined