Perl 6 - the future is here, just unevenly distributed

IRC log for #perl6, 2018-02-14

Perl 6 | Reference Documentation | Rakudo

| Channels | #perl6 index | Today | | Search | Google Search | Plain-Text | summary

All times shown according to UTC.

Time Nick Message
00:00 greppable6 joined #perl6
00:00 squashable6 joined #perl6
00:00 committable6 joined #perl6
00:00 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 committable6 joined #perl6
00:00 jnthn sleep time; 'night
00:01 Kaiepi night
00:02 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 rakudo-moar 77794a28a: OUTPUT: «(a b)␤»
00:03 SmokeMachine jnthn: great! thanks!
00:03 Kaiepi ok this documentation is great
00:05 comborico1611 joined #perl6
00:06 skids joined #perl6
00:11 SmokeMachine m: multi bla(% (:$a!, |)) {"a"}; multi bla(% (:$b!, |)) {"b"}; say &bla.candidates.grep(*.cando: \({:1a, :2b}))>>.({:1a, :2b}) # :)
00:11 camelia rakudo-moar 77794a28a: OUTPUT: «(a b)␤»
00:12 Voldenet I'd force my way with slightly more javascriptish solution
00:12 Voldenet 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}
00:12 camelia rakudo-moar 77794a28a: OUTPUT: «(A: 1 B: 2)␤»
00:13 Voldenet not that it's very elegant
00:16 Voldenet and doesn't support multiple args, sadly
00:26 konsolebox joined #perl6
00:44 pierre_ joined #perl6
01:05 Cabanossi joined #perl6
01:09 aborazmeh joined #perl6
01:09 aborazmeh joined #perl6
01:12 Geth ¦ doc: 9a718ea10e | (Zoffix Znet)++ (committed using GitHub Web editor) | doc/Type/Str.pod6
01:12 Geth ¦ doc: Make linkable things links in subst-mutate desc
01:12 synopsebot Link: https://doc.perl6.org/type/Str
01:12 Geth ¦ doc: review: https://github.com/perl6/doc/commit/9a718ea10e
01:29 cdg_ joined #perl6
02:06 cdg joined #perl6
02:11 Actualeyes joined #perl6
02:15 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 rakudo-moar 829ea8e37: OUTPUT: «True␤No such method 'is-prime' for invocant of type 'C+{<anon|75388240>}'␤  in block <unit> at <tmp> line 1␤␤»
02:15 SmokeMachine handles is being lost on "does"
02:16 Lynx_ joined #perl6
02:17 konsolebox joined #perl6
02:20 jeromelanteri joined #perl6
02:20 Geth ¦ doc: e79d237af6 | (Zoffix Znet)++ | doc/Type/Str.pod6
02:20 Geth ¦ doc: Clarify return of Str.subst-mutate with multi-match options
02:20 Geth ¦ doc:
02:20 Geth ¦ doc: Rakudo fix: https://github.com/rakudo/rakudo/commit/77794a28aa
02:20 Geth ¦ doc:             https://github.com/rakudo/rakudo/commit/e0d39321e1
02:20 synopsebot Link: https://doc.perl6.org/type/Str
02:20 Geth ¦ doc: Spec:       https://github.com/perl6/roast/commit/c537763529
02:20 Geth ¦ doc:             https://github.com/perl6/roast/commit/8c358cfc87
02:20 Geth ¦ doc: review: https://github.com/perl6/doc/commit/e79d237af6
02:57 ilbot3 joined #perl6
02:57 Topic for #perl6 is now »ö« Welcome to Perl 6! | https://perl6.org/ | evalbot usage: 'p6: say 3;' or rakudo:,  or /msg camelia p6: ... | irclog: http://irc.perl6.org or http://colabti.org/irclogger/irclogger_logs/perl6 | UTF-8 is our friend!
02:59 pierre_ joined #perl6
03:19 pierre_ joined #perl6
03:34 cdg joined #perl6
03:50 Kaiepi joined #perl6
04:09 Cabanossi joined #perl6
04:20 pierre joined #perl6
05:26 xinming joined #perl6
05:28 Actualeyes joined #perl6
05:46 wamba joined #perl6
05:46 curan joined #perl6
05:50 pierre joined #perl6
06:12 konsolebox joined #perl6
06:16 AlexDaniel joined #perl6
06:18 konsolebox joined #perl6
06:23 konsolebox joined #perl6
06:32 konsolebox joined #perl6
06:46 cdg joined #perl6
07:06 Geth ¦ doc: 653a7994d3 | (JJ Merelo)++ | doc/Type/Signature.pod6
07:06 synopsebot Link: https://doc.perl6.org/type/Signature
07:06 Geth ¦ doc: Un-confusing Signature example
07:06 Geth ¦ doc:
07:06 Geth ¦ doc: Inverting the order by using $sig in the `given` clause, I expect to
07:06 Geth ¦ doc: make it a bit less confusing. Also inclusing the `default` clause,
07:06 Geth ¦ doc: just in case. Moved `mismatch` to the first, to show that it's checked
07:06 Geth ¦ doc: against. Hope this closes #1777, if it does not, just let me know.
07:06 Geth ¦ doc: review: https://github.com/perl6/doc/commit/653a7994d3
07:09 darutoko joined #perl6
07:17 abraxxa joined #perl6
07:19 abraxxa joined #perl6
07:26 sena_kun joined #perl6
07:27 tt joined #perl6
07:27 releasable6 joined #perl6
07:30 espadrine joined #perl6
07:39 abraxxa joined #perl6
07:40 konsolebox joined #perl6
07:47 noganex joined #perl6
07:49 konsolebox joined #perl6
07:57 psychoslave joined #perl6
08:17 wamba joined #perl6
08:22 notbenh joined #perl6
08:23 Voldenet joined #perl6
08:23 Voldenet joined #perl6
08:24 lowbro joined #perl6
08:24 lowbro joined #perl6
08:42 konsolebox joined #perl6
09:07 cdg joined #perl6
09:12 zakharyas joined #perl6
09:15 Guest8794 joined #perl6
09:15 Guest8794 ls
09:16 El_Che Desktop Documents Downloads Music Pr0n
09:16 pmurias joined #perl6
09:16 kaare_ joined #perl6
09:18 moritz lsb_release -a
09:21 Guest16234 ls
09:21 Guest16234 help
09:22 tiny911 ls
09:22 tiny911 ls
09:22 tiny911 ls
09:22 tiny911 ls
09:22 tiny911 clear
09:22 tiny911 ls
09:22 El_Che try this -> /quit
09:25 dakkar joined #perl6
09:25 rindolf joined #perl6
09:30 pmurias joined #perl6
09:37 zakharyas joined #perl6
09:42 ReadersDigest joined #perl6
09:45 pmurias joined #perl6
09:45 koto joined #perl6
09:46 pmurias https://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:48 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:55 moritz that is a  quetion I've asked myself multiple times, with no clear answer yet
09:58 psychoslave joined #perl6
10:15 konsolebox joined #perl6
10:22 DrForr Well, I'm hoping to be able to give a more definitive answer in the near future.
10:31 zeddy_k joined #perl6
10:33 konsolebox joined #perl6
10:48 pmurias DrForr: how so?
10:50 DrForr I'm waiting to hear if the Apache Foundation is able to sponsor me to do syntax highlighting for Perl 6/Eclipse.
10:51 pmurias DrForr: using the builtin Perl 6 grammar or the usuall approach of having something adhoc that kind of works?
10:52 Lynx_ joined #perl6
10:54 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.
11:03 konsolebox joined #perl6
11:03 tbrowder hi, #perl
11:07 rindolf joined #perl6
11:07 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:10 Kaiepi openjdk?
11:12 konsolebox joined #perl6
11:13 moritz openjdk-7-jre-headless
11:13 moritz but that's version 7
11:13 moritz openjdk-8-jre-headless is available in Stretch
11:14 moritz dunno if there are jessie backports for it
11:14 Kaiepi would you be able to build it from source?
11:14 moritz according to https://serverfault.com/questions/830636/cannot-install-openjdk-8-jre-headless-on-debian-jessie it works from backports
11:18 tbrowder moritz: thanks for the link!
11:19 Kaiepi joined #perl6
11:19 konsolebox joined #perl6
11:34 konsolebox joined #perl6
11:36 |Sno| joined #perl6
11:37 g- left #perl6
11:37 |Sno| jnthn: Hi
11:38 cdg joined #perl6
11:38 pierre joined #perl6
11:39 |Sno| jnthn: We would like to provide space and coffee etc. around GPW2018 for a Perl6 Hackathon (http://act.yapc.eu/gpw2018/)
11:39 |Sno| If you're interested ...
11:41 psychoslave joined #perl6
11:41 |Sno| Or anyone else here ... but I have sth. special in mind asking jnthn direktly ...
11:43 DrForr Just prodded him elsewhere.
11:47 zeddy_k joined #perl6
11:49 pmurias joined #perl6
11:50 tbrowder moritz: jvm link directions worked flawlessly, thanks!
11:50 moritz tbrowder: that's great, yw
11:56 Kaiepi joined #perl6
12:11 foldr joined #perl6
12:21 Zoffix joined #perl6
12:21 Zoffix e: https://temp.perl6.party/temp.txt
12:21 evalable6 Zoffix, Successfully fetched the code from the provided URL.
12:21 evalable6 Zoffix, rakudo-moar e0d39321e: OUTPUT: «Str $!unit = "K"␤(36.6 degrees ...K unit => C)␤6␤»
12:22 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:26 Zoffix I bet it's something dumb like a missing semicolon somewhere :|
12:27 Zoffix ah, I see it
12:27 Zoffix missing colon on bless
12:27 timotimo oooh, indeed
12:28 Zoffix e: https://temp.perl6.party/temp.txt
12:28 evalable6 Zoffix, Successfully fetched the code from the provided URL.
12:28 evalable6 Zoffix, rakudo-moar e0d39321e: OUTPUT: «Str $!unit = "C"␤36.6 degrees ...C␤7726.956␤"Unit is C"␤"Unit is F"␤"Unit is K"␤»
12:28 Zoffix \o/
12:31 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 rakudo-moar e0d39321e: OUTPUT: «True␤No such method 'is-prime' for invocant of type 'C+{<anon|53096992>}'␤  in block <unit> at <tmp> line 1␤␤»
12:34 Zoffix SmokeMachine: just file tickets for anything you think is a bug: https://github.com/rakudo/rakudo/issues/new
12:39 cdg joined #perl6
12:39 Zoffix left #perl6
12:44 konsolebox joined #perl6
12:46 eliasr joined #perl6
12:46 psychoslave joined #perl6
12:49 Kaffe joined #perl6
12:49 abraxxa joined #perl6
12:51 aborazmeh joined #perl6
12:51 aborazmeh joined #perl6
12:51 psychoslave joined #perl6
12:52 pmurias joined #perl6
13:10 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:11 |Sno| jnthn: do you have a few minutes for a more private chat?
13:12 jnthn |Sno|: Kinda, /msg me
13:13 wamba joined #perl6
13:23 Geth ¦ doc: 7060b488eb | (Zoffix Znet)++ | doc/Type/Real.pod6
13:23 Geth ¦ doc: Document Real.Bridge
13:23 Geth ¦ doc:
13:23 Geth ¦ doc: A bit long-winded, but includes a real-ish example of use.
13:23 Geth ¦ doc:
13:23 synopsebot Link: https://doc.perl6.org/type/Real
13:23 Geth ¦ doc: Closes https://github.com/perl6/doc/issues/1690 D#1690
13:23 Geth ¦ doc: Part of https://github.com/rakudo/rakudo/pull/1522 R#1522
13:23 synopsebot D#1690 [closed]: https://github.com/perl6/doc/issues/1690 [docs] Method `Bridge` is undocumented
13:23 synopsebot R#1522 [open]: https://github.com/rakudo/rakudo/pull/1522 Remove the Bridge method from the numeric classes
13:23 Geth ¦ doc: review: https://github.com/perl6/doc/commit/7060b488eb
13:27 zakharyas joined #perl6
13:29 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:30 Geth ¦ doc: eebfb35b3d | (Zoffix Znet)++ | doc/Type/Real.pod6
13:30 Geth ¦ doc: Point out code example has a limitation
13:30 Geth ¦ doc: review: https://github.com/perl6/doc/commit/eebfb35b3d
13:30 zakharyas joined #perl6
13:31 Voldenet I really could use a tool, that'd translate utf-8 perl into ascii
13:38 lizmat joined #perl6
13:47 moritz write it :-)
13:48 Voldenet joined #perl6
13:48 Voldenet joined #perl6
13:49 El_Che utf8 perl could be one of the few uses of the bar on macbook pros
14:13 sena_kun joined #perl6
14:21 Guest8556 joined #perl6
14:25 konsolebox joined #perl6
14:29 zakharyas joined #perl6
14:29 Ulti ctrl+cmd+space does the same job FYI
14:29 Ulti even without the fancy bar
14:29 unicodable6 joined #perl6
14:32 buggable New CPAN upload: IRC-Client-Plugin-UrlTitle-1.1.0.tar.gz by TYIL https://cpan.metacpan.org/authors/id/T/TY/TYIL/Perl6/IRC-Client-Plugin-UrlTitle-1.1.0.tar.gz
14:33 skids joined #perl6
14:44 konsolebox joined #perl6
14:45 foldr left #perl6
14:45 leonzhou joined #perl6
14:45 leonzhou hej
14:46 leonzhou i just started to learn perl
14:46 psychoslave joined #perl6
14:47 tadzik hey
14:49 leonzhou hey man
14:49 leonzhou tadzik
14:49 leonzhou are u talking with me ?
14:50 leonzhou i  am new leaener , need help
14:50 tadzik I guess I am now, yes
14:50 tadzik sure what's the problem?
14:50 leonzhou cool , where are u
14:51 tadzik I'm right here, on the internet :)
14:51 psychoslave joined #perl6
14:51 leonzhou just need some advices
14:51 [Coke] note that this is Perl 6, not Perl 5, just in case.
14:51 leonzhou i am your country
14:51 cdg joined #perl6
14:52 leonzhou i use perl 6 ,
14:52 leonzhou by the way , what is dig difference between 5 and 6
14:53 Geth ¦ doc: 51904c9281 | (Will "Coke" Coleda)++ | doc/Type/Signature.pod6
14:53 Geth ¦ doc: remove trailing whitespace
14:53 Geth ¦ doc: review: https://github.com/perl6/doc/commit/51904c9281
14:53 Geth ¦ doc: e40b02a299 | (Will "Coke" Coleda)++ | doc/Type/Str.pod6
14:53 Geth ¦ doc: fix typo
14:53 synopsebot Link: https://doc.perl6.org/type/Signature
14:53 synopsebot Link: https://doc.perl6.org/type/Str
14:53 Geth ¦ doc: review: https://github.com/perl6/doc/commit/e40b02a299
14:54 evalable6 joined #perl6
15:01 AlexDaniel joined #perl6
15:02 Zoffix joined #perl6
15:04 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:06 Zoffix m: print "0" && "I am a Perl 6 program\n" || "I am a Perl 5 program\n"
15:06 camelia rakudo-moar e0d39321e: OUTPUT: «I am a Perl 6 program␤»
15:06 Zoffix Even as something as basic as ^ that prints differnt output if run with `perl` interpreter.
15:07 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
15:07 ilmari perlbot: eval5: print "0" && "I am a Perl 6 program\n" || "I am a Perl 5 program\n"
15:07 perlbot ilmari: Stored eval5: print "0" && "I am a Perl 6 program\n" || "I am a Perl 5 program\n"
15:07 ilmari perlbot: eval5.26: print "0" && "I am a Perl 6 program\n" || "I am a Perl 5 program\n"
15:07 perlbot ilmari: I am a Perl 5 program  1
15:08 leonzhou hej camelia , it seems i use same as u
15:09 Zoffix m: print "I am a Perl ", 5+(!!"0"), " program\n"
15:09 camelia rakudo-moar e0d39321e: OUTPUT: «I am a Perl 6 program␤»
15:09 Zoffix A bit shorter
15:11 ilmari perlbot: eval5.26: print "I am a Perl ", 5+(!!"0"), " program\n"
15:11 perlbot ilmari: I am a Perl 5 program  1
15:11 ilmari (the 1 is the return value from print)
15:12 buggable New CPAN upload: IRC-Client-Plugin-UrlTitle-1.1.1.tar.gz by TYIL https://cpan.metacpan.org/authors/id/T/TY/TYIL/Perl6/IRC-Client-Plugin-UrlTitle-1.1.1.tar.gz
15:14 cdg joined #perl6
15:16 moritz lots of Perl 6 discussion on twitter right now: https://twitter.com/andrewshitov/status/963434309716774913
15:16 bisectable6 joined #perl6
15:19 Zoffix m: sub love {return}; print "I love Perl ", 5+!!(love(),), "\n"
15:19 camelia rakudo-moar e0d39321e: OUTPUT: «I love Perl 6␤»
15:19 Zoffix perlbot: eval5.26: sub love {return}; print "I love Perl ", 5+!!(love(),), "\n"
15:19 Exodist joined #perl6
15:19 perlbot Zoffix: I love Perl 5  1
15:19 Zoffix Another diff :)
15:20 Zoffix Oh wait, I'm overthinking it.
15:20 Zoffix m: print "I love Perl ", 5+((),), "\n"
15:20 camelia rakudo-moar e0d39321e: OUTPUT: «I love Perl 6␤»
15:20 Zoffix perlbot: eval5.26: print "I love Perl ", 5+((),), "\n"
15:20 perlbot Zoffix: I love Perl 5  1 💑
15:23 moritz I'm sure you can do fun things with 5 & 6 == 6 or so
15:25 Zoffix m: print "I love Perl ", (5, 6)[~1], "\n"
15:25 camelia rakudo-moar e0d39321e: OUTPUT: «I love Perl 6␤»
15:25 Zoffix perlbot: eval5.26: print "I love Perl ", (5, 6)[~1], "\n"
15:25 perlbot Zoffix: I love Perl 5  1
15:25 Zoffix :)
15:27 Zoffix left #perl6
15:37 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:39 moritz I don't see why you have to learn Perl 5 at all to understand Pugs
15:40 El_Che caasih: do you understand haskell?
15:42 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
15:43 caasih moritz: Ok. So I just learn to program in Perl 6 first. And I can forget about Perl 5 for now.
15:43 huf joined #perl6
15:43 caasih El_Che: I read some dev logs about pugs but I can’t understand junctions at that moment.
15:45 caasih 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 https://docs.perl6.org/type/Junction.html helps?
15:45 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?
15:45 moritz no, Perl 5 doesn't have them
15:45 El_Che if the latter, the Runtime of Perl 6 is Rakudo now. Pugs was abandoned
15:45 moritz and they are mostly a convience
15:46 zakharyas joined #perl6
15:47 caasih El_Che: I think I am the historian in this case.
15:48 El_Che caasih: ok, thx for clarifying
15:48 El_Che there are people around here that worked on pugs and may have some answers
15:49 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:50 caasih El_Che++ cool, thanks for the advice.
15:50 caasih moritz++ for the link
15:55 khw joined #perl6
15:59 Voldenet It isn't unwise to learn perl6 and then perl5, they are different languages
15:59 Voldenet perl6 is a fun toy language
16:02 Voldenet I believe perl5 to be used more in real world environments
16:02 wamba joined #perl6
16:05 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:07 lucasb joined #perl6
16:08 Voldenet I call that every language that is fun to use
16:09 El_Che a 'it's not you, it's me" thing?
16:10 Voldenet Yeah, 't was meant to be complimentary :P
16:10 El_Che :)
16:32 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 lucasb But what about the actual numeric types, can't they overload the .Numeric method to return a value of their type?
16:32 lucasb m: quietly say (.WHAT for +Num, +Rat, +Complex)
16:32 camelia rakudo-moar e0d39321e: OUTPUT: «((Int) (Int) (Int))␤»
16:33 lucasb wouldn't you like if this ^^ returned ((Num) (Rat) (Complex)) ?
16:36 lucasb the actual values returned would then be (0e0, 0.0, 0+0i) or (NaN, 0.0, 0+0i)
16:36 lucasb any opinions?
16:43 troys joined #perl6
16:45 Zoffix joined #perl6
16:46 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:47 Zoffix m: Rat + 1
16:47 camelia rakudo-moar e0d39321e: OUTPUT: «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␤␤»
16:47 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
16:49 Zoffix m: Int²
16:49 camelia rakudo-moar e0d39321e: OUTPUT: «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␤␤»
16:49 Zoffix And many operations don't work with type objects, so why do we even have "undef is zero" thing in some random places.
16:50 Zoffix When is it useful?
16:52 Zoffix m: class { method z (Rat $x) { say "Numerator is {.nude.head}" } }.new.z: Rat
16:52 camelia rakudo-moar e0d39321e: OUTPUT: «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␤␤»
16:52 Zoffix m: class { method z (Rat $x) { say "Numerator is {$x.nude.head}" } }.new.z: Rat
16:52 camelia rakudo-moar e0d39321e: OUTPUT: «Cannot look up attributes in a Rat type object␤  in method z at <tmp> line 1␤  in block <unit> at <tmp> line 1␤␤»
16:53 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:55 pmurias Zoffix: do we have a lot of tests depend on that?
16:56 Zoffix I'm about to test it.
16:57 timotimo it looks like state variables in `perl6 -ne` don't behave right
16:57 Zoffix There's also RT#130383
16:57 synopsebot RT#130383 [new]: https://rt.perl.org/Ticket/Display.html?id=130383 [BUG] perl6 -n does not set $_ when it's interpolated via a block
16:59 Zoffix timotimo: what's the code that doesn't work? perl6 -ne 'say $++' and perl6 -ne 'state $x; say $x++' seem to work OK
17:00 Zoffix And RT#130383 is just a mis-scoped QAST::Block
17:02 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:03 Zoffix lucasb: is it really expected though? I imagine modern practices fatalize those warnings
17:04 Zoffix (`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
17:04 jnthn Rather than crash and burn
17:05 jnthn (Which wouldn't have been useful)
17:05 ZzZombo m: say Int+Str
17:05 camelia rakudo-moar e0d39321e: OUTPUT: «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␤»
17:05 jnthn Certainly I prefer to handle such things explicitly, but sometimes things are unexpectedly missing.
17:05 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.
17:06 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: https://gist.github.com/zoffixznet/310e04b9ec3821cbacba1d0ff09cbbc6
17:06 jnthn Zoffix: Just saying that I'd lean towards "try to consistently warn and behave well" than "rip it out"
17:07 Zoffix Based on those tests results, it's probably too deeply ingraned to rip out by now
17:08 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
17:13 ZzZombo m: say Str++~Int.Bool
17:13 camelia rakudo-moar e0d39321e: OUTPUT: «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 #perl6
17:13 ZzZombo m: say Str++
17:13 camelia rakudo-moar e0d39321e: OUTPUT: «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 ZzZombo m: say False++~Int.Bool
17:13 camelia rakudo-moar e0d39321e: OUTPUT: «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…»
17:14 ZzZombo m: say Int++~Int.Bool
17:14 camelia rakudo-moar e0d39321e: OUTPUT: «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)…»
17:14 ZzZombo m: say ($=Int)++~Int.Bool
17:14 camelia rakudo-moar e0d39321e: OUTPUT: «5===SORRY!5=== Error while compiling <tmp>␤Pod variable $=Int not yet implemented. Sorry.␤at <tmp>:1␤------> 3say ($=Int7⏏5)++~Int.Bool␤»
17:14 ZzZombo m: say ($= Int)++~Int.Bool
17:14 camelia rakudo-moar e0d39321e: OUTPUT: «0False␤»
17:15 ZzZombo m: say ($= Str)++~Int.Bool
17:15 camelia rakudo-moar e0d39321e: OUTPUT: «0False␤»
17:15 ZzZombo m: say ++$--
17:15 camelia rakudo-moar e0d39321e: OUTPUT: «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␤»
17:16 ZzZombo m: say ++($--)
17:16 camelia rakudo-moar e0d39321e: OUTPUT: «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…»
17:16 ZzZombo m: say ++(my $--)
17:16 camelia rakudo-moar e0d39321e: OUTPUT: «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…»
17:16 ZzZombo m: say ++(my $)--
17:16 camelia rakudo-moar e0d39321e: OUTPUT: «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␤»
17:16 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 :)
17:17 ZzZombo m: say ++$
17:17 camelia rakudo-moar e0d39321e: OUTPUT: «1␤»
17:17 ZzZombo m: say (++$)--
17:17 camelia rakudo-moar e0d39321e: OUTPUT: «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 …»
17:20 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:21 zakharyas joined #perl6
17:21 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.
17:22 lucasb Zoffix: which one? the "my num $x" defaulting to 0e0 or the overload .Numeric for number classes?
17:23 lucasb 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
17:23 Zoffix Well, I'm -½ on it. No real strong feelings.
17:24 lucasb I found a new argument for my proposal. NaN is true! and I don't like that :)
17:24 lucasb m: say so my num $
17:24 camelia rakudo-moar e0d39321e: OUTPUT: «True␤»
17:24 lucasb if it defaults to 0e0, then the uninitialized variable would false, which is more convenient, no?
17:25 lucasb m: say so my num $ = 0e0
17:25 camelia rakudo-moar e0d39321e: OUTPUT: «False␤»
17:25 Zoffix hehe
17:25 Zoffix OK, I'm -¼ on it then :)
17:25 lucasb just 0.25 to go :)
17:30 Zoffix m: dd <1.0>.Real
17:30 camelia rakudo-moar e0d39321e: OUTPUT: «RatStr.new(1.0, "1.0")␤»
17:30 Zoffix Found a bug while I was at it :) lucasb++
17:31 zakharyas joined #perl6
17:47 zakharyas joined #perl6
18:00 Geth ¦ doc: fcd0359369 | (Zoffix Znet)++ | doc/Type/Numeric.pod6
18:00 Geth ¦ doc: Numeric does not provide .Real
18:00 Geth ¦ doc: review: https://github.com/perl6/doc/commit/fcd0359369
18:00 synopsebot Link: https://doc.perl6.org/type/Numeric
18:09 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:12 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
18:12 camelia rakudo-moar e0d39321e: OUTPUT: «2␤»
18:12 Zoffix m: say (2+1i).Real
18:12 camelia rakudo-moar e0d39321e: OUTPUT: «Cannot convert 2+1i to Real: imaginary part not zero␤  in block <unit> at <tmp> line 1␤␤»
18:12 moritz m: try (2+1i).Real; say $!.^name
18:12 camelia rakudo-moar e0d39321e: OUTPUT: «X::Numeric::Real␤»
18:14 SmokeMachine where's stored the default value of a attribute?
18:15 moritz in the Attribute object, I believe
18:15 zakharyas joined #perl6
18:15 moritz m: say class { has $.x = 42 }.^attributes[0].default
18:15 camelia rakudo-moar e0d39321e: OUTPUT: «No such method 'default' for invocant of type 'Attribute'␤  in block <unit> at <tmp> line 1␤␤»
18:15 moritz m: say class { has $.x = 42 }.^attributes[0].perl
18:15 camelia rakudo-moar e0d39321e: OUTPUT: «Attribute.new␤»
18:15 Zoffix P.S.: I'm about to commit a fix to docs for that (not just complaining :))
18:16 moritz ++Zoffix
18:16 moritz SmokeMachine: I can't find it right now :(
18:17 moritz maybe it's in $!build_closure
18:17 jnthn build_closure iirc
18:17 SmokeMachine m: say class C {has $.a = 42}.^attributes.head.^methods
18:17 camelia rakudo-moar e0d39321e: OUTPUT: «(<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)␤»
18:17 SmokeMachine m: say class C {has $.a = 42}.^attributes.head.^attributes
18:17 camelia rakudo-moar e0d39321e: OUTPUT: «(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 …»
18:18 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)
18:18 camelia rakudo-moar e0d39321e: OUTPUT: «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 …»
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)
18:18 camelia rakudo-moar e0d39321e: OUTPUT: «No such method 'get_value' for invocant of type 'Seq'␤  in block <unit> at <tmp> line 1␤␤»
18:18 jnthn I think there's a method to fetch it though
18:18 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)
18:18 camelia rakudo-moar e0d39321e: OUTPUT: «No such method 'get_value' for invocant of type 'BOOTSTRAPATTR'␤  in block <unit> at <tmp> line 1␤␤»
18:18 jnthn Oh, the method is just called .build
18:19 moritz m: say class { has $.x = 42 }.^attributes[0].build
18:19 camelia rakudo-moar e0d39321e: OUTPUT: «42␤»
18:19 SmokeMachine m: say class C {has $.a = 42}.^attributes.head.build
18:19 camelia rakudo-moar e0d39321e: OUTPUT: «42␤»
18:19 SmokeMachine thank you all!!
18:19 SmokeMachine thanks jnthn !
18:21 moritz m: say class { has $.y = 4; has $.x = 42 * $.y }.^attributes[1].build
18:21 camelia rakudo-moar e0d39321e: OUTPUT: «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 }.…»
18:21 moritz m: say class { has $.y = 4; has $.x = 42 * $!y }.^attributes[1].build
18:21 camelia rakudo-moar e0d39321e: OUTPUT: «␤»
18:21 moritz m: say class { has $.y = 4; has $.x = 42 * $!y }.^attributes[1].build.perl
18:21 camelia rakudo-moar e0d39321e: OUTPUT: «method (<anon|51721056> $: ;; Mu $_) { #`(Method|35573464) ... }␤»
18:21 Geth ¦ doc: d291c495df | (Zoffix Znet)++ | 7 files
18:21 Geth ¦ doc: Document/Fix docs for .Real/.Numeric on Numerics
18:21 Geth ¦ doc:
18:21 Geth ¦ doc: - Fix up some inaccuracies about .Real on Complex/Numeric
18:21 Geth ¦ doc: - Remove prose on allomorphs about coercions and smartmatch
18:21 Geth ¦ doc:   for Numeric. The method itself is not concerned with those concepts.
18:21 Geth ¦ doc: - Document behaviour of methods on :U Numerics:
18:21 Geth ¦ doc:     - Impl: https://github.com/rakudo/rakudo/commit/1dc1f038f1
18:21 Geth ¦ doc:     - Spec: https://github.com/perl6/roast/commit/f2d745f1a8
18:21 Geth ¦ doc: review: https://github.com/perl6/doc/commit/d291c495df
18:23 Zoffix $ ./perl6 -e 'quietly say (.WHAT for +Int, +Num, +Rat, +FatRat, +Complex, +NumStr, +RatStr, +ComplexStr, +IntStr)'
18:23 Zoffix ((Int) (Num) (Rat) (FatRat) (Complex) (Num) (Rat) (Complex) (Int))
18:23 Zoffix lucasb: ^ works now
18:25 Zoffix 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 Zoffix So +1 on changing it. You now need to convince others :)
18:25 * Zoffix &
18:26 Zoffix left #perl6
18:28 TEttinger joined #perl6
18:28 lucasb awesome, thanks Zoffix!
18:43 Geth ¦ doc: 6e3763b89e | (JJ Merelo)++ | doc/Language/operators.pod6
18:43 synopsebot Link: https://doc.perl6.org/language/operators
18:43 Geth ¦ doc: Changed some examples to a case that feels a bit more real
18:43 Geth ¦ doc:
18:43 Geth ¦ doc: And shows intent refs #1748. Also separates code in different
18:43 Geth ¦ doc: examples, leaving the text as text, so it addresses 4 and 5. It closes
18:43 Geth ¦ doc:
18:43 Geth ¦ doc: Still it should also show an example where the method chaining does
18:43 Geth ¦ doc: not work by using some data structure that can be used as the last
18:43 Geth ¦ doc: argument to something, but does not have that something as a method.
18:43 Geth ¦ doc: review: https://github.com/perl6/doc/commit/6e3763b89e
18:43 Geth ¦ doc: 3d76648f29 | (JJ Merelo)++ | 7 files
18:43 Geth ¦ doc: Merge branch 'master' of github.com:perl6/doc
18:43 Geth ¦ doc: review: https://github.com/perl6/doc/commit/3d76648f29
18:46 brrt joined #perl6
18:46 AlexDaniel joined #perl6
18:49 Geth ¦ doc: c15d37a876 | (JJ Merelo)++ | doc/Language/operators.pod6
18:49 Geth ¦ doc: Remove trailing whitespaces.
18:49 Geth ¦ doc:
18:49 Geth ¦ doc: This really closes #1739 and tip'o'the hat to @coke who usually takes
18:49 Geth ¦ doc: care of this.
18:49 Geth ¦ doc: review: https://github.com/perl6/doc/commit/c15d37a876
18:51 pharv joined #perl6
18:56 SyrupThinker joined #perl6
18:56 Xliff If I want a grammar token to match the name, ala: "token DEFAULT { 'DEFAULT' }" is there a shortcut way to do this?
18:57 Xliff Because I have to do it.... a lot.
18:57 Xliff Defining this as <sym>, maybe?
19:00 Ven`` joined #perl6
19:01 moritz you can use the sym mechanism, yes
19:01 moritz at least in proto tokens
19:03 Ven` joined #perl6
19:05 Ven` joined #perl6
19:06 Xliff What's the difference between proto tokens and normal ones?
19:07 Xliff 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?
19:07 camelia rakudo-moar 1dc1f038f: OUTPUT: «Type check failed in binding to parameter 'value'; expected Any but got BOOTSTRAPATTR (BOOTSTRAPATTR.new)␤  in block <unit> at <tmp> line 1␤␤»
19:08 travis-ci joined #perl6
19:08 travis-ci Doc build errored. JJ Merelo 'Remove trailing whitespaces.
19:08 travis-ci https://travis-ci.org/perl6/doc/builds/341572957 https://github.com/perl6/doc/compare/3d76648f296e...c15d37a87675
19:08 travis-ci left #perl6
19:08 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] }
19:08 camelia rakudo-moar 1dc1f038f: ( no output )
19:08 Xliff SmokeMachine: Why ".name ~~ q[$!build_closure]"?
19:08 SmokeMachine grep works but first doesn't...
19:09 SmokeMachine Xliff: I looking for the attribute called $!build_closure
19:22 Ven`` joined #perl6
20:10 perlpilot_ joined #perl6
20:15 Ven`` joined #perl6
20:44 zakharyas joined #perl6
20:57 Actualeyes joined #perl6
21:00 khw joined #perl6
21:05 zakharyas joined #perl6
21:06 pharv joined #perl6
21:06 zakharyas joined #perl6
21:16 pharv joined #perl6
21:20 cdg joined #perl6
21:25 espadrine joined #perl6
21:31 cpage joined #perl6
21:31 Ven`` joined #perl6
21:43 von_cheam joined #perl6
21:46 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 von_cheam Is there maybe a better/more perlish way to do this? If not, any ideas as to what I'm doing/thinking wrong?
21:46 von_cheam Is it maybe interpreting "== 1" as "== True"?
21:48 moritz m: subset Char of Str where { .chars == 1 }; for '', 'a', 'aa' { say $_ ~~ Char }
21:48 camelia rakudo-moar 1dc1f038f: OUTPUT: «False␤True␤False␤»
21:48 moritz von_cheam: ^^ this seems to be what you want
21:48 moritz m: subset Char of Str where .chars == 1; for '', 'a', 'aa' { say $_ ~~ Char }
21:48 camelia rakudo-moar 1dc1f038f: OUTPUT: «False␤True␤False␤»
21:48 moritz or even without braces
21:50 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 #perl6
21:57 geekosaur or codepoint
22:03 Zoffix joined #perl6
22:03 Zoffix m: subset Char of Str where (*.chars == 1);
22:03 camelia rakudo-moar 1dc1f038f: OUTPUT: «WARNINGS for <tmp>:␤Useless use of "==" in expression ".chars == 1" in sink context (line 1)␤»
22:03 Zoffix That's a bug innit?
22:05 Ven`` joined #perl6
22:06 skids m: sub a ($f where (*.chars == 1)) { $f.say }; a("4")
22:06 camelia rakudo-moar 1dc1f038f: OUTPUT: «WARNINGS for <tmp>:␤4␤Useless use of "==" in expression ".chars == 1" in sink context (line 1)␤»
22:07 cdg_ joined #perl6
22:08 Zoffix m: dd (*.chars == 1);
22:08 camelia rakudo-moar 1dc1f038f: OUTPUT: «{ ... }␤»
22:08 timotimo m: my num $foo = 1;
22:08 camelia rakudo-moar 1dc1f038f: OUTPUT: «This type cannot unbox to a native number: P6opaque, Int␤  in block <unit> at <tmp> line 1␤␤»
22:08 timotimo m: my Num $foo = 1;
22:08 camelia rakudo-moar 1dc1f038f: OUTPUT: «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 <…»
22:08 * Zoffix goes with yes :)
22:08 timotimo ^- someone want to port this to native variables?
22:09 brrt joined #perl6
22:13 Zoffix R#1525
22:14 synopsebot R#1525 [open]: https://github.com/rakudo/rakudo/issues/1525 Useless useless when parens used around whatevercode in where
22:15 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:16 Zoffix /apl/all
22:17 timotimo oh it is? one sec.
22:18 timotimo nope, it's X::Syntax::Number::LiteralType in rakudo
22:18 Zoffix No, I mean the "canmot unbox" one
22:18 timotimo oh yes
22:18 timotimo i think it'd actually be super easy to do this, hold on.
22:19 Zoffix g2g
22:19 Zoffix left #perl6
22:20 pharv joined #perl6
22:21 timotimo i may already have the implementation done
22:23 Kaiepi joined #perl6
22:25 Kaiepi joined #perl6
22:26 MasterDuke joined #perl6
22:29 Xliff timotimo++ # Supa fast!
22:29 Xliff Zoffix++ # Just coz.
22:32 timotimo yeah, except i'm still trying to get it to work :D
22:38 * timotimo spews debug prints :)
22:40 timotimo potentially problematically this turns a runtime error into a compiletime error. not sure if that is wanted?
22:41 bwisti joined #perl6
22:42 timotimo also, right now it suggests num(1) or 1.num %)
22:42 timotimo m: say 1.num
22:42 camelia rakudo-moar 1dc1f038f: OUTPUT: «No such method 'num' for invocant of type 'Int'. Did you mean any of these?␤    Num␤    sum␤␤  in block <unit> at <tmp> line 1␤␤»
22:43 timotimo m: say num(1)
22:43 camelia rakudo-moar 1dc1f038f: OUTPUT: «Cannot invoke this object (REPR: P6num; num)␤  in block <unit> at <tmp> line 1␤␤»
22:43 timotimo thought so
22:49 pharv joined #perl6
22:50 Kaiepi joined #perl6
22:52 pharv joined #perl6
22:53 comborico1611 joined #perl6
22:56 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 timotimo seems good
22:57 timotimo huh, this is strange
22:57 timotimo m: my Num $a = <1/2>
22:57 camelia rakudo-moar 1dc1f038f: OUTPUT: «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…»
22:57 timotimo how did it get that representation ...
22:59 jnthn <1/2> is a Rat literal
23:00 timotimo yeah, but why does it .perl to 0.5e0 there?
23:00 jnthn Oh...that's a very good question
23:00 jnthn m: say <1/2>.perl
23:00 camelia rakudo-moar 1dc1f038f: OUTPUT: «0.5␤»
23:00 timotimo yeah, it's not there :D
23:00 jnthn Yeah, it's fishy but not *that* fishy :)
23:05 timotimo oh, of course
23:05 timotimo i + that
23:05 timotimo inside the optimizer; maybe that uses smart_numify or something like that
23:05 timotimo m: my Num $a = <1/2+3/4i>
23:05 camelia rakudo-moar 1dc1f038f: OUTPUT: «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>)…»
23:06 timotimo in that branch i call the actual .Numeric method
23:07 mirlur[m] joined #perl6
23:09 timotimo m: say <1/2>.^name
23:09 camelia rakudo-moar 1dc1f038f: OUTPUT: «Rat␤»
23:10 timotimo m: say < 1/2 >.^name
23:10 epony joined #perl6
23:10 camelia rakudo-moar 1dc1f038f: OUTPUT: «RatStr␤»
23:10 timotimo ah, that's how you get that kind
23:10 timotimo Cannot assign a literal of type Rat (RatStr.new(0.5, "1/2")) to a native variable of type Num.
23:12 timotimo what exactly should be the right way here is a little muddy
23:19 * Xliff finally reaches the dreaded <expr> in the DDL spec.
23:22 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 rakudo-moar 1dc1f038f: OUTPUT: «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]␤»
23:22 timotimo hm, is this more interning failures?
23:22 SmokeMachine m: use Test; class C is Any {...}; role R[::T] {}; my R[C] $a; class C {}; ok $a ~~ R[C]
23:22 camelia rakudo-moar 1dc1f038f: OUTPUT: «ok 1 - ␤»
23:25 Rawriful joined #perl6
23:36 cdg joined #perl6
23:56 skids joined #perl6

| Channels | #perl6 index | Today | | Search | Google Search | Plain-Text | summary

Perl 6 | Reference Documentation | Rakudo