Perl 6 - the future is here, just unevenly distributed

IRC log for #perl6, 2017-05-27

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:04 Dee22 joined #perl6
00:05 tinita does anyone else have the problem of a slow vim when editing perl 6 with syntax highlighting?
00:05 mcmillhj joined #perl6
00:06 tinita I have vim 8.0.378
00:07 zoll joined #perl6
00:11 mcmillhj joined #perl6
00:27 mcmillhj joined #perl6
00:28 MasterDuke tinita: yeah, it gets slow with large files
00:30 tinita MasterDuke: hm, 109 lines...
00:31 tinita i'll try with a fresh .vimrc and only :syn on
00:41 timotimo one of the best feelings: having your terminal suddenly write "warning: your hard drive is failing" written all over it
00:41 dj_goku joined #perl6
00:41 dj_goku joined #perl6
00:41 timotimo thankfully it was only because i had unplugged an external usb hard drive while the computer was suspended
00:43 mcmillhj joined #perl6
00:47 raydiak \o
00:53 finanalyst joined #perl6
01:04 BenGoldberg joined #perl6
01:12 lookatme joined #perl6
01:12 lookatme morning .o/
01:47 ilbot3 joined #perl6
01:47 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:00 kshannon It is it possible to do the equivalent of $*W.find_lexical_container_type at runtime? e.g. 'my %a;' produces a variable that has an Associative constraint on binding, but the variable itself contains a Hash: %a.WHAT == Hash;  but trying to do %p := 1 gives an error message referring to Associative.
02:01 kshannon How do I ask %p what it's binding constraint is?
02:01 kshannon Do I need to somehow get acces to the lexpad instead of the variable?
02:05 BenGoldberg left #perl6
02:16 kshannon Oops typo, I was meaing one variable not two, please read %a wehere I said %p...
02:19 kshannon m: my %a; say %a.WHAT; say %a.of; say %a.VAR.WHAT; say %a.VAR.of; %a := a => 1; say %a.WHAT; say %a.of;
02:19 camelia rakudo-moar 094e77: OUTPUT: «(Hash)␤(Mu)␤(Hash)␤(Mu)␤(Pair)␤(Mu)␤»
02:19 kshannon m: my %a is Hash; say %a.WHAT; say %a.of; say %a.VAR.WHAT; say %a.VAR.of; %a := a => 1; say %a.WHAT; say %a.of;
02:19 camelia rakudo-moar 094e77: OUTPUT: «(Hash)␤(Mu)␤(Hash)␤(Mu)␤Type check failed in binding; expected Hash but got Pair (:a(1))␤  in block <unit> at <tmp> line 1␤␤»
02:20 kshannon m: my %a is Associative; say %a.WHAT; say %a.of; say %a.VAR.WHAT; say %a.VAR.of; %a := a => 1; say %a.WHAT; say %a.of;
02:20 camelia rakudo-moar 094e77: OUTPUT: «(Associative)␤(Mu)␤(Associative)␤(Mu)␤(Pair)␤(Mu)␤»
02:21 MasterDuke Associative and Positional are roles, so you would want "does"
02:26 kshannon The question is how do I ask %a what it "does"?
02:27 kshannon I want to know how to introspect the restrictions on binding.
02:29 dj_goku joined #perl6
02:29 dj_goku joined #perl6
02:30 kshannon m: my %a does Associative; say %a.WHAT; say %a.of; say %a.VAR.WHAT; say %a.VAR.of; %a := a => 1; say %a.WHAT; say %a.of;
02:30 camelia rakudo-moar 094e77: OUTPUT: «(Hash+{Associative})␤(Mu)␤(Hash+{Associative})␤(Mu)␤(Pair)␤(Mu)␤»
02:30 kshannon That's different to a plain 'my %a;'
02:30 MasterDuke i think there's something like .^mro, but i'm not coming up with what it is
02:33 kshannon I think the problem seems to be that the binding constraint is not recorded on the container (Hash/BagHash/Pair),  but on the lexical pad that the variable is in.
02:35 raydiak Isn't it adequate to know that % always has to be Associative and @ always has to be Positional? Or is there some complication I'm missing?
02:35 kshannon It might be that the information has been thrown away by runtime and the only remnant is inlined in the call to the p6bindassert op that the bind is compiled to.
02:35 ramortegui joined #perl6
02:36 kshannon m: my %a is Positional; %a := %();
02:36 camelia rakudo-moar 094e77: OUTPUT: «Type check failed in binding; expected Positional but got Hash (${})␤  in block <unit> at <tmp> line 1␤␤»
02:37 kshannon If you've specified a container type on the declaration then that becomes the binding constraint.
02:39 MasterDuke i don't know the answer to your questions. might need to wait a couple hours until the Europeans (e.g., moritz, timotimo, lizmat) wake up
02:39 raydiak I see...
02:42 kshannon BTW this isn't a case of the XY problem ( https://meta.stackexchange.com/questions/66377/what-is-the-xy-problem )   I'm not actually trying to solve an issue - I'm just trying to understand the details.
02:42 kshannon Because learning is fun :)
02:44 mcmillhj joined #perl6
02:45 lookatme m: my %h; say %h.of;
02:45 camelia rakudo-moar 094e77: OUTPUT: «(Mu)␤»
02:46 lookatme m: my Int %h; say %h.of;
02:46 camelia rakudo-moar 094e77: OUTPUT: «(Int)␤»
02:46 lookatme Do you mean this constraint type ?
02:46 kshannon No.
02:46 kshannon m: my %h; %h := 1
02:46 camelia rakudo-moar 094e77: OUTPUT: «Type check failed in binding; expected Associative but got Int (1)␤  in block <unit> at <tmp> line 1␤␤»
02:47 kshannon I mean the Associative type
02:47 kshannon m: my %h is Scalar; %h := 1
02:47 camelia rakudo-moar 094e77: OUTPUT: «Cannot make a Scalar object using .new␤  in block <unit> at <tmp> line 1␤␤»
02:47 kshannon Hmmm. I wasn't execpting that...
02:48 lookatme What the binding for ? %h is a hash container
02:49 kshannon Yes %h is a hash container,  but the restricition on binding to the variable %h is that the value must be Associative.
02:50 kshannon You can change that restriction by including 'my %h is SomeType' and then the value must be ACCEPTed by SomeType
02:52 lookatme Oh, I see
02:54 lookatme m: my %h is Int; say %h.WHAT;
02:54 camelia rakudo-moar 094e77: OUTPUT: «(Int)␤»
02:54 lookatme Oh, that is a black magic !
02:55 lookatme m: my %h is Int; say %h.^methods;
02:55 camelia rakudo-moar 094e77: OUTPUT: «(Int Num Rat FatRat abs Bridge chr sqrt base polymod expmod is-prime floor ceiling round lsb msb narrow Range atanh sign asech sin tan atan2 acosech truncate asinh conj acosh pred asec cosec acotan cosh acos acosec sech unpolar log exp roots cotan sinh t…»
02:56 noganex joined #perl6
02:57 kshannon m: my %h is Int; %h := 4; say %h + 2
02:57 camelia rakudo-moar 094e77: OUTPUT: «6␤»
02:58 lookatme %h is total a Int now. But it's so easy to misunderstand. I don't recommend use it.
02:59 kshannon But it's an int without a Scalar wrapper.  You can't assign to %h,  only bind to it.
02:59 kshannon and yes Int is a silly constraint.
03:01 lookatme m: my %h is Int; say %h = 4;
03:01 camelia rakudo-moar 094e77: OUTPUT: «Cannot modify an immutable Int (0)␤  in block <unit> at <tmp> line 1␤␤»
03:03 raydiak m: my %a is Numeric; %a := π; say %a;
03:03 camelia rakudo-moar 094e77: OUTPUT: «3.14159265358979␤»
03:04 lookatme It's like a container binding
03:04 lookatme m: my \h := 0; h = 4;
03:04 camelia rakudo-moar 094e77: OUTPUT: «Cannot modify an immutable Int (0)␤  in block <unit> at <tmp> line 1␤␤»
03:05 lookatme Em, they called it **Sigilless variables**
03:11 Cabanoss- joined #perl6
03:31 zoll left #perl6
04:03 cpage_ joined #perl6
04:18 dj_goku joined #perl6
04:18 dj_goku joined #perl6
04:24 Exodist joined #perl6
04:31 kshannon m: package Foo { our %hash is Hash; %hash := %(); } # LTA error message...
04:31 camelia rakudo-moar 094e77: OUTPUT: «===SORRY!===␤First child of a 'bind' op must be a QAST::Var, got QAST::Op␤»
04:34 geekosaur yeh, rakudobug that
04:44 mcmillhj joined #perl6
05:00 mcmillhj joined #perl6
05:12 dct joined #perl6
05:16 cyphase joined #perl6
05:19 ChoHag joined #perl6
05:26 rindolf joined #perl6
05:30 cbd_ joined #perl6
05:32 cbd_ https://pastebin.com/0vzDC3zU
05:32 cbd_ ^^ that is my problem
05:32 cbd_ has to do with types
05:34 cbd_ specifically I am trying to use function prototypes
05:35 andrzejk_ joined #perl6
05:35 espadrine joined #perl6
05:36 moritz \o
05:36 cbd_ and specify the types of those functions
05:37 hobbs Numeric has a .Int method, so its subclasses (like Rat, which 2.2 is) can coerce to Int by truncating
05:37 hobbs it doesn't, however, have a .PositiveInt method :)
05:38 moritz cbd_: looks like a bug to me
05:38 cbd_ So the solution to this issue is to add one?
05:38 moritz cbd_: the error  message says "expected PositiveInt", but it should expect Positional[PositiveInt]
05:40 moritz m: subset Positive of Int where * > 0; sub f(Positive @p) {}; my Positive @x = (1, 2); f(@x)
05:40 camelia rakudo-moar 094e77: OUTPUT: «Constraint type check failed in binding to parameter '@p'; expected Positive but got Array[Positive] (Array[Positive].new(1...)␤  in sub f at <tmp> line 1␤  in block <unit> at <tmp> line 1␤␤»
05:40 moritz m: subset Positive of Int where * > 0; sub f(Positive @p) {}; my Positive @x = (1, 2); &f.signature.params[0].type
05:40 camelia rakudo-moar 094e77: ( no output )
05:40 moritz m: subset Positive of Int where * > 0; sub f(Positive @p) {}; my Positive @x = (1, 2); say &f.signature.params[0].type
05:40 camelia rakudo-moar 094e77: OUTPUT: «(Positional[Int])␤»
05:43 aborazmeh joined #perl6
05:43 aborazmeh joined #perl6
05:44 cbd_ So is it a bug with perl6, or am I writing it wrong?
05:45 moritz a bug in rakudo
05:46 moritz m: sub f(Int @p) {}; my Int @x = (1, 2); say &f.signature.params[0].type
05:46 camelia rakudo-moar 094e77: OUTPUT: «(Positional[Int])␤»
05:46 moritz m: sub f(Int @p) {}; my Int @x = (1, 2); f(@x)
05:46 camelia rakudo-moar 094e77: ( no output )
05:46 cbd_ a bug in the error message? or should the code that I put in the pastebin execute without error?
05:49 moritz it should run without error
05:50 cbd_ nice. so I should send an email to rakudobug@perl.org?
05:51 moritz yes, please
05:52 cbd_ hey hey, this will mark my first bug report to an open source project
05:52 cbd_ finally giving back
05:53 mcmillhj joined #perl6
05:54 moritz \o/
05:54 moritz cbd_++
05:59 cbd_ cool.  submitted it about a minute ago.  The bug isn't fixed yet... what do I do?
06:06 dj_goku joined #perl6
06:06 dj_goku joined #perl6
06:07 moritz leave out the type constraint
06:08 moritz or make the type constraint (Int @p)
06:14 movl joined #perl6
06:14 mcmillhj joined #perl6
06:18 TimToady joined #perl6
06:34 lookatme or just no constraint (@p)
06:34 aborazmeh joined #perl6
06:34 aborazmeh joined #perl6
06:35 wamba joined #perl6
06:42 kshannon m: class FooHash is Hash {}; class BarHash is FooHash {}; my %h is FooHash; say %h.WHAT; %h := BarHash.new; say %h.WHAT; %h := Hash.new; say %h.WHAT
06:42 camelia rakudo-moar 094e77: OUTPUT: «(FooHash)␤(BarHash)␤Type check failed in binding; expected FooHash but got Hash (${})␤  in block <unit> at <tmp> line 1␤␤»
06:43 kshannon m: class FooHash is Hash {}; class BarHash is FooHash {}; my %h is FooHash; say %h.WHAT; %h := BarHash.new; say %h.WHAT; say %h.VAR.WHAT;
06:43 camelia rakudo-moar 094e77: OUTPUT: «(FooHash)␤(BarHash)␤(BarHash)␤»
06:44 kshannon m: class FooHash is Hash {}; class BarHash is FooHash {}; my %h is FooHash; say %h.WHAT; %h := BarHash.new; say %h.WHAT; %h := FooHash.new; say %h.WHAT;
06:44 camelia rakudo-moar 094e77: OUTPUT: «(FooHash)␤(BarHash)␤(FooHash)␤»
06:46 kshannon m: class FooHash is Hash {}; class BarHash is FooHash {}; our %h is FooHash; say %h.WHAT; %h := BarHash.new; say %h.WHAT; %h := FooHash.new; say %h.WHAT;
06:46 camelia rakudo-moar 094e77: OUTPUT: «===SORRY!===␤First child of a 'bind' op must be a QAST::Var, got QAST::Op␤»
06:53 kshannon m: our %h is Hash
06:53 camelia rakudo-moar 094e77: OUTPUT: «===SORRY!===␤First child of a 'bind' op must be a QAST::Var, got QAST::Op␤»
07:00 rindolf joined #perl6
07:01 mcmillhj joined #perl6
07:02 Geth ¦ doc/extra-twigils: 78fd66c66a | (JJ Merelo)++ | doc/Language/variables.pod6
07:02 Geth ¦ doc/extra-twigils: Changes a bit examples and grammar
07:02 Geth ¦ doc/extra-twigils:
07:02 Geth ¦ doc/extra-twigils: Mainly for #1340 but while I was at it, I have formalized a bit some
07:02 Geth ¦ doc/extra-twigils: more text. This example is more perl6-ish, using `reduce` which is
07:02 Geth ¦ doc/extra-twigils: exclusive of Perl6
07:02 Geth ¦ doc/extra-twigils: review: https://github.com/perl6/doc/commit/78fd66c66a
07:03 Geth ¦ doc: JJ++ created pull request #1342: Changes a bit examples and grammar
07:03 Geth ¦ doc: review: https://github.com/perl6/doc/pull/1342
07:06 fatguy joined #perl6
07:08 Geth ¦ doc: c297a2a529 | (Gabor Szabo)++ | doc/Language/5to6-perlfunc.pod6
07:08 Geth ¦ doc: index qr to make it easier to locate
07:08 Geth ¦ doc: review: https://github.com/perl6/doc/commit/c297a2a529
07:10 xiaomiao joined #perl6
07:17 mcmillhj joined #perl6
07:19 Geth ¦ doc/extra-twigils: 1acc2a03fb | (JJ Merelo)++ | doc/Language/variables.pod6
07:19 Geth ¦ doc/extra-twigils: Changed to -
07:19 Geth ¦ doc/extra-twigils:
07:19 Geth ¦ doc/extra-twigils: (probably you wanted to say commutative, not associative, but I see
07:19 Geth ¦ doc/extra-twigils: your point @KrisShannon and thanks for the suggestion)
07:19 Geth ¦ doc/extra-twigils: review: https://github.com/perl6/doc/commit/1acc2a03fb
07:19 Geth ¦ doc/extra-twigils: 342f4ccbb7 | (JJ Merelo)++ | 184 files
07:19 Geth ¦ doc/extra-twigils: Merge branch 'extra-twigils' of github.com:perl6/doc into extra-twigils
07:19 Geth ¦ doc/extra-twigils: review: https://github.com/perl6/doc/commit/342f4ccbb7
07:38 domidumont joined #perl6
07:41 travis-ci joined #perl6
07:41 travis-ci Doc build passed. JJ Merelo 'Changes a bit examples and grammar
07:41 travis-ci https://travis-ci.org/perl6/doc/builds/236616738 https://github.com/perl6/doc/commit/78fd66c66aae
07:41 brrt joined #perl6
07:41 travis-ci left #perl6
07:43 domidumont joined #perl6
07:49 mcmillhj joined #perl6
07:50 wamba joined #perl6
07:51 travis-ci joined #perl6
07:51 travis-ci Doc build passed. Juan Julián Merelo Guervós 'Merge branch 'master' into extra-twigils'
07:51 travis-ci https://travis-ci.org/perl6/doc/builds/236617677 https://github.com/perl6/doc/compare/78fd66c66aae...98eee059134d
07:51 travis-ci left #perl6
07:54 dj_goku joined #perl6
08:04 mcmillhj joined #perl6
08:05 brrt joined #perl6
08:10 curan joined #perl6
08:12 AndyDee joined #perl6
08:12 travis-ci joined #perl6
08:12 travis-ci Doc build passed. JJ Merelo 'Merge branch 'extra-twigils' of github.com:perl6/doc into extra-twigils'
08:12 travis-ci https://travis-ci.org/perl6/doc/builds/236618966 https://github.com/perl6/doc/compare/98eee059134d...342f4ccbb7be
08:12 travis-ci left #perl6
08:22 travis-ci joined #perl6
08:22 travis-ci Doc build errored. Gabor Szabo 'index qr to make it easier to locate'
08:22 travis-ci https://travis-ci.org/perl6/doc/builds/236617704 https://github.com/perl6/doc/compare/68be3615a6b6...c297a2a52932
08:22 travis-ci left #perl6
08:25 stmuk joined #perl6
08:31 parv joined #perl6
08:34 zoll joined #perl6
08:40 parv joined #perl6
08:46 nadim joined #perl6
08:49 parv joined #perl6
08:56 nadim Good morning p6, is there a way to pass a junction as an object to a function rather than having it auto thread?
08:57 Actualeyes joined #perl6
09:14 lookatme yeah
09:15 nadim then how please
09:15 lookatme m: sub f(|c) { say c[0].WHAT; }(1|2|3)
09:15 camelia rakudo-moar 094e77: OUTPUT: «(Junction)␤»
09:15 lookatme use a Capture
09:15 nadim OK
09:17 nadim is there a way to mark the junction object so P6 will not autothread?
09:17 nadim the object, which can be a junction, is passed around and I'd prefer not change all the function calls to take captures
09:19 CacoS joined #perl6
09:23 bjz joined #perl6
09:23 lookatme What are you trying to do ?
09:24 nadim I am adding support for junctions in Data::Dump::Tree. it can be passed any object or structure.
09:25 nadim I'd change all the data passing to captures if necessary but I am curious to know if there is a class of non threading junctions.
09:28 lookatme Do you mean a multi method with Junction parameter ?
09:29 CacoS joined #perl6
09:30 bjz joined #perl6
09:30 CacoS joined #perl6
09:31 nadim sub, method, and multi method. I did not plan for junctions, I handle any object in a generic way. except that junctions don't get passed as an object but thread
09:31 cygx joined #perl6
09:31 lookatme m: sub (\c) { say c.WHAT;}(1|2)
09:31 camelia rakudo-moar 094e77: OUTPUT: «(Int)␤(Int)␤»
09:31 CacoS joined #perl6
09:31 lookatme I don't know :)
09:32 nadim :)
09:32 cygx nadim: no need to make them captures, but you do need a type constrain of Mu (which is the parent of both Junction and Any)
09:32 nadim that I can do easy, at least try :)
09:32 CacoS joined #perl6
09:33 lookatme Haha, I misunderstand you, probably ..
09:33 nadim lookatme: not always easy to guess what other think ;)
09:34 lookatme maybe, sometime code is easy understand than words
09:34 lookatme off work now . bye
09:37 circ-user-7AMq7 joined #perl6
09:38 circ-user-7AMq7 p6: say ('string' ~~ /tri/);
09:38 camelia rakudo-moar 094e77: OUTPUT: «「tri」␤»
09:38 circ-user-7AMq7 p6: say ('string ~~ /[k-x]/);
09:38 camelia rakudo-moar 094e77: OUTPUT: «5===SORRY!5=== Error while compiling <tmp>␤Unable to parse expression in single quotes; couldn't find final "'" ␤at <tmp>:1␤------> 3say ('string ~~ /[k-x]/);7⏏5<EOL>␤    expecting any of:␤        single quotes␤        term␤»
09:38 circ-user-7AMq7 p6: say ('string' ~~ /[k-x]/);
09:38 camelia rakudo-moar 094e77: OUTPUT: «5===SORRY!5===␤Unrecognized regex metacharacter - (must be quoted to match literally)␤at <tmp>:1␤------> 3say ('string' ~~ /[k7⏏5-x]/);␤Unable to parse expression in metachar:sym<[ ]>; couldn't find final ']' ␤at <tmp>:1␤------> 3s…»
09:42 dj_goku joined #perl6
09:42 cygx m: say 'string' ~~ /<[k..x]>/;
09:42 camelia rakudo-moar 094e77: OUTPUT: «「s」␤»
09:48 nadim cygx: Mu did the trick, thanks. I .gist the junction but I want to dig inside it, docs says junctions are not the best place for introspection, this will be fun.
09:49 nadim and just 1% of the tests fail, so far so good
09:51 robertle joined #perl6
09:51 cyphase joined #perl6
09:52 cygx nadim: there's a stackoverflow question about unpacking junctions, cf https://stackoverflow.com/questions/43568394
09:54 xinming joined #perl6
09:56 cygx bye o/
09:57 nadim great!
09:58 marcovorg joined #perl6
10:02 azawawi joined #perl6
10:02 azawawi Good afternoon
10:02 azawawi https://a.uguu.se/6JfFWsLdh32F.png # Graphics::PLplot example progress
10:03 azawawi working on both raw (native) and cooked api :)
10:04 nadim صباح النور
10:04 nadim nice lib
10:05 nadim azawawi: wx widget from P6?
10:14 azawawi nadim: thx
10:14 azawawi nadim: yes, through wxwidget PLplot output driver
10:14 azawawi nadim: if you need png, you would use 'png' driver and set the filename
10:15 azawawi working on translating http://plplot.sourceforge.net/examples.php?demo=00 to Perl and improving usability of API as i go along
10:15 nadim is the wx lib called directly from p6? I can't see a wx p6 module in the modules list
10:16 azawawi nope from the PLplot library
10:16 azawawi https://packages.debian.org/jessie/plplot12-driver-wxwidgets to be exact
10:17 andrzejk_ hello
10:17 andrzejk_ :)
10:17 azawawi andrzejk_: hi
10:18 andrzejk_ perl6 is awesome
10:18 andrzejk_ :)
10:29 domidumont joined #perl6
10:37 brrt joined #perl6
10:38 fatguy joined #perl6
10:45 circ-user-7AMq7 cegx: thanks for the correction! :)
10:45 circ-user-7AMq7 cygx: thanks for the correction! :)
11:01 zacts joined #perl6
11:07 bjz joined #perl6
11:14 mr-foobar joined #perl6
11:30 dj_goku joined #perl6
11:37 espadrine joined #perl6
11:37 Geth ¦ ecosystem: 1997e8d87b | (Zoffix Znet)++ (committed using GitHub Web editor) | META.list
11:37 Geth ¦ ecosystem: De-publish all of my Bailador-related modules
11:37 Geth ¦ ecosystem:
11:37 Geth ¦ ecosystem: I have no interest in maintaining these modules as Bailador
11:37 Geth ¦ ecosystem: project eventually did not meet my web dev needs
11:37 Geth ¦ ecosystem: review: https://github.com/perl6/ecosystem/commit/1997e8d87b
11:47 AlexDani` joined #perl6
12:06 azawawi https://a.uguu.se/BfXq1tfO5nYJ.gif  # PLplot Example 18 ... Perl 6 3D Plotting is here :)
12:07 azawawi The above is an animated GIF (will take a bit time to load from slow file sharing website)
12:20 timotimo azawawi: do you want an accounton hack.p6c.org so you can put stuff up on hack.p6c.org/~azawawi/stuff.gif ?
12:23 setty1 joined #perl6
12:26 azawawi timotimo: images that is?
12:27 azawawi timotimo: sure
12:27 azawawi timotimo: i had an account on feather
12:32 timotimo gimme the user name you'd like to have and an ssh pubkey
12:32 riatre joined #perl6
12:40 xiaomiao joined #perl6
12:40 azawawi timotimo: I will do it later. Blood sugar going lower with 1st day Ramadan fasting :)
12:40 azawawi timotimo: need to finish example at hand
12:41 timotimo understood. i'll not be at the keyboard terribly much the rest of the day
12:41 timotimo or at least not reliably
12:41 azawawi have fun
12:42 timotimo ty
12:43 bjz joined #perl6
12:44 azawawi Is there an easy way for a number to be a Num instead of a Rat (other that .Num or e0 suffix"?
12:44 jnthn The e0 suffix *is* the easy away :)
12:44 azawawi If a nativecall function uses num64 (which is common) then we have to cast to .Num everytime
12:45 timotimo in my sdl module i have one version where all parameters are num64, and another where all are Num
12:45 timotimo i mean, multi candidates
12:45 jnthn azawawi: Sure, but typically one writes Perl 6 wrapper functions rather than exposing the raw native calls, so in the wrappers you can just do Num() in the signature to get the coercion to happen.
12:46 azawawi I see. thanks
12:46 AlexDaniel m: sub foo(Num() $x) { say WHAT $x }; foo 2
12:46 camelia rakudo-moar 0c5fe5: OUTPUT: «(Num)␤»
12:49 circ-user-7AMq7 m: sub foo(Num() $x) { say WHAT $x }; for(^700){foo 2}
12:49 camelia rakudo-moar 0c5fe5: OUTPUT: «5===SORRY!5=== Error while compiling <tmp>␤Undeclared routine:␤    for used at line 1. Did you mean 'foo'?␤␤»
12:49 circ-user-7AMq7 m: sub foo(Num() $x) { say WHAT $x }; foo 2
12:49 camelia rakudo-moar 0c5fe5: OUTPUT: «(Num)␤»
12:49 AlexDaniel circ-user-7AMq7: you need a space after for
12:50 azawawi jnthn: in Graphics::PLplot im aiming on providing Raw (native) and cooked with sugar API :)
12:50 AlexDaniel circ-user-7AMq7: otherwise it is interpreted as a subroutine “for”
12:50 circ-user-7AMq7 thank you :)
12:50 AlexDaniel m: sub foo(Num() $x) { say WHAT $x }; for (^700){foo 2}
12:50 camelia rakudo-moar 0c5fe5: OUTPUT: «5===SORRY!5=== Error while compiling <tmp>␤Missing block (whitespace needed before curlies taken as a hash subscript?)␤at <tmp>:1␤------> 3) $x) { say WHAT $x }; for (^700){foo 2}7⏏5<EOL>␤    expecting any of:␤        block or pointy …»
12:50 AlexDaniel m: sub foo(Num() $x) { say WHAT $x }; for (^700) {foo 2}
12:50 camelia rakudo-moar 0c5fe5: OUTPUT: «(Num)␤(Num)␤(Num)␤(Num)␤(Num)␤(Num)␤(Num)␤(Num)␤(Num)␤(Num)␤(Num)␤(Num)␤(Num)␤(Num)␤(Num)␤(Num)␤(Num)␤(Num)␤(Num)␤(Num)␤(Num)␤(Num)␤(Num)␤(Num)␤(Num)␤(Num)␤(Num)␤(Num)␤(Num)␤(Num)␤(Num)␤(Num)…»
12:50 brrt joined #perl6
12:54 AlexDaniel should've said that you don't need parens, but I guess it's too late now :)
12:57 bjz joined #perl6
13:19 dj_goku joined #perl6
13:19 dj_goku joined #perl6
13:22 pilne joined #perl6
13:22 raiph joined #perl6
13:26 xiaomiao joined #perl6
13:42 Actualeyes joined #perl6
13:46 bjz joined #perl6
13:49 bjz_ joined #perl6
13:49 dogbert17 joined #perl6
13:54 kaare__ joined #perl6
13:56 fatguy joined #perl6
14:16 araraloren joined #perl6
14:17 araraloren evening .
14:20 AlexDaniel \o/
14:21 araraloren \o/ |o/ /o/ |o/ \o/ \o\
14:22 bjz joined #perl6
14:24 skids joined #perl6
14:33 khw joined #perl6
14:37 wamba joined #perl6
14:50 kaare__ joined #perl6
15:07 dj_goku joined #perl6
15:22 domidumont joined #perl6
15:25 committable6 joined #perl6
15:25 bisectable6 joined #perl6
15:34 AlexDaniel ∿o∿
15:35 sftf joined #perl6
15:40 sftf Hi! Is there Damian Conway's "400 Years of Perl 6" 2017 video?
15:54 aborazmeh joined #perl6
15:54 aborazmeh joined #perl6
16:17 xiaomiao joined #perl6
16:26 yqt joined #perl6
16:31 zakharyas joined #perl6
16:45 brrt joined #perl6
16:55 dj_goku joined #perl6
16:55 dj_goku joined #perl6
16:58 cdg joined #perl6
17:01 cdg joined #perl6
17:09 brrt joined #perl6
17:10 CacoS joined #perl6
17:15 Cabanossi joined #perl6
17:17 Praise joined #perl6
17:19 camelia_ joined #perl6
17:19 camelia_ left #perl6
17:20 perlista joined #perl6
17:25 brrt joined #perl6
17:50 Actualeyes left #perl6
17:52 cdg_ joined #perl6
18:06 pmurias joined #perl6
18:10 brrt joined #perl6
18:13 andrzejk_ joined #perl6
18:15 Cabanossi joined #perl6
18:19 CacoS joined #perl6
18:20 kaare__ joined #perl6
18:29 cdg joined #perl6
18:43 dj_goku joined #perl6
18:45 Cabanossi joined #perl6
18:47 perlista Geth: hi
18:47 perlista perlista: test
18:48 perlista perlista: test2
18:49 fatoban joined #perl6
18:49 fatoban perlista: hi
18:49 perlista fatoban: who are you?
18:51 gdonald joined #perl6
18:53 cdg_ joined #perl6
18:53 curt_ joined #perl6
18:54 zakharyas joined #perl6
19:06 cdg joined #perl6
19:10 dct joined #perl6
19:15 brrt joined #perl6
19:26 TEttinger joined #perl6
19:27 pecastro joined #perl6
19:45 Cabanossi joined #perl6
19:46 cdg joined #perl6
19:48 cdg joined #perl6
20:00 dct joined #perl6
20:15 Cabanossi joined #perl6
20:22 devmikey joined #perl6
20:32 dj_goku joined #perl6
20:32 dj_goku joined #perl6
20:44 labster joined #perl6
20:47 cdg joined #perl6
21:01 cognominal joined #perl6
21:17 Skarsnik joined #perl6
21:19 dct joined #perl6
21:21 cdg_ joined #perl6
21:24 cognominal joined #perl6
21:34 zacts joined #perl6
21:41 bjz joined #perl6
21:56 TEttinger joined #perl6
22:17 nadim any nice way to write this more compactly? if $p.key ~~ Str | Int &&  $p.value ~~ Str | Int.  this is not the same: if $p.key & $p.value  ~~ Str | Int
22:18 mst maybe an 'all' junction?
22:18 lizmat perhaps use Cool instead of Str|Int ?
22:18 mst if all($p.key, $p.value) ~~ Str|Int ?
22:19 lizmat it is less strict, but most likely does what you meabn
22:19 nadim I did try it earlier but I had other problems I'll try again
22:20 nadim mst: I'll try all but & is all, maybe it is necessary left hand side
22:20 dj_goku joined #perl6
22:20 dj_goku joined #perl6
22:21 cdg joined #perl6
22:24 mst ah, then either it's a precedence issue or my idea is wrong, I guess
22:24 nadim lizmat: Cool did not work. as I said, I tried it earlier but I didn't know why it didn't work so I replaced it with Int | Str.
22:24 nadim mst: all did not work, I don't know if it is possible to put junctions on both side of ~~
22:26 lizmat m: say "a" ~~ Int | Str   # why did this collapse ?
22:26 camelia rakudo-moar 0c5fe5: OUTPUT: «True␤»
22:27 AlexDaniel what a wonderful question
22:27 AlexDaniel maybe that's how it is supposed to be, but this is contrary to all of my expectations :)
22:28 jnthn 'cus that's what Junction.ACCEPTS does
22:28 zacts joined #perl6
22:29 jnthn This in turn means it can short-circuit
22:29 jnthn (all can return as soon as there's a non-match, any as soon as there's a match, etc.)
22:30 AlexDaniel sure, but why ~~ does and == doesn't? What's the idea?
22:31 itaylor57 joined #perl6
22:32 jnthn == is compiled into an infix:<==> call and subject to auto-threading; ~~ is macro-ish and does the magic stuff involving $_ and then calls rhs.ACCEPTS(lhs)
22:32 nadim jnthn: can junctions be on both sides of ~~? and if yes, why doesn't $x & $y ~~ Int | Str work?
22:32 lizmat jnthn++   # remembers now  :-)
22:33 itaylor57 joined #perl6
22:34 jnthn nadim: Yeah, but it means any(Int, Str).ACCEPTS($x & $y) which expands to any($x & $y ~~ Int, $x & $y ~~ Str)
22:35 nadim ah!
22:36 nadim and how does ont get it expanded to $x ~~ Int | Str && $y ~~ Int | Str ?
22:36 nadim if at all possible
22:37 mst ... would Int | Str ~~ $x & $y do so?
22:38 AlexDaniel m: my $x = 25; my $y = 2.5; say ($x, $y)».&(* ~~ Int | Str).all
22:38 camelia rakudo-moar 0c5fe5: OUTPUT: «all(True, False)␤»
22:38 AlexDaniel nadim: ha! look at these noodles of brainfart!
22:38 mst ... the goggles, they do nothing.
22:39 timotimo m: my $x = "hello"; my $y = 19; say all($x, $y).isa(Int|Str)
22:39 camelia rakudo-moar 0c5fe5: OUTPUT: «True␤»
22:39 jnthn mst: Don't think so; smartmatch is not symmetric
22:39 nadim looks like melted P6
22:39 mst jnthn: yes, using the asymmetricity was my thought
22:39 jnthn nadim: Something like timotimo++ just showed is more sensible :)
22:39 nadim timotimo++
22:39 mst m: my $x = "hello"; my $y = 19; say Int | Str ~~ $x & $y
22:39 camelia rakudo-moar 0c5fe5: OUTPUT: «False␤»
22:39 timotimo not actually certain it's correct
22:40 timotimo it could be the .isa on the junction of all() is checking against the junction on the rhs
22:40 mst surely that should be all($x, $y).ACCEPTS(Int | Str) ?
22:40 timotimo and saying "yup, this junction isa junction"
22:40 jnthn mst: It'd end up doing Int ~~ $x, though, rather than $x ~~ Int
22:40 mst oh right I see
22:40 timotimo m: say ("foo" & 10e1).isa(Int | Str)
22:40 camelia rakudo-moar 0c5fe5: OUTPUT: «True␤»
22:40 jnthn And it's the type being on the RHS that decides the semantics of the match are a type check
22:40 AlexDaniel nadim: by the way, if this code is going to be in a warm path, avoid junctions altogether and come up with something else :)
22:40 timotimo look, it's actually wrong
22:40 aborazmeh joined #perl6
22:40 timotimo well, not wrong, just not what you expect
22:40 aborazmeh joined #perl6
22:41 mst I keep suffering from my brain parsing & as bitwise even though it parses | fine
22:41 timotimo :)
22:41 nadim AlexDaniel: warm path?
22:41 jnthn m: subset IntOrStr where Int | Str; say "foo" & 42 ~~ IntOrStr
22:41 camelia rakudo-moar 0c5fe5: OUTPUT: «True␤»
22:41 jnthn m: subset IntOrStr where Int | Str; say "foo" & 4.2 ~~ IntOrStr
22:41 camelia rakudo-moar 0c5fe5: OUTPUT: «False␤»
22:42 nadim timotimo: no it did not work as expected/wished for
22:42 AlexDaniel nadim: well, anything that will be executed often
22:42 AlexDaniel nadim: because junctions were noticeably slow last time I checked
22:42 timotimo nadim: that's exactly what i said, though?
22:42 AlexDaniel not sure if they got faster while I was blinking :)
22:42 nadim it's a dumper, I don't know what the user dumps, so anything can be warm i guess
22:43 jnthn nadim: Doing a subset type like I did above is probably a good bet
22:43 nadim timotimo: had not got that far, when trying after the example
22:44 AlexDaniel mst: sometimes I see concatenation in it
22:45 Cabanossi joined #perl6
22:45 nadim jnthn: it's good to see it but maybe keeping it simple was a better idea to start with. junction ~~junction _looked_ simple but is obviously not
22:47 nadim thanks all for the fun moment, and getting to understand junctions better, final code looking like "f $p.key ~~ Str | Int && $p.value ~~ Str | Int" is not so bad afterall. jnthn's subset is cool too.
22:49 timotimo ah, okay
22:49 timotimo yeah, irc can move pretty fast sometimes
22:49 nadim specially when one goes on testing  ;)
22:51 timotimo that's why i tend to test stuff directly in irc, so others can immediately see where i'm at, where i'm going, and can point out problems to me
22:52 nadim good logic
22:53 timotimo i don't think i can stay awake too much longer ...
22:53 jnthn Me either :)
22:53 jnthn 'night, #perl6
22:54 timotimo nite jnthn
22:54 nadim night all.   here is the result. with dd dump at the bottom  http://imgur.com/reqEMiu
22:54 nadim yes it's a Pair from outter space ;)
22:56 timotimo quite readable
22:56 Geth ¦ doc: 9f2e762ed1 | (Zoffix Znet)++ (committed using GitHub Web editor) | doc/Type/IO/Handle.pod6
22:56 Geth ¦ doc: Fix typo
22:56 Geth ¦ doc: review: https://github.com/perl6/doc/commit/9f2e762ed1
22:56 nadim where pair of Int | Str are displayed on one line and expanded if not
22:56 mrsolo joined #perl6
22:57 integral joined #perl6
22:57 integral joined #perl6
22:57 nadim timotimo: which one? even dd is readable in this case but with more depth in the data structures horizontal display is not redeable
22:58 timotimo yup
22:58 timotimo i meant the ddt output
22:59 nadim it is it's only goal, making things redeable, The Match handling, specially with colors, is, imho, 10 times more redeable with ddt
23:00 benchable6 joined #perl6
23:00 quotable6 joined #perl6
23:00 bloatable6 joined #perl6
23:00 evalable6 joined #perl6
23:00 committable6 joined #perl6
23:00 timotimo you've already got a version that outputs an interactive html document; how well would you expect an interactive terminal-ui based one to work?
23:01 bisectable6 joined #perl6
23:01 nadim timotimo: better imo
23:01 nadim the html output does not support color for example
23:02 timotimo well, that's doable at least ;)
23:02 nadim yes it is
23:02 timotimo i should finish up my stacked bar graph thingie
23:03 timotimo https://imgur.com/tnhR6Zp - it looks a bit like this
23:03 nadim feel free to add a ticket on the repo with the terminal UI idea, and how you'd like it to be. note that the advantage of dhtml is that you can have loads of pages open in a browser and compare them, also possible in a terminal but less fun
23:04 nadim also, what would be really cool is to have a diff, which is supported, with forlding
23:05 nadim stacked and text mode, I like!
23:06 timotimo it has to learn to output multi-lined bars, too, as sometimes there's two splits in the same character
23:06 CIAvash[m] joined #perl6
23:06 nadim for 2D tables?
23:08 timotimo no, just to get around that limitation
23:08 u-ou joined #perl6
23:08 timotimo this uses the eights blocks unicode has to offer
23:08 timotimo and setting foreground and background colors
23:09 nadim terminal graphics is so geeky!
23:09 timotimo have you seen sixel? :)
23:10 timotimo in particular libsixel
23:10 nadim nope ... browsing
23:11 timotimo i've pointed like ten people at libsixel already in the last week or three :)
23:12 nadim there quite a few that does graphics on a terminal but it is the first time I see gif animations, Lol!
23:12 timotimo yeah! :D
23:12 nadim moritz: http://imgur.com/026cpjU  JSON::Tiny parse tree rendered by ddt
23:13 timotimo not only that, even Battle for Wesnoth in the terminal, and also some kind of graphical VM frontend running a windows in it %)
23:13 nadim Crazy!
23:14 nadim maybe we can render the dhtml on the terminal afterall!
23:14 * geekosaur remembers a site that was streaming world cup 2006 games over telnet via aalib
23:14 timotimo hah
23:15 timotimo there was also the april 1st thing where youtube offered TEXTp along 720p, 360p and 240p
23:17 * nadim must resist. resist man! don't start playing with, be strong, resists!
23:17 timotimo i've a little bit of a start for a libsixel binding
23:17 timotimo but i figured out i needed a bunch of changes to go on and then i stopped working on it
23:17 nadim Do it!
23:18 nadim notice how I say that I must resist but you should not ;)
23:18 timotimo hah
23:20 timotimo https://github.com/timo/libsixel-p6
23:20 nadim sixel is a killer, I'll have a look in the morning. but we can do quite a lot with text and colors. here is an example of a match, maybe not needed, .gist probably does a job good enough for most to read but with some efforts ... http://imgur.com/cHsvdzx
23:21 timotimo what kind of image support are you imagining?
23:21 nadim I don't get you question, can you please explain?
23:21 timotimo oh, note also that only a few somewhat niche terminal emulators will actually display sixel
23:22 nadim I read that DEc something
23:22 timotimo well, what would you do with sixel?
23:22 geekosaur yes, sixel graphics was a dec vt2xx+ thing
23:22 nadim sixel/curses
23:22 nadim a curses that looks good (for nothing but still)
23:23 nadim I was going to say, port asciio to it but it would be better to port it to curses (after I make some qooxdoo thingy)
23:24 azawawi joined #perl6
23:24 timotimo i haven't heard of asciio yet
23:24 zostay m: my %x := ().Bag; %x<a>
23:24 camelia rakudo-moar 0c5fe5: OUTPUT: «This type (Scalar) does not support associative operations␤  in block <unit> at <tmp> line 1␤␤»
23:24 nadim hu! gtk app that let's you draw ascii flowcharts and whatnot
23:24 azawawi hi
23:24 azawawi maybe https://github.com/azawawi/perl6-terminal-caca/tree/master/examples to ASCii Art ? :)
23:25 zostay that's causing a regression in Hash::MultiValue, but it doesn't feel like a regression in my code but possibly in rakudo?
23:25 MasterDuke bisect: my %x := ().Bag; %x<a>
23:25 bisectable6 MasterDuke, Bisecting by exit code (old=2015.12 new=0c5fe56). Old exit code: 0
23:25 bisectable6 MasterDuke, bisect log: https://gist.github.com/d43a9bf6d1445203fa016afc790abbaf
23:25 bisectable6 MasterDuke, (2017-05-22) https://github.com/rakudo/rakudo/commit/b43db636ab7c0f2bdeab310a86e1c6e96a530437
23:26 nadim timotimo: https://youtu.be/0l9W84PhOyI?t=170
23:27 timotimo that's cool
23:27 * nadim bows down
23:27 timotimo oh, you built this?
23:27 nadim and very useful, just need to have manager that are not sissies and want powerpoint quality
23:28 nadim yes a few years ago, I think I may do next version in P6, if I get time
23:28 troys joined #perl6
23:28 azawawi nadim++
23:29 MasterDuke zostay: could you file a ticket and .tell lizmat?
23:29 greppable6 joined #perl6
23:29 unicodable6 joined #perl6
23:29 nadim there's a presentation mode, I don't even remember how to use it ;), I made a presentation for to management with it once; just to piss some off :)))
23:29 statisfiable6 joined #perl6
23:30 azawawi nadim: Please take a look at http://rosettacode.org/wiki/Draw_a_rotating_cube#Perl_6 # Shameless advertising :)
23:33 nadim azawawi: I guess you know this one https://www.youtube.com/watch?v=M2F-KTrT_0E
23:36 azawawi nadim: cool
23:38 nadim night all
23:38 travis-ci joined #perl6
23:38 travis-ci Doc build passed. Zoffix Znet 'Fix typo'
23:38 travis-ci https://travis-ci.org/perl6/doc/builds/236773819 https://github.com/perl6/doc/compare/c297a2a52932...9f2e762ed1d1
23:38 travis-ci left #perl6
23:40 azawawi timotimo: Python still beats us in simplicity http://rosettacode.org/wiki/Draw_a_rotating_cube#Python ... Damn you Python :)
23:42 nadim .tell timotimo https://github.com/stefanhaustein/TerminalImageViewer
23:42 azawawi nadim: good night
23:42 nadim arff what's the name of the teller service?
23:42 nadim azawawi: night
23:45 MasterDuke nadim: yoleaux, but it seems to be down
23:45 nadim thanks
23:45 Cabanossi joined #perl6
23:46 timotimo not bad
23:47 timotimo nadim: hq9+ also beats us handily at hello world, quine, 99 bottles of beer, and incrementing a pointer
23:47 nadim that would be azawawi
23:47 timotimo oops, yes
23:53 aborazmeh joined #perl6
23:53 aborazmeh joined #perl6
23:56 azawawi :)
23:56 azawawi i like vpython's approach. We need that with SDL :)

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

Perl 6 | Reference Documentation | Rakudo