Perl 6 - the future is here, just unevenly distributed

IRC log for #perl6, 2016-08-28

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:11 mcmillhj joined #perl6
00:13 vendethiel- joined #perl6
00:23 mcmillhj joined #perl6
00:41 mcmillhj joined #perl6
00:46 mcmillhj joined #perl6
00:47 bjz joined #perl6
00:48 Xliff How do I access a hash, dynamically? Please not I am not talking dynamic variables in the * sense, but a variable name that is formed programatically.
00:49 Xliff ::("%variable_name") maybe?
00:49 Xliff m: my %a = (a => 1); dd ::("%a");
00:49 camelia rakudo-moar 6a8278: OUTPUT«Hash %a = {:a(1)}␤»
00:49 geekosaur may need to use '' instead
00:49 Xliff Oooo!
00:49 Xliff rakudo++ # Able to work out stuff on your own.
00:50 Xliff Well...
00:50 Xliff m: my %a = (a => 1); my $var = "a";  dd ::("%$var");
00:50 camelia rakudo-moar 6a8278: OUTPUT«Hash %a = {:a(1)}␤»
00:50 Xliff Awesome.
00:50 zacts joined #perl6
00:52 awwaiid m: my %a = (a => 1); my $var = '%a'; dd ::($var)
00:52 camelia rakudo-moar 6a8278: OUTPUT«Hash %a = {:a(1)}␤»
00:53 awwaiid you should think of the % as part of the name of the var, such that separating it out is unnatural
00:55 bioduds joined #perl6
00:55 bioduds hey there
00:55 bioduds ===SORRY!=== Error while compiling hello.pl                                                                Can't use unknown trait 'is required' in an attribute declaration.
00:56 bioduds this is weird
00:56 bioduds has $.name is required;
00:56 awwaiid hm
00:57 awwaiid in a class?
00:57 bioduds yes
00:57 bioduds in a class
00:57 awwaiid link the whole example maybe
00:57 awwaiid 'cause seems like that should work
00:57 Xliff awwaiid: Given interpolation, does it really matter?
00:57 bioduds #!/usr/bin/env perl6 use v6;  class Human {   # CLASS ATTRIBUTE - like static   my $.species = "Homo Sapiens";    # Attributes   has $.name is required;    has $.age is required is rw; # is rw so that it can be modified later   has $.sex is required;    method talk {     return "Money Talks!";   }  }  my $human = Human.new( name=>'Eduardo', age=>36, sex=>'M' );  say $human.age ~ " start age"; $human.age = 37; say "One year later... "
00:57 tbrowder Xliff: that is why i asked the question earlier and mentioned docs on hash are sketchy. see gdflex's answer to me
00:58 awwaiid Xliff: doesn't matter in the technial sense at all, more a philosophical / strategic suggestion
00:58 Xliff m: $a = { hex => '#404040', red =>  64, green =>  64, blue =>  64 }; my $arr = [ $a{keys $a}:p.flat ]; dd $arr;
00:58 camelia rakudo-moar 6a8278: OUTPUT«5===SORRY!5=== Error while compiling <tmp>␤Variable '$a' is not declared␤at <tmp>:1␤------> 3<BOL>7⏏5$a = { hex => '#404040', red =>  64, gre␤»
00:58 Xliff m: my $a = { hex => '#404040', red =>  64, green =>  64, blue =>  64 }; my $arr = [ $a{keys $a}:p.flat ]; dd $arr;
00:58 camelia rakudo-moar 6a8278: OUTPUT«Array $arr = $[:red(64), :green(64), :blue(64), :hex("#404040")]␤»
00:59 tbrowder Xliff: that should be gfldex
00:59 bioduds no errors there
00:59 Xliff awwaiid: Understood. That was more an optimization since I am only working with programmatical hashes (can't say "dynamic" anymore!)
00:59 bioduds ran in another machine
00:59 awwaiid m: class Human { has $.name is required; has $.age is required is rw } ; my $human = Human.new( name=>'justice', age=>79, sex=>'M') ; say $human
00:59 camelia rakudo-moar 6a8278: OUTPUT«Human.new(name => "justice", age => 79)␤»
01:00 awwaiid m: class Human { my $.species = 'homo sapiens'; has $.name is required; has $.age is required is rw } ; my $human = Human.new( name=>'justice', age=>79, sex=>'M') ; say $human
01:00 camelia rakudo-moar 6a8278: OUTPUT«Human.new(name => "justice", age => 79)␤»
01:00 bioduds ===SORRY!=== Error while compiling hello.pl                                                                Can't use unknown trait 'is required' in an attribute declaration.                                         at hello.pl:9                                                                                              ------>                                                                                                        expec
01:01 geekosaur this would be easier if you'd use a pastebin of some kind instead of cramming it into an irc line
01:01 awwaiid I'm surprised my $.species works, bu tit doesn't have an is required so probably irrelevant
01:01 bioduds it is weird
01:02 awwaiid I guess that's a class-scoped var
01:02 bioduds cause in another machine runs fine
01:02 awwaiid oh that's very interesting
01:02 awwaiid same rakudo?
01:02 bioduds i installed the same way on both
01:02 bioduds sudo apt install rakudo
01:02 awwaiid check it anyway :)
01:02 awwaiid perl6 --version
01:02 bioduds how to check rakudo version?
01:02 bioduds oh
01:02 bioduds wait
01:03 awwaiid yep
01:03 bioduds so first is
01:03 bioduds This is Rakudo version 2016.08.1-3-g668dc5c built on MoarVM version 2016.08 implementing Perl 6.c.
01:03 awwaiid deliciously up to date
01:03 bioduds this above works
01:04 bioduds second one does not
01:04 bioduds This is perl6 version 2013.12 built on parrot 5.9.0 revision 0
01:04 awwaiid 2013.12 ya
01:04 bioduds very old
01:04 awwaiid anything older than about 2015.12 (christmas release) is going to not be worth using
01:04 bioduds i installed before sudo apt update I guess
01:04 awwaiid could be, or maybe different debians?
01:05 bioduds let me rebuild the machine
01:05 awwaiid sounds good
01:05 awwaiid albeit drastic. but machines are just files these days I suppose
01:06 Xliff DAGNABBIT!
01:06 Xliff Is the use of "require" statements not allowed in pasers?
01:06 awwaiid well you don't have to be upset about it -- in unix EVERYTHING is a file anyway, might as well make the machine a file too
01:07 awwaiid is 'pasers' -> 'phasers' or -> 'parsers' ?
01:07 Xliff I get this if I try to require() in BEGIN or INIT "Cannot invoke this object (REPR: Null; VMNull)"
01:07 Xliff Eer.
01:07 Xliff awwaiid, if its not obvious by now, s/pasers/phasers/
01:07 geekosaur sounds like That Bug yet again
01:07 awwaiid Xliff: :)
01:08 Xliff geekosaur: Is "That Bug" a recent occurence? I last rakudobrew'd two weeks ago.
01:08 geekosaur (there's a bug they've been playing whack-a-mole with where the compilation context isn't maintained properly in things like that)
01:08 geekosaur it is not something recently introduced or recently fixed
01:08 Xliff kk
01:08 Xliff I will rakudobrew anyway
01:09 Xliff Just because I like the sound of my compilers, and the smell of burnt silicon in the morning.
01:09 geekosaur RT 129096 is the most recently reported instance of it (and has links to other instances)
01:09 Xliff should I RT this one?
01:10 geekosaur RT #129096 wakey wakey...
01:10 synopsebot6 Link:  https://rt.perl.org/rt3//Publ​ic/Bug/Display.html?id=129096
01:10 jeek Does perl6 have decent bigint support, and if so, how's the performance?
01:10 awwaiid jeek: yes decent support. I don't know about performance.
01:10 Xliff jeek: BigInt is baked into Int
01:10 geekosaur probably, if there isn't one already that covers it which is why I dug out that bug
01:10 jeek I've been doing weird recreational math crap for this retired professor for funsies, wondering how well it'd run. Might have to give it a crack.
01:10 jeek Rakudo still the VM of choice?
01:10 bioduds same thing
01:11 awwaiid jeek: it is. rakudobrew recommended way of getting it, or apt if you are on debian unstable
01:11 bioduds after rebuilding the slice and updating
01:11 awwaiid bioduds: same version of rakudo?
01:11 bioduds yes
01:11 bioduds i guess I should perhaps upgrade
01:11 awwaiid bioduds: what does `cat /etc/issue` say you are running? I suspect the other machine is debian unstable and this is not
01:12 bioduds let me see
01:12 awwaiid m: $n = 4567827273678726678376378263782263637383; $n++ ; say $n ; say $n.WHAT # <- jeek
01:12 camelia rakudo-moar 6a8278: OUTPUT«5===SORRY!5=== Error while compiling <tmp>␤Variable '$n' is not declared␤at <tmp>:1␤------> 3<BOL>7⏏5$n = 45678272736787266783763782637822636␤»
01:12 awwaiid m: my $n = 4567827273678726678376378263782263637383; $n++ ; say $n ; say $n.WHAT # <- jeek
01:12 camelia rakudo-moar 6a8278: OUTPUT«456782727367872667837​6378263782263637384␤(Int)␤»
01:12 awwaiid hmm. maybe that wasn't big enough
01:12 bioduds it is ubuntu 14.04
01:12 bioduds LTS
01:13 awwaiid bioduds: and the one that works?
01:13 geekosaur that's testing, not unstable
01:13 bioduds should work by updating
01:13 skink jeek, We also have proper rationals :)
01:13 bioduds the one that works is ubuntu 16.04
01:13 geekosaur right, that would make sense
01:13 awwaiid bioduds: yep, there you go then. in fact, I'm not sure how ubuntu 16.04 has the version released this month
01:13 geekosaur you need to use rakudobrew with 14.04
01:14 geekosaur and I don't know about 16.04 either
01:14 bioduds I believe 16.04 with simple apt install rakudo was enough
01:14 geekosaur you do *not* want to try to convert ubuntu or an ubuntu-derived system to debian sid
01:14 bioduds im upgrading 14.04 to try
01:16 perlawhirl joined #perl6
01:16 awwaiid is there like an update channel for rakudo in ubuntu that keeps it up to date? ubuntu 16.04 released in April shouldn't have August rakudo, right?
01:16 geekosaur 16.04 is an LTS, I can't see it having a later rakudo
01:16 awwaiid in fact, looking at https://launchpad.net/ubuntu/+source/rakudo, I don't think you got your recent rakudo from apt, bioduds . what does `which rakudo` say?
01:16 geekosaur maybe the system has a PPA for someone's up to date rakudo build though
01:17 perlawhirl what's the best way to read a POD file... Specifically, how do I render the POD that comes with Text::CSV
01:17 bioduds which rakudo says nothing
01:17 geekosaur that was the wrong command
01:17 bioduds upgraded didnt work too
01:17 geekosaur which perl6 (or better, type perl6)
01:18 bioduds which perl6 /home/admin/.rakudobrew/bin/perl6
01:18 awwaiid ah
01:18 geekosaur there you go
01:18 skink Hm, interesting
01:18 awwaiid ok bioduds, on your machine running perl6 2016.08 you installed it using rakudobrew rather than apt
01:18 skink m: my Int $x = 10; for ^1000000 { $x / 2 }; say now - INIT now;
01:18 camelia rakudo-moar 6a8278: OUTPUT«WARNINGS for <tmp>:␤Useless use of "/" in expression "$x / 2" in sink context (line 1)␤2.5922761␤»
01:19 bioduds nope, just apt-get install rakudo
01:19 awwaiid geekosaur: I never used type to find something in the path. fancy
01:19 bioduds dont worry
01:19 geekosaur bioduds, apt-get does not install /home/admin/.rakudobrew/bin/perl6
01:19 geekosaur that is rakudobrew
01:19 bioduds well
01:19 * skink needs to upgrade
01:19 bioduds only thing I did was sudo apt-get install rakudo
01:20 bioduds but dont worry
01:20 bioduds i need to leave now
01:20 awwaiid bioduds: maybe someone else did it :)
01:20 bioduds thanks for assistance
01:20 bioduds :)
01:20 bioduds ill try late
01:20 bioduds later
01:20 awwaiid cool, have fun!
01:21 geekosaur awwaiid, the difference is in most shells (for bash, it depends on the version of bash) "which" shows what a *new* shell will see, whereas "type" always shows what the current shell thinks it knows
01:21 awwaiid ah
01:21 geekosaur (this may be incorrect if someone removed the thing after the shell last saw it)
01:21 awwaiid right. hence me randomly running 'rehash' when i stop trusting things.
01:27 Xliff m: my %a = { a => 1}; dd ::("%a);
01:27 camelia rakudo-moar 6a8278: OUTPUT«5===SORRY!5===␤Unable to parse expression in double quotes; couldn't find final '"' ␤at <tmp>:1␤------> 3my %a = { a => 1}; dd ::("%a);7⏏5<EOL>␤    expecting any of:␤        postfix␤Other potential difficulties:␤    Useless use of h…»
01:27 geekosaur even more fun, if it's not a shell builtin then it may be looking at your dotfiles --- meaning it shows what you will see the next time you log in, if you edited your dotfiles and didn't make the same changes to your running shell
01:27 Xliff m: my %a = { a => 1}; dd ::("%a");
01:27 camelia rakudo-moar 6a8278: OUTPUT«Potential difficulties:␤    Useless use of hash composer on right side of hash assignment; did you mean := instead?␤    at <tmp>:1␤    ------> 3my %a = { a => 1}7⏏5; dd ::("%a");␤Hash %a = {:a(1)}␤»
01:27 geekosaur loads of fun :/
01:28 Xliff m: my %a = ( a => 1 ); dd ::("%a");
01:28 camelia rakudo-moar 6a8278: OUTPUT«Hash %a = {:a(1)}␤»
01:28 Xliff m: my %a = ( a => 1 ); dd ::("%a")<a>;
01:28 camelia rakudo-moar 6a8278: OUTPUT«Int %a = 1␤»
01:28 Xliff o_O
01:29 geekosaur I think you have exceeded the scope of dd, there
01:29 geekosaur (it's a bit of a hack)
01:31 Xliff Well. No.
01:31 Xliff camelia returns what I would expect.
01:31 Xliff However I appear to have oversimplified my use case.
01:32 Xliff Because what I am really trying to do is not working.
01:33 Xliff I'm working on https://github.com/Xliff/p6-color-names
01:33 Xliff And when trying to do "perl6 -Ilib --stagestats -e 'use Color::Names; dd ::("\%Color::Names::Cloford::Colors")<grey42>;'"
01:33 timotimo you might have to put the actual :: operator between the pieces of name
01:33 Xliff I get "Any %Colors = Any"
01:35 Xliff timotimo: You mean something like --> ::("\%Color)::("Names")::("Cloford")::("Colors")
01:35 Xliff (aaieee!
01:36 geekosaur m: package Foo { our $bar = 5; }; dd ::('$Foo::bar')
01:36 camelia rakudo-moar 6a8278: OUTPUT«Int $bar = 5␤»
01:36 timotimo well, after the first part i think you can leave out the (" and ")
01:36 timotimo because then it's no longer dynamic
01:36 Xliff Even this doesn't work --> "perl6 -Ilib --stagestats -e 'use Color::Names; dd %Color::Names::Cloford::Colors<grey40>;'"
01:36 timotimo hm
01:36 timotimo oh
01:37 timotimo you do realize you have that as "my %Colors"?
01:37 timotimo and thus it'd only be available from inside the package?
01:37 Xliff Changed to "our" like 10 minutes ago
01:37 timotimo OK
01:37 timotimo what do things like Color::.keys and such give you?
01:38 Xliff What I would expect.
01:38 Xliff A long sequence of color names.
01:38 timotimo every step of the way?
01:39 Xliff Every step of the way? "Color::.keys" gives me an error
01:39 timotimo i thought it gives you a long sequence of color names?
01:39 Xliff perl6 -Ilib --stagestats -e 'use Color::Names; dd %Color::.keys' --> "Variable '%Color' is not declared. Did you mean '&color'?"
01:40 Xliff perl6 -Ilib --stagestats -e 'use Color::Names; dd %Color::Names::Cloford::Colors.keys' --> Long Seq of color names
01:40 timotimo oh
01:40 timotimo if you put %Color in the first bit, that'll give you trouble if you have a long sequence of individual parts
01:41 Xliff Ahh
01:41 Xliff perl6 -Ilib --stagestats -e 'use Color::Names; dd Color::.keys' --> '("Names").Seq'
01:45 Xliff perl6 -Ilib --stagestats -e 'use Color::Names; dd Color::Names.keys' --> '()'
01:45 timotimo ok, so the % in front must have been the problem
01:45 timotimo you need Color::Names::.keys
01:45 timotimo you're not refering to a package otherwise
01:45 Xliff ("Cloford", "EXPORT").Seq
01:45 Xliff Color::Names::Cloford::.keys --> ("\%Colors",).Seq
01:45 Xliff So ::("%Color::Names::Cloford::Colors) and ::("Color::Names::Cloford::%Colors) gives me the same results
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!
01:47 Xliff timotimo: ?? - I don't understand what you are asking in that last bit.
01:48 Xliff perl6 -Ilib --stagestats -e 'use Color::Names; dd ::("Color::Names::Cloford::%Colors"){"grey42"}' --> "Any %Colors = Any"
01:48 Xliff But...
01:48 Xliff perl6 -Ilib --stagestats -e 'use Color::Names; dd ::("Color::Names::Cloford::%Colors")' --> will return a dump of the entire hash
01:50 Xliff *sigh* it is now Saturday night, and my willingness to be sober has evaporated.
01:51 Xliff Actually evaporated 30 minutes ago, but I'm out of beer.
01:54 araujo_ joined #perl6
01:54 timotimo very weird
02:00 Xliff timotimo, I thought so to!
02:00 Xliff You think I should RT?
02:00 timotimo i'ven't had any concentration left in my brain an hour ago
02:00 timotimo and it's too warm in my apartment to get any sleep
02:00 Xliff OK. It can wait until later when both of us have braincells in operation. :)
02:01 timotimo suffice it to say, i'm pretty sure there's a simple solution to our problem, i'm just not coming up with it from a distance
02:01 Xliff LOL
02:01 timotimo i haven't cloned the repository, for example. that seems like an obvious first step
02:01 Xliff I actually feel the same way about THIS one. It's the other one that's bothering me.
02:06 mcmillhj joined #perl6
02:08 pierre_ joined #perl6
02:15 vendethiel joined #perl6
02:17 bjz joined #perl6
02:22 mcmillhj joined #perl6
02:26 grondilu joined #perl6
02:27 pierre_ joined #perl6
02:29 mcmillhj joined #perl6
02:34 grondilu joined #perl6
02:43 pecastro_ joined #perl6
02:43 kenedensency joined #perl6
02:44 kenedensency 哈囉
02:44 noganex joined #perl6
02:45 grondilu m: my Int sub () { 13 }  # I had no idea this was correct syntax!
02:45 camelia rakudo-moar 6a8278: ( no output )
02:45 grondilu m: my Int sub () { "Foo" }()
02:45 camelia rakudo-moar 6a8278: OUTPUT«Type check failed for return value; expected Int but got Str ("Foo")␤  in sub  at <tmp> line 1␤  in block <unit> at <tmp> line 1␤␤»
02:46 grondilu coo
02:46 grondilu cool
02:46 mcmillhj joined #perl6
02:50 Ben_Goldberg m: my sub (--> Int) { 13 }().say;
02:50 camelia rakudo-moar 6a8278: OUTPUT«13␤»
02:50 Ben_Goldberg m: my sub (--> Int) { "Foo" }().say;
02:50 camelia rakudo-moar 6a8278: OUTPUT«Type check failed for return value; expected Int but got Str ("Foo")␤  in sub  at <tmp> line 1␤  in block <unit> at <tmp> line 1␤␤»
02:51 BenGoldberg grondilu, As you can see, perl6 offers more than one way to do it :)
02:51 BenGoldberg m: my sub (--> Int) { "Foo" };
02:51 camelia rakudo-moar 6a8278: ( no output )
02:53 BenGoldberg It would be nice though, if rakudo attempted, at compile time, to do some type checking, even before the sub got called.
02:54 geekosaur that kind of stuff is WIP
03:01 dalek whateverable: fbf968b | MasterDuke17++ | / (2 files):
03:01 dalek whateverable: Change %additional_files to the more idiomatic %additional-files
03:01 dalek whateverable: review: https://github.com/perl6/wha​teverable/commit/fbf968b680
03:01 cognominal joined #perl6
03:07 grondilu how do you deal with typedefs in NativeCall?  I mean for instance with "typedef int32 myIntType;".  Do you just replace all occurence of myIntType with int32?
03:08 grondilu subset myIntType of int32 would not work, would itN
03:08 grondilu it?
03:11 Xliff constant with bind operator, I think
03:11 Xliff constant myIntType := int32
03:12 grondilu m: constant foo := int; sub (foo) { say "ok" }(23);
03:12 camelia rakudo-moar 6a8278: OUTPUT«ok␤»
03:12 * grondilu is impressed
03:12 grondilu so you can define types as constants.  Nice.
03:14 mcmillhj joined #perl6
03:14 Xliff (types as objects)++
03:15 adu joined #perl6
03:17 b2gills m: constant foo := int; say foo.^name; # it is an alias
03:17 camelia rakudo-moar 6a8278: OUTPUT«int␤»
03:18 Xliff_ joined #perl6
03:19 baest_ joined #perl6
03:19 mohae joined #perl6
03:19 sQuEE` joined #perl6
03:20 edenc_ joined #perl6
03:20 peteretep_ joined #perl6
03:21 zostay_ joined #perl6
03:22 Roamer` joined #perl6
03:22 Cabanoss- joined #perl6
03:22 AlexDani` joined #perl6
03:23 sergot_ joined #perl6
03:23 markk_ joined #perl6
03:23 pecastro1 joined #perl6
03:23 ilmari_ joined #perl6
03:23 atacama_ joined #perl6
03:24 khagan_ joined #perl6
03:24 albino_ joined #perl6
03:25 nbg23 joined #perl6
03:26 SourceBaby joined #perl6
03:26 dalek joined #perl6
03:26 synopsebot6 joined #perl6
03:26 dylanwh joined #perl6
03:27 mcmillhj joined #perl6
03:28 vike joined #perl6
03:28 geekosaur joined #perl6
03:29 broquaint joined #perl6
03:29 SmokeMachine____ joined #perl6
03:32 DrParis joined #perl6
03:32 sftp joined #perl6
03:32 timeless joined #perl6
03:32 BuildTheRobots joined #perl6
03:36 grondilu so I'm trying to see if I'm not too dumb to use NativeCall.
03:36 kurahaupo joined #perl6
03:36 grondilu so I put this line in a test.c file:
03:37 grondilu int add(int a, int b) { return a + b; }
03:37 grondilu I compile it as such:
03:37 grondilu $ gcc -shared -c test.c -o libtest.so
03:37 grondilu and then I try:
03:38 mcmillhj joined #perl6
03:38 grondilu $ perl6 -e 'use NativeCall; sub add(int64, int64 --> int64) is
03:38 grondilu native<./test> {...}; say add(1, 2);'
03:38 grondilu and it fails
03:38 grondilu with:
03:39 grondilu Cannot locate native library '/home/grondilu/libtest.so': /home/grondilu/libtest.so: only ET_DYN and ET_EXEC can be loaded
03:39 TEttinger joined #perl6
03:39 grondilu and I feel like that:
03:39 grondilu http://i1.kym-cdn.com/photos/ima​ges/facebook/000/234/765/b7e.jpg
03:40 grondilu oh wait, probably wrong gcc arguments
03:40 geekosaur grondilu, I think you need a bit more than that to make a shared object
03:41 geekosaur my guess is it's an ordinary object file (.o)
03:43 grondilu oh yeah
03:43 grondilu first:
03:43 grondilu $ gcc -c test.c
03:43 grondilu then:
03:43 grondilu $ gcc -shared -o libtest.so test.o
03:43 kaare_ joined #perl6
03:44 geekosaur first gcc needs -fPIC
03:44 geekosaur (you can get away without it on 32-bit x86 linux, but you should not rely on this. notably, you *must* use PIC on 64-bit)
03:44 geekosaur you also need -Wl,-soname,libtest.so.1 on the second one
03:45 geekosaur which is the secret sauce that makes ld generate a shared object
03:46 geekosaur (an ET_DYN, as your error message put it)
03:49 autarch joined #perl6
03:52 Xliff_ FEH!
03:52 Xliff_ perl6 -Ilib --stagestats -e 'use Color::Names; dd ::("Color::Names::Cloford::%Colors"){"gray42"}' --> works
03:52 * Xliff_ headdesks
03:52 Xliff_ timotimo: ^^
03:53 mcmillhj joined #perl6
03:58 Xliff_ Can someone tell me why this doesn't work?
03:58 Xliff_ https://github.com/Xliff/p6-color-nam​es/blob/master/lib/Color/Names.pm#L34
03:59 grondilu m: package Foo {}; require Foo;
03:59 camelia rakudo-moar 6a8278: OUTPUT«Could not find Foo at line 0 in:␤    /home/camelia/.perl6␤    /home/camelia/rakudo-m-inst-1/share/perl6/site␤    /home/camelia/rakudo-m-inst-1/share/perl6/vendor␤    /home/camelia/rakudo-m-inst-1/share/perl6␤    CompUnit::Repository::AbsolutePath…»
03:59 Xliff_ Attempting to use Color::Names with that uncommented yields "Cannot invoke this object (REPR: Null; VMNull)". I have not yet been able to golf a smaller use case.
04:00 geekosaur pretty much any time you get that error from something in a phaser, you're hitting a version of the bug I pointed to earlier
04:00 geekosaur where it's trying to use a context that the compiler didn't save as part of the phaser
04:03 mcmillhj joined #perl6
04:04 pierre_ joined #perl6
04:09 Cabanossi joined #perl6
04:16 Xliff_ geekosaur, should I RT and point to the repo since I can't golf it down further?
04:17 geekosaur probably, yes
04:17 Xliff_ kk
04:17 geekosaur I expect it'll just get added to that list of null-SC tickets
04:18 geekosaur until someone can figure out a better way to handle it that doesn't need special handling every time someone trips over this
04:21 Xliff_ HAH!
04:21 Xliff_ Golfed.
04:24 geekosaur so, what's happening is, when the compiler generates bytecode, it does so in a thing called a serialization context. every module has its own SC, and phasers also get their own independent SCs because they run at different times than the module does.
04:25 Xliff_ Dammit.
04:25 geekosaur the SC for a phaser is thrown away after the code for the phaser is compiled. but if you do certain things in the phaser, the generated code wants to add things to the SC at runtime (imported symbols, in this case). but the compiler threw the SC away and its pointer is VMNull
04:25 Xliff_ Can someone reset this from perl5 to perl6?
04:25 Xliff_ https://rt.perl.org/Ticket/Display.html?id=1291​09&amp;results=688c8f90fc6b26c601c9e21a40b383a8
04:26 geekosaur ...and I think you don't even want to add to that SC, you want to add to the module's SC, which is not something the compiler currently deals with very well if at all
04:26 geekosaur so, this is a fairly hairy class of internal compiler bug
04:27 Xliff_ grrr... I can't change the details in my own ticket! :P
04:29 Xliff_ I can't even DELETE my ticket so I can re-create it properly. *sigh*
04:29 Xliff_ Ah well. I've commented. It's in there.
04:30 Xliff_ geekosaur: Ouch. I get it. Maybe selectively throw away the SC if certain op codes are present (ala "require" or "use")
04:31 Xliff_ But I guess that opens its own can of works.
04:31 Xliff_ s/works/worms/
04:31 geekosaur see the second part, it needs to serialize what it's compiling to the compile time SC but store the module's main SC as the runtime SC. and make sure the two are compatible.
04:32 geekosaur jnthn could tell you more (and correct any errors in my understanding), but generally it's a tangled mess that conflates compile time and runtime in bad ways
04:41 mcmillhj joined #perl6
04:49 NeuralAnomaly joined #perl6
04:49 aindilis joined #perl6
04:57 NeuralAnomaly New blog post: "Open Source Projects: When Ideas Meet Reality": http://perl6.party/post/Open-Source​-Projects--When-Ideas-Meet-Reality
04:59 mcmillhj joined #perl6
05:02 NeuralAnomaly left #perl6
05:03 Xliff_ Hrm.
05:03 Xliff_ Koans?
05:06 Xliff_ The Java koans are weird.
05:07 Xliff_ I wonder if the extensive use of "__" is there to encourage people to figure out what is supposed to happen and replace it with the answer.
05:09 Xliff_ geekosaur: So, in the short term, you would recommend me trying to refactor this code without a phaser?
05:10 Xliff_ The only other way I think this would work is if I could add my behavior to the default EXPORT().
05:10 geekosaur that's probably the easiest way that will get you something working
05:11 Xliff_ Otherwise I'd have to call an extra sub to init things, and that would be sub-optimal, but as you say, it would work.
05:11 Xliff_ geekosaur: Do you know anything about the EXPORT mechanics?
05:12 geekosaur not really, no
05:12 Xliff_ kk
05:12 Xliff_ Any suggestions as to who to ask?
05:12 Xliff_ jnthn perhaps (although he has enough on his plate!)
05:13 mcmillhj joined #perl6
05:15 cibs joined #perl6
05:15 timotimo i know a bit about the mechanics
05:15 timotimo what do you need to know?
05:23 pierre_ joined #perl6
05:23 ufobat joined #perl6
05:26 Xliff_ timotimo: I figured out my mistake earlier. As you suspected, it was something silly.
05:27 Xliff_ Re: EXPORT. Is there any way I can add custom behavior to the default?
05:27 Xliff_ Maybe redefine and use callsame()?
05:27 Xliff_ or would that be nextsame()
05:28 Xliff_ Please note that this would be a hack to work around the fact that I can't use INIT or BEGIN to do what I need.
05:28 timotimo i don't think there's a default EXPORT
05:28 timotimo just the difference between having no export and having any export?
05:28 Xliff_ Hrm.
05:28 Xliff_ OK. Lemme read up on it.
05:29 Xliff_ I will probably have to manually emulate.
05:29 timotimo the last time i looked a bit more into that whole thing was long before the whole CompUnit Repo stuff
05:29 Xliff_ Right.
05:29 timotimo i wonder if you find the EXPORT:: in the module even before "use"ing
05:29 Xliff_ perl6 -Ilib --stagestats -e 'use Color::Names; dd ::("Color::Names::Cloford::%Colors"){"gray42"}' --> works
05:30 Xliff_ ^^
05:30 Xliff_ /o\
05:32 timotimo did you use grey instead of gray the whole time?
05:35 Xliff_ Yes.
05:35 timotimo fantastic \o/
05:35 Xliff_ LOL
05:35 Xliff_ Well crap... require in EXPORT() gives the same error.
05:36 timotimo what error are you getting?
05:36 Xliff_ Cannot invoke this object (REPR: Null; VMNull)
05:36 timotimo what are you requiring in export for?
05:37 Xliff_ Well, I'm trying to abstract sub packages behind a main package.
05:38 Xliff_ I have Color::Names. I don't really want the user to have to worry about needing "Color::Names::Crayola" or "Color::Names::Cloford"
05:38 timotimo btw, since your packages all just include that single hash every time, i'm almost going to recommend loading the data from %*RESOURCES at EXPORT time
05:38 timotimo is it really important to you that you're not just loading all the other modules in your top-level module?
05:38 mcmillhj joined #perl6
05:38 Xliff_ *sigh*
05:38 Xliff_ I guess I could do that.
05:38 timotimo hehe
05:39 timotimo let me check out your code and have a look-see
05:39 Xliff_ Originally I wanted it to be selectable. So that the end user, if they looked at the nitty-gritty and didn't want collisions, could avoid it.
05:39 timotimo OK, so you were going for something like "use Color::Names 'crayons'"?
05:40 Xliff_ And also so people could submit PRs and have the new modules automatically picked up.
05:40 Xliff_ timotimo: Yes. Exactly.
05:40 timotimo and it's not acceptable to use import tags?
05:40 Xliff_ or "use Color::Names" (semantically equivalent to "use Color::Names 'all')
05:41 timotimo oh wait what is this?
05:41 Xliff_ I'd rather not have all of that data cluttering up Color::Names.
05:41 timotimo what are you going through the repo chain like that for?
05:41 Xliff_ LOL
05:41 Xliff_ I could probably do that better with %*RESOURCES when I understand what it does.
05:42 Xliff_ That code finds the Color::Names directory and grabs all of the submodules.
05:42 Xliff_ Like I said. I didn't want the user to NEED to know all of the package names if they didn't want to worry about it.
05:42 Xliff_ I will admit this is probably overthinking.
05:42 timotimo i'm pretty sure that's not the way to do it :)
05:43 Xliff_ Well I wouldn't have known it was not the way to do it until I tried doing it.... right?! =)
05:44 Xliff_ So I have avoided trying to grok %*RESOURCES because last time I looked, the docs were light on explanation.
05:44 TEttinger joined #perl6
05:44 Xliff_ I could then move all that crap to EXPORT() or some such.
05:45 Xliff_ But hey... I now know how to find all of the include paths.
05:45 timotimo well, resources is just a section of the meta.json that you put files into that you later want to be able to grab out of the RESOURCES constant
05:45 Xliff_ OH!
05:46 Xliff_ Yeah. I haven't gotten to the META.json part, yet.
05:46 Xliff_ (maybe I should add that.
05:46 Xliff_ )
05:46 timotimo well, if you don't have a meta.json, things are going to be very difficult with regards to moduley stuff
05:46 Xliff_ I usually don't worry about that until I've finished coding.
05:46 timotimo if you don't have one, your files are probably going to be considered "just a bunch of random files"
05:47 Xliff_ OK. So "Start with META.json" -- got it.
05:47 timotimo hm, gtk-simple is not a good example for RESOURCES
05:47 Xliff_ LOL!~
05:47 Xliff_ I looked there!
05:47 timotimo where'd the "every perl6 module" thing go; i swear i had it cloned on my machine at one point
05:48 Xliff_ What? Ecosystem?
05:48 timotimo https://github.com/moritz/perl6-all-modules
05:48 timotimo no
05:48 timotimo every perl6 module we have in the ecosystem in one folder
05:49 Xliff_ Oh wow!
05:49 Xliff_ Good to know!
05:49 timotimo also, i should have said %?RESOURCES the whole time.
05:51 Xliff_ LOL!
05:51 Xliff_ Ooh... Zoffy has a Color class.
05:51 timotimo i was hoping i could find a cool example of export tags
05:51 Xliff_ I may want to add optional support for that.
05:52 Xliff_ So I guess I could try "require Color" CATCH if it doesn't exist?
05:52 timotimo m: try require Foo::Bar::Baz; say Foo::Bar::Baz::.defined
05:52 camelia rakudo-moar 6a8278: OUTPUT«Could not find symbol '&Baz'␤  in block <unit> at <tmp> line 1␤␤Actually thrown at:␤  in block <unit> at <tmp> line 1␤␤»
05:53 timotimo oh, right
05:53 timotimo m: try require Foo::Bar::Baz '&bazz'; say &bazz.defined
05:53 camelia rakudo-moar 6a8278: OUTPUT«False␤»
05:53 timotimo m: try require Test '&is'; say &is.defined
05:53 camelia rakudo-moar 6a8278: OUTPUT«False␤»
05:53 timotimo well, that's not how!
05:53 Xliff_ :(
05:53 timotimo m: try require Test '&is'; say is
05:53 camelia rakudo-moar 6a8278: OUTPUT«Cannot invoke this object (REPR: Uninstantiable; Callable)␤  in block <unit> at <tmp> line 1␤␤»
05:53 timotimo m: require Test '&is'; say is
05:53 camelia rakudo-moar 6a8278: OUTPUT«Cannot resolve caller is(...); none of these signatures match:␤    (Mu $got, Mu:U $expected, $desc = "")␤    (Mu $got, Mu:D $expected, $desc = "")␤  in block <unit> at <tmp> line 1␤␤»
05:54 timotimo m: try require Test '&is'; say is 1, 2, "whoa";
05:54 camelia rakudo-moar 6a8278: OUTPUT«Cannot invoke this object (REPR: Uninstantiable; Callable)␤  in block <unit> at <tmp> line 1␤␤»
05:54 timotimo m: say (try require Test).perl;
05:54 camelia rakudo-moar 6a8278: OUTPUT«Test␤»
05:54 timotimo m: say (try require BazQuux).perl;
05:54 camelia rakudo-moar 6a8278: OUTPUT«Nil␤»
05:54 timotimo that's probably the easiest way to get at it
05:54 Xliff_ Cool!
05:54 timotimo m: say (try require BazQuux)::.keys;
05:54 camelia rakudo-moar 6a8278: OUTPUT«5===SORRY!5=== Error while compiling <tmp>␤Confused␤at <tmp>:1␤------> 3say (try require BazQuux):7⏏5:.keys;␤    expecting any of:␤        colon pair␤»
05:54 timotimo m: say (try require BazQuux).keys;
05:54 camelia rakudo-moar 6a8278: OUTPUT«()␤»
05:54 timotimo m: say (try require Test).keys;
05:54 camelia rakudo-moar 6a8278: OUTPUT«()␤»
05:54 timotimo that's what i meant to copy-paste
05:54 timotimo hm, but that's not it
05:55 timotimo m: say (try require Test).WHAT.perl;
05:55 camelia rakudo-moar 6a8278: OUTPUT«Test␤»
05:55 timotimo ... right
05:55 timotimo i haven't done enough with modules and packages at all
05:55 Xliff_ m: say (try require BazQuux).WHAT.perl
05:55 camelia rakudo-moar 6a8278: OUTPUT«Nil␤»
05:55 timotimo m: say (try require Test); say Test::.keys;
05:55 camelia rakudo-moar 6a8278: OUTPUT«5===SORRY!5=== Error while compiling <tmp>␤Undeclared name:␤    Test used at line 1␤␤»
05:55 timotimo m: say (try require Test); say GLOBALish::Test::.keys;
05:55 camelia rakudo-moar 6a8278: OUTPUT«(Test)␤Could not find symbol '&Test'␤  in block <unit> at <tmp> line 1␤␤Actually thrown at:␤  in block <unit> at <tmp> line 1␤␤»
05:55 timotimo m: say (try require Test); say GLOBAL::Test::.keys;
05:55 camelia rakudo-moar 6a8278: OUTPUT«(Test)␤(&todo_output EXPORT &failure_output &output)␤»
05:55 timotimo that's closer to it
05:55 timotimo m: say (try require Test); say GLOBAL::Test::EXPORT::.keys;
05:55 camelia rakudo-moar 6a8278: OUTPUT«(Test)␤(DEFAULT ALL)␤»
05:56 timotimo m: say (try require Test); say GLOBAL::Test::EXPORT::DEFAULT::.keys;
05:56 camelia rakudo-moar 6a8278: OUTPUT«(Test)␤(&isnt &plan &pass &cmp-ok &flunk &does-ok &subtest &unlike &like &use-ok &todo &skip-rest &eval-dies-ok &is-deeply &throws-like &ok &is &diag &done-testing &bail-out &is-approx &skip &dies-ok &lives-ok &eval-lives-ok &MONKEY-SEE-NO-EVAL &nok &is_…»
05:56 timotimo but relying on require putting stuff into GLOBAL is not going to stay around, i believe
05:56 Xliff_ I like the .WHAT.perl version
05:56 timotimo pssh, i'm sleep-deprived
05:56 timotimo nine is working on making imports properly lexical
05:56 Xliff_ Simple and probably more correct than checking EXPORT.
05:57 Xliff_ But this has been helpful, timotimo++
05:57 mcmillhj joined #perl6
05:59 timotimo if anything, you probably got a little laugh out of me
05:59 Xliff_ Nah.
05:59 Xliff_ Seriously... nothing could be worse than "grey" vs "gray"
05:59 Xliff_ :p
06:00 timotimo :)
06:00 Xliff_ m: say (try require BazQuux).defined
06:00 camelia rakudo-moar 6a8278: OUTPUT«False␤»
06:00 Xliff_ m: say (try require Test).defined
06:00 camelia rakudo-moar 6a8278: OUTPUT«False␤»
06:00 timotimo i have cravings for things but it's sunday so grocery shops won't open :(
06:00 Xliff_ Ouch.
06:00 Xliff_ Craving for what?
06:00 Xliff_ And damn... delivery here is done for the night. 2am
06:01 timotimo strawberry milkshake ... or something like that
06:01 timotimo all i ever drink at home is tap water ... i'm mostly completely fine with that, but sometimes it ain't enough
06:01 Xliff_ HO! No! Some places are open until 4am for Sat.
06:01 Xliff_ \o/
06:02 Xliff_ But no milkshakes. :(
06:04 Xliff_ Dammit! Missing 4¢ from delivery minimum!
06:04 * Xliff_ shakes fist.
06:04 timotimo milkshake fist?
06:05 Xliff_ Stop it!
06:05 Xliff_ Darn it... no milk.
06:05 timotimo i love it when i'm just randomly clicking through pages of a tumblr and suddenly the theme is completely differend and at the very beginning there's just some random code leaking out
06:05 Xliff_ I have everything else.
06:05 * Xliff_ avoids social media.
06:06 Xliff_ What random tumblr did you find with code?
06:06 timotimo oh, no, that's actual code that's supposed to be configuring the theme
06:06 timotimo it's just spilling out at the seams, because something somewhere in the pipeline sprung a leak
06:06 Xliff_ I don't know why, but I equate "social media" as the internet equivalent of "reality tv"
06:06 Xliff_ Oh, LOL!
06:07 Xliff_ OK. So I doubled my order of chips. Delivery inbound. Buffalo wings... MMMMMMMm
06:07 timotimo https://www.youtube.com/watch?v=p-R1O7FN3yI - it started out with this cute loopable video and it went on from there with pretty/stimulating/satisfying gifs and vines and such
06:08 Xliff_ timotimo, will %?RESOURCES work from module source tree (ie not installed)
06:08 timotimo rakudo will pick up META.json in not installed modules, i believe
06:08 timotimo i don't remember the exact way it works
06:08 Xliff_ Cool.
06:08 Xliff_ rakudo++
06:08 mcmillhj joined #perl6
06:09 Xliff_ m: say (try require Test).WHAT.perl
06:09 camelia rakudo-moar 6a8278: OUTPUT«Test␤»
06:09 timotimo i hope it actually does and i'm not just imagining things again :D
06:09 Xliff_ m: say (try require Test).WHAT
06:09 camelia rakudo-moar 6a8278: OUTPUT«(Test)␤»
06:09 Xliff_ m: say (try require Test)
06:09 camelia rakudo-moar 6a8278: OUTPUT«(Test)␤»
06:09 Xliff_ m: say (try require Test).defined
06:09 camelia rakudo-moar 6a8278: OUTPUT«False␤»
06:09 Xliff_ Oh. Type object.
06:09 Xliff_ timotimo needs sleep... BADLY!
06:10 Xliff_ =)
06:10 Xliff_ Or is that "food".... or is that both "sleep" and "food"?
06:10 Xliff_ Or should we just settle with "milkshake"??
06:10 timotimo i need sloop
06:10 Xliff_ Because I wouldn't mind all three right now.
06:11 Xliff_ sloop.defined --> False
06:11 timotimo at this point, the plural of sloop would just be pure luxury
06:11 timotimo sloop is the singular of sleep
06:11 timotimo just like shoop is the singular of sheep
06:11 timotimo and foot is the singular of feet
06:11 Xliff_ I disbeliefe.
06:11 Xliff_ s/fe/ve/
06:11 Xliff_ It sounds need, though.
06:11 timotimo doesn't make it any less truo!
06:11 timotimo ... true!
06:11 Xliff_ ROFL
06:12 Xliff_ If it's dark will you be eaten by a gruo?
06:12 timotimo it's not dark. it's 8am. sun's already up.
06:12 Xliff_ Do you postdate that reference?
06:13 Xliff_ https://en.wikipedia.org/wiki/Grue_(monster)
06:13 timotimo hm?
06:13 timotimo oh. no, i've seen grues referenced often enough
06:13 Xliff_ Ah.
06:13 timotimo i haven't played the original that had it. some text adventure i believe?
06:13 wamba joined #perl6
06:13 Xliff_ Zork
06:13 Xliff_ And I have.
06:13 timotimo ah. *the* text adventure
06:13 Xliff_ When it was released!
06:13 Xliff_ And now I have dated myself. :P
06:14 timotimo Zork McCorken and Allen the MorndBornder, right?
06:14 TEttinger joined #perl6
06:14 Xliff_ https://en.wikipedia.org/wiki/Zork
06:14 timotimo i know, i know :)
06:14 Xliff_ I don't know where you got "McCorken" and "MorndBornder" though.
06:15 timotimo Zak McKraken and the Alien Mindbenders
06:15 Xliff_ Ah!
06:15 Xliff_ Yeah. I knew that!
06:16 Xliff_ Now I need to think of something new for SVG::Plot.
06:21 timotimo ah, the color names thing was for svg::plot because svg supports these color names natively?
06:21 CIAvash joined #perl6
06:30 Xliff_ No
06:31 timotimo no?
06:31 Xliff_ Came from working on SVG::Plot examples and me having to look up color charts on the web to get the hex codes.
06:31 timotimo oh, ok!
06:31 timotimo are the plots benchable outputs still unreadable on gist because of the transparent background?
06:31 timotimo oh, wait ... that's probably only on my laptop because i have the "dark github" style on there!
06:31 Xliff_ LOL
06:32 Xliff_ I use that too.
06:32 Xliff_ I didn't know there were benchable outputs.
06:33 timotimo oh?
06:33 timotimo .seen benchable
06:33 yoleaux I saw benchable 11 Aug 2016 12:25Z in #perl6: <benchable> unmatched}: ¦«sleep»:Cannot find this revision
06:33 timotimo https://gist.github.com/Whateverabl​e/ee0173e2863fb8b9444613332eaefd62
06:34 timotimo i'm not sure why it says "is invalid so it cannot be displayed"
06:34 timotimo https://gist.github.com/Whateverabl​e/5df6e5d98481b11c8480052e37cc5df6
06:34 timotimo there we go, we have an example
06:34 Xliff_ That worked.
06:35 Xliff_ Hum.... how was that graph generated?
06:35 Xliff_ Is that something benchable does?
06:36 timotimo yeah, i believe it uses SVG::Plot
06:36 Xliff_ Ah.... plots the results of "releases my @a = (^15).combinations(3); my $a = @a.elems"
06:36 timotimo no, it plots the timings of that code
06:36 Xliff_ Oh.. for each release.
06:36 timotimo the results from that code would ideally be the same no matter what release you use
06:37 Xliff_ Well... if rakudo was stable and not in the middle of optimizations.
06:38 timotimo optimizations should not change the amount of combinations of 3 numbers between 0 and 14 you can get
06:38 Xliff_ Well.. optional support for Color object added. I think it will break the other methods, though.
06:38 Xliff_ Actually no... it's fine.
06:39 Xliff_ Now I just need to get all of this EXPORT stuff sorted.
06:39 Xliff_ I really want selective loading.... but ...
06:39 mcmillhj joined #perl6
06:40 Xliff_ Next stop... META.json
06:40 Xliff_ ...After reading more Stross... and eating more Buffalo wings.... and sleep... and....
06:40 timotimo if you read the color data in your EXPORT from %?RESOURCES, you wouldn't even need submodules any more
06:40 timotimo and it'll be pre-compiled for you, too
06:41 Xliff_ Eh... how would I do that?
06:41 Xliff_ Put the color data in META.json?!?
06:41 timotimo no, of course not
06:41 Xliff_ <- conf00sled
06:41 timotimo the meta.json just lists the files that contain your easy-to-parse format for these color names to color values
06:41 timotimo then EXPORT will check what colors the user wanted, open these resources files and parse, then give back enums or hashes or what-have-you
06:42 Xliff_ Ah! But the parsing!
06:42 Xliff_ One of the design goals was to avoid parsing.
06:42 Xliff_ Hence the submodules.
06:42 timotimo if it's just 4 space-separated strings per line, is that really "parsing"? :)
06:42 Xliff_ I may not be grokking what you are trying to say though.
06:43 Xliff_ 4?
06:43 Xliff_ color hex r g b
06:43 timotimo ok, 5. whatever :)
06:44 Xliff_ throw X::OffByOne
06:44 Xliff_ It's a common coder ailment. ;)
06:44 timotimo i didn't realize you had a hex representation in there
06:44 timotimo i would've just generated it from the color values, but *shrug*
06:44 Xliff_ Pre optimization.
06:44 timotimo also, as long as our color stuff doesn't actually support better color spaces and profiles, we won't be taken seriously.
06:45 Xliff_ I actually take the hex and generate the r g b when I create the submodules.
06:45 Xliff_ Look in gen/
06:45 timotimo not everything is sRGB, you know
06:45 Xliff_ Yes. Which is why I quickly added support for Color object.
06:45 timotimo :)
06:45 * timotimo ran out of serious
06:46 * Xliff_ ran out of serious hours ago.
06:46 Xliff_ About the time when I ran out of beer.
06:46 Xliff_ Then I bought more beer.
06:46 timotimo we have a serious shortage. of serious. for serious.
06:46 Xliff_ (why is my glass empty?!)
06:46 Xliff_ SRSLY!!!
06:46 timotimo i don't like beer. but i would have liked to share a few bottles of pear cider with my friend tonight
06:47 Xliff_ I also-s got rum to go with my coke...
06:47 Xliff_ Or is that coke to go with my rum.
06:47 Xliff_ (why is my glass empty again!??)
06:49 timotimo i'll awayfrom my keyboard for a little bit
06:50 Xliff_ ok
06:50 Xliff_ I think I will too.
06:50 Xliff_ Wings... Stross... RUM!
06:58 mcmillhj joined #perl6
07:04 darutoko joined #perl6
07:08 mcmillhj joined #perl6
07:18 pecastro joined #perl6
07:29 Rawriful joined #perl6
07:32 nadim joined #perl6
07:36 araujo__ joined #perl6
07:37 canopus joined #perl6
07:38 araujo__ joined #perl6
07:40 firstdayonthejob joined #perl6
07:41 mcmillhj joined #perl6
07:43 labster joined #perl6
07:46 stmuk_ https://www.youtube.com/watch?v=LfrlqxzeSSE
07:47 stmuk_ that seems to have all 10 hrs of the main room
07:47 stmuk_ of YAPC
07:54 mcmillhj joined #perl6
08:08 mcmillhj joined #perl6
08:09 setty1 joined #perl6
08:12 labster joined #perl6
08:27 woolfy left #perl6
08:35 Xliff_ GAH!
08:35 Xliff_ "You cannot create an instance of this type (Color)"
08:35 Xliff_ resulted from
08:35 Xliff_ ::("Color").new(:hex($c<hex>))
08:35 Xliff_ But this works
08:36 timotimo is it just a package?
08:36 Xliff_ perl6 -e 'require Color; dd ::("Color").new(:hex("#ffffff"))'
08:36 Xliff_ No. Color is an object.
08:36 Xliff_ Hm....ah crap. Scope.
08:36 timotimo well, would you look at that
08:37 masak m: class Color { has $.hex }; say Color.new(:hex<#ffffff>)
08:37 camelia rakudo-moar 6a8278: OUTPUT«Color.new(hex => "#ffffff")␤»
08:37 masak works here.
08:37 masak m: class Color { has $.hex }; say ::("Color").new(:hex<#ffffff>)
08:37 camelia rakudo-moar 6a8278: OUTPUT«Color.new(hex => "#ffffff")␤»
08:37 Xliff_ I think this is messing things:
08:37 Xliff_ if $obj.defined && !(try require ::("Color")).WHAT.perl.defined {
08:37 Xliff_ die "Color module cannot be found.";
08:37 Xliff_ } else {
08:37 Xliff_ require ::("Color");
08:37 Xliff_ }
08:38 masak try without the `else`, perhaps?
08:38 masak also, I don't know offhand if `require` does any importing by default
08:38 Xliff_ The else is new.
08:38 Xliff_ I would think the try would do it.
08:38 Xliff_ But it does not.'
08:38 timotimo require will put your stuff into the lexical scope it's in
08:38 timotimo that's also why you have to "try require" and not "try { require }"
08:38 timotimo unless you use the return value of the try
08:39 timotimo rather than relying on the thing being available in your scopes
08:39 masak oh, right. you're doing `require` twice
08:39 Xliff_ Right, but I get that error with and without the else.
08:40 timotimo if you're gonna die anyway, why not put require ::("Color") further on the outside and check if the requirement was met, and die otherwise?
08:40 masak (and, in general, be very suspicious of `try`)
08:41 timotimo do, with, or for. there is no try.
08:41 masak `try` is the "oh look, I can put my hand on this stovetop -- it makes smoke but it doesn't hurt!" of error handling
08:41 Xliff_ Are you effing kidding me!??!?
08:41 masak no.
08:42 Xliff_ require Color if $colorSupport;
08:42 Xliff_ ==> Cannot invoke this object (REPR: Null; VMNull)
08:42 * Xliff_ pulls hair.
08:42 masak Xliff_: if you can golf that, we might have something to rakudobug.
08:42 Xliff_ masak: Already done.
08:43 Xliff_ https://rt.perl.org/Ticket/Display.html?id=129109
08:43 masak reproduced locally.
08:43 masak $ perl6 -Ilib -e'my $colorSupport = True; require Color if $colorSupport; say "hi"'
08:43 masak ===SORRY!===
08:43 masak Cannot invoke this object (REPR: Null; VMNull)
08:43 Xliff_ I'm now thinking it has nothing to do with phasers and everything to do with programatic require.
08:44 * masak adds the case with the `if` statements to that ticket
08:44 Xliff_ masak++
08:44 Xliff_ That thing has been biting me all day.
08:45 Xliff_ (and my day should have long been over, by now)
08:45 masak seems eminently workaroundable, luckily.
08:45 Xliff_ However wings, Stross, and perl6 have been keeping me awake.
08:45 Xliff_ Despite beer, rum and coke!
08:46 Xliff_ masak: Workaround, you say? Do tell! ;)
08:46 masak just a feeling.
08:46 * Xliff_ is now playing: Eschaton - Imaginary Skies (Nemanoe Remix)
08:46 * Xliff_ bops
08:46 masak or put it like this:
08:47 Woodi hi today :)
08:47 Xliff_ \o Woodi
08:47 masak the fact that `require Color` works but `require Color if $something` doesn't means that you can use the former and not hit the error.
08:47 masak hi Woodi
08:47 masak Woodi: you're mistaken, though: it's already tomorrow.
08:47 masak today was yesterday :P
08:48 Woodi I'm trying zef and it wants put things into /usr/share... --to opotions don't want to put things into /usr/me/perl6... how to use zef ?
08:49 Xliff_ masak: "require Color; ::("Color").new(:hex("#ffffff"))" --> You cannot create an instance of this type (Color)
08:49 Woodi masak: I can agree with that cruel statement - today WAS yesterday :)
08:49 Xliff_ Woodi: But does that mean that today is really tomorrow?
08:49 Woodi Xliff_: not sure about tomorow :)
08:50 Xliff_ =)
08:50 Woodi *tomorrow even
08:51 * masak .oO( jam to-morrow and jam yesterday -- but never jam today )
08:51 timotimo Xliff_: do you remember the ::EXPORT::DEFAULT dance?
08:51 timotimo how about you try to require Color and then ::Color::EXPORT::DEFAULT::Color.new?
08:52 masak maybe combined with setting `constant C = ::Color::EXPORT::DEFAULT::Color;`.
08:56 smls joined #perl6
08:57 mcmillhj joined #perl6
08:57 Xliff_ ::Color doesn't work.
09:00 Xliff_ GLOBAL::Color::EXPORT::DEFAULT doesn't work because Color is a class.
09:02 Xliff_ s$ perl6 -Ilib -e 'require Color; dd GLOBAL::Color::.keys'
09:02 Xliff_ ("ValidRGB",).Seq
09:02 Xliff_ There should be something that can reference all Class objects.
09:02 Xliff_ s$ perl6 -Ilib -e 'require Color; dd GLOBAL::.keys'
09:03 Xliff_ Oops
09:03 Xliff_ m:  dd GLOBAL::.keys'
09:03 camelia rakudo-moar 6a8278: OUTPUT«5===SORRY!5=== Error while compiling <tmp>␤Two terms in a row␤at <tmp>:1␤------> 3dd GLOBAL::.keys7⏏5'␤    expecting any of:␤        infix␤        infix stopper␤        postfix␤        statement end␤        statement modifier␤…»
09:03 Xliff_ m:  dd GLOBAL::.keys;'
09:03 camelia rakudo-moar 6a8278: OUTPUT«5===SORRY!5=== Error while compiling <tmp>␤Unable to parse expression in single quotes; couldn't find final "'" ␤at <tmp>:1␤------> 3dd GLOBAL::.keys;'7⏏5<EOL>␤    expecting any of:␤        single quotes␤        term␤»
09:03 Xliff_ m:  dd GLOBAL::.keys;
09:03 camelia rakudo-moar 6a8278: OUTPUT«().Seq␤»
09:03 Xliff_ Wheee!
09:04 geraud joined #perl6
09:05 masak so it doesn't do any import
09:07 TEttinger joined #perl6
09:09 Xliff_ Not for classes.
09:09 Xliff_ I thought Classes didn't need import.
09:09 masak you're saying that it imports some things, but not classes?
09:10 Xliff_ That's what it looks like.
09:10 masak Xliff_: if you do `use`, then classes are definitely imported by default.
09:10 masak Xliff_: I don't think I would expect the same with a bare `require`.
09:10 Xliff_ Now if I "use" it works. However "use" in a conditional sense is lexical.
09:10 masak yes, because `use` is BEGIN-time.
09:10 Xliff_ Right. We are saying the same thing.
09:11 Xliff_ So how can I import a class given an already executed require()?
09:11 Xliff_ Or access said class globally?
09:13 mcmillhj joined #perl6
09:17 RabidGravy joined #perl6
09:21 doublec left #perl6
09:21 masak reading S11, it seems `require Color <Color>;` might do the trick.
09:23 Xliff_ Testing
09:25 Xliff_ "Trying to import from 'Color', but the following symbols are missing: Color"
09:31 rindolf joined #perl6
09:33 antipsychiatry joined #perl6
09:33 girafe joined #perl6
09:35 nine Wow...just woke up after ~ 12 hours of sleep
09:37 masak nine: is this in any way connected to YAPC::Europe? :)
09:38 masak (which I hear was especially good this year, by the way)
09:40 mvorg joined #perl6
09:40 nine masak: it does seem likely ;)
09:42 nine Nevertheless I'm looking forward to the Alpine Perl Workshop :)
10:00 timotimo xl, i got a milkshake
10:01 smls We've exceeded 1400 open RT tickets... :S
10:03 mcmillhj joined #perl6
10:03 espadrine joined #perl6
10:04 timotimo https://goo.gl/photos/FPqcTz5ceFjMi6Lg7
10:05 pierre_ joined #perl6
10:10 timotimo imagine we didnt have enough users so our bug tracker was empty all the time
10:11 leont joined #perl6
10:21 lambd0x joined #perl6
10:21 lambd0x Hi everyone!
10:25 lambd0x > my @a = <1 2 3 4>; sub test($num, *@tmp) { $num.say; }; say test(@a);
10:25 lambd0x m: my @a = <1 2 3 4>; sub test($num, *@tmp) { $num.say; }; say test(@a);
10:25 camelia rakudo-moar 6a8278: OUTPUT«[1 2 3 4]␤True␤»
10:27 lambd0x I wanted to know whether its possible to take a num from an array in test using random order. Is it?
10:29 gfldex joined #perl6
10:30 mcmillhj joined #perl6
10:36 titsuki m: my @a = <1 2 3 4>; sub test($num, *@tmp) { $num.say; @tmp.say; }; test(|@a.pick: *);
10:36 camelia rakudo-moar 6a8278: OUTPUT«3␤[4 2 1]␤»
10:37 titsuki m: my @a = <1 2 3 4>; sub test($num, *@tmp) { $num.say; @tmp.say; }; test(|@a.pick: *);
10:37 camelia rakudo-moar 6a8278: OUTPUT«2␤[1 3 4]␤»
10:39 titsuki ambd0x: Is my answer sufficient for you ?
10:41 lambd0x titsuki: It's perfect, I just am trying to undestand the meaning of '|' in front of @a.pick and ': *'
10:41 lambd0x *understand.
10:41 lambd0x titsuki: could you explain it to me, please?
10:41 titsuki | means flatten
10:42 titsuki m: sub test($num, *@temp){ say $num; }; test(1,2,3);
10:42 camelia rakudo-moar 6a8278: OUTPUT«1␤»
10:43 titsuki m: sub test($num, *@temp){ say $num; }; test([1,2,3]);
10:43 camelia rakudo-moar 6a8278: OUTPUT«[1 2 3]␤»
10:43 lambd0x titsuki: Ok, and the second means: pick every el. of the array?
10:44 titsuki yes
10:44 lambd0x titsuki: awesome. Thank you :)
10:44 titsuki :)
10:48 mcmillhj joined #perl6
10:51 n1lp7r joined #perl6
10:59 leont joined #perl6
10:59 smls Is `sub EXPORT` implemented in Rakudo?
11:00 smls I can't seem to get it to work...
11:02 smls It says  "no EXPORT sub, but you provided positional argument in the 'use' statement"  even though I did declare an EXPORT sub in the `use`d module.
11:08 cygx joined #perl6
11:08 cygx o/
11:09 cygx smls: you have to declare EXPORT in the mainline, ie outside any package/module/class declaration
11:12 smls cygx: Thanks!
11:16 eliasr joined #perl6
11:22 MasterDuke joined #perl6
11:27 BenGoldberg joined #perl6
11:29 MasterDuke Xliff_: there are a couple things that i can think of to add to SVG::Plot (if you're looking for ideas)
11:29 yoleaux 27 Aug 2016 13:55Z <tbrowder> MasterDuke: thanks!
11:30 MasterDuke setting a background color, having the line plot also show ticks at the data points, option to put text at the data points, ability to modify the rotation of x/y labels (and customize them more in general), option to hover over the points and see the x/y coordinates
11:30 wamba joined #perl6
11:31 kaare_ joined #perl6
11:40 Xliff_ \o/
11:40 Xliff_ MasterDuke++
11:41 Xliff_ MasterDuke: Good ideas. Can you open an issue on the github page so I don't forget?
11:41 araujo joined #perl6
11:41 araujo joined #perl6
11:41 MasterDuke sure
11:41 Xliff_ Thanks.
11:42 Xliff_ timotimo++ # Milkshake
11:42 Ven joined #perl6
11:42 Xliff_ Can I just say that Python SUCKS!
11:42 Xliff_ Really. I am trying to get something working that used to work and I am running into so many silly issues.
11:42 Xliff_ Of course, I am a Python n00b, so that probably has something to do with it.
11:46 mst everything is terrible
11:49 MasterDuke Xliff_: i just created a bunch of issues in SVG::Plot
11:51 Xliff_ Thanks, MD
11:51 Xliff_ mst: You have no idea.
11:51 Xliff_ PyQt5.... srsly?!?
11:52 Xliff_ Pain. In. The. Ass.
11:52 mst for i in "foo", "bar":
11:52 mst remove "bar" from the list and try not to break your code
11:52 Xliff_ mst: indenting....
11:53 mst Xliff_: nope
11:53 mst for i in "foo",:
11:53 Xliff_ ┌∩┐(ಠ_ಠ)┌∩┐
11:53 mst will go once round the loop with i set to "foo"
11:53 mst for i in "foo":
11:53 mst will iterate three times with i as "f", "o", "o"
11:53 mst MANDATORY TRAILING COMMAS
11:53 Xliff_ 「(゚ペ)
11:54 Xliff_ Dude... when I pull out the emoticons...
11:54 Xliff_ RUN!
11:54 Xliff_ (why is my glass empty again... and is that daylight?!?)
11:55 * Xliff_ is a vampire. The sun is out. Color him with "Why am I on fire White"
11:56 mcmillhj joined #perl6
12:01 timotimo i liked pyqt, but that was when 4 was ... not out yet?
12:04 iH2O joined #perl6
12:10 Ven joined #perl6
12:13 Xliff_ Thing takes longer to compile than the Linux kernel!
12:13 MasterDuke i liked PerlQT, but i think that was back in the QT3 days
12:14 * mst likes http://p3rl.org/Tkx.pm
12:14 mst er
12:14 * mst likes http://p3rl.org/Tkx
12:15 Xliff_ Then again... I think this is a uniproc Make
12:16 Xliff_ s/Make/Makefile/
12:16 Xliff_ It's been a long time since I've run into one of those.
12:17 * Xliff_ breaks and runs "make -j8" instead.
12:17 Xliff_ Ahh... much better.
12:17 iH2O left #perl6
12:21 Xliff_ And after all that, I still get a type error. *sigh*
12:21 Xliff_ So much for continuing my work on calibre.
12:23 mcmillhj joined #perl6
12:26 Xliff_ Well... committed my changes. I will have to circle back another time.
12:27 committable6 joined #perl6
12:31 pierre_ joined #perl6
12:31 El_Che joined #perl6
12:35 leont joined #perl6
12:56 * dogbert17 experimentally drops pin ...
12:59 dogbert17 looks as if the second code example is missing a few @'s https://docs.perl6.org/lan​guage/control#gather/take
13:00 mcmillhj joined #perl6
13:04 dalek doc: 288dcdb | (Jan-Olof Hendig)++ | doc/Language/control.pod6:
13:04 dalek doc: Fixed broken code example
13:04 dalek doc: review: https://github.com/perl6/doc/commit/288dcdb75b
13:06 Xliff_ MasterDuke: SVG::Plots now support background color. See examples/bubbles.pl in the latest commit.
13:06 Xliff_ s/Plots/Plot/
13:07 timotimo my fan is now unbearably meepy
13:07 timotimo but at least i have a laptop again
13:08 timotimo however
13:08 timotimo now both pads rather than just the one are connected to the heatsink apparatus with thermal paste
13:09 nine I wonder if the best way to have a Perl program with a Qt UI would actually be to build the Qt UI in Qt Designer (or maybe KDE Develop) and have it access the Perl functionality via a network socket and a lot of JSON
13:11 mcmillhj joined #perl6
13:17 kurahaupo joined #perl6
13:22 timotimo holy fuck, i can watch a stream on twitch and instead of 79 degC on both measurement points i get just 55 degC
13:25 tbrowder ref modules: Can anyone point to a complete description of the META json format for a module source dir? I particularly need to see  how to handle binary dependencies that require downloading, building, and installing. I see how it's done in the travis file, but I assume neither zef nor panda use that.
13:27 timotimo tbrowder: GTK::Simple has something. you'd find it in the Build.pm
13:27 timotimo Build.pm is where you put code that you want to run at module installation time
13:28 mst surely external non-perl6 deps are out of scope for that
13:28 mst I mean for META
13:28 timotimo at the moment, yes
13:28 timotimo we might want to at some point be able to declare we want something
13:28 timotimo though it'll not be possible to have it actually be picked up by any package managers
13:28 timotimo that way lies cthulhu's resurrection
13:29 mst perl5 has barely started experimenting with that via CPAN::Plugin::Sysdeps
13:29 timotimo resurrection may be the wrong word. i don't think cthulhu is actually dead?
13:29 mst only sleeping
13:29 mst I would say "yes, in theory, it would be nice to do that, but I would be extremely suspicious of anybody who claims they have a solution to the problem"
13:29 timotimo yeah
13:29 timotimo sounds about right
13:29 mst (actually, I think I *do* have a solution to the problem, but I'm very suspicious of myself there ;)
13:29 timotimo we could build our own package manager and repositories for libraries!
13:30 timotimo fork portage and just re-write it in perl6
13:30 timotimo a line-by-line port from python
13:30 timotimo from python and bash*
13:30 lambd0x guys a quite doubt: junctions evals. expressions eagerly while the 'and, &&' operators do it in a lazy way?
13:31 timotimo and, &&, ... are what you call "short-circuiting"
13:31 timotimo they'll actually have a control-flow implication to them
13:31 mcmillhj joined #perl6
13:32 timotimo the junction operators aren't special in any way, so they don't get to do short-circuiting
13:32 lambd0x ok.
13:32 timotimo but when collapsing a junction to a single bool value (via "so"/"not" or "if"/"unless" and friends) it won't go through more values than it needs to
13:34 lambd0x I'm asking because I have two exprs to be avaluated as true and one of them is an array index that if goes to -1 shall return false. It works with '&&, and' but fail with 'all' so that's the reason?
13:34 tbrowder timotimo: thanks!
13:34 timotimo that's the reason, yes
13:35 lambd0x timotimo: Would there be another way to perform this comparison in a shorter way?
13:36 Deep_Thought joined #perl6
13:39 jameslenz joined #perl6
13:39 timotimo m: my @a; say @a[-1] // False
13:39 camelia rakudo-moar d43ea0: OUTPUT«5===SORRY!5=== Error while compiling <tmp>␤Unsupported use of a negative -1 subscript to index from the end; in Perl 6 please use a function such as *-1␤at <tmp>:1␤------> 3my @a; say @a[-1]7⏏5 // False␤»
13:39 timotimo m: my @a; (try say @a[-1]) // False
13:39 camelia rakudo-moar d43ea0: OUTPUT«5===SORRY!5=== Error while compiling <tmp>␤Unsupported use of a negative -1 subscript to index from the end; in Perl 6 please use a function such as *-1␤at <tmp>:1␤------> 3my @a; (try say @a[-1]7⏏5) // False␤»
13:40 timotimo ah, compile-time error, of course
13:40 timotimo m: my $index = -1; my @a; (try say @a[$index]) // False
13:40 camelia rakudo-moar d43ea0: ( no output )
13:40 timotimo m: my $index = -1; my @a; say @a[$index] // False
13:40 camelia rakudo-moar d43ea0: OUTPUT«False␤»
13:40 timotimo m: my $index = -1; my @a; say (@a[$index] // False)
13:40 camelia rakudo-moar d43ea0: OUTPUT«False␤»
13:40 timotimo that's how i'd do it
13:43 Xliff_ "//" ??
13:44 dalek doc: b72a2b3 | (Jan-Olof Hendig)++ | doc/Language/control.pod6:
13:44 dalek doc: day-of-week returns values in the range 1..7, not 0..6
13:44 dalek doc: review: https://github.com/perl6/doc/commit/b72a2b3617
13:44 lambd0x timotimo: thanks you
13:44 Xliff_ Is that something similar to perl5 "a || b"?
13:44 tadzik it's similar to perl5's "a // b" :)
13:44 Xliff_ OK. So what is "//"/
13:45 Xliff_ Er.... s/\/$/?/
13:45 tadzik if a is defined, it evals to a, otherwise to b
13:45 Xliff_ Ah. I always thought "||" did that.
13:45 tadzik it's close but not the same
13:45 Xliff_ "||" is boolean and "//" is defined?
13:45 tadzik correct
13:46 Xliff_ kk
13:46 tadzik kinda :)
13:46 Xliff_ (dammit)
13:46 tadzik evalbot where art thou
13:46 Xliff_ Ok. So "correct enough for government work?"
13:46 tadzik haha
13:46 Xliff_ :)
13:46 tadzik well, it doesn't mean "defined" :)
13:47 Xliff_ (my glass is empty again...)
13:47 tadzik ||: $a ? $a : $b
13:47 tadzik //: defined $a ? $a : $b
13:47 tadzik my $a = 0; my $b = 5; say $a || $b => 5
13:47 Xliff_ Wouldn't that be "//: $a.defined ?? $a !! $b" 8-)
13:48 tadzik in perl6, yes
13:48 tadzik :)
13:48 Xliff_ hehe
13:48 tadzik consider default parameters to subs
13:48 tadzik if you did $arg ||= 5, you'd overwrite the passed argument if it's 0
13:48 Xliff_ Seriously, I may never go back to the default trinary again.
13:48 tadzik so //= 5 is a better fit
13:48 Xliff_ It took me so long to switch, though.
13:49 Xliff_ I dread going back to Java or... (shudder) ... C++
13:49 tadzik hehe
13:49 tadzik I like going back to C
13:49 Xliff_ Feh.
13:49 tadzik it feels like taking your shirt of and chopping wood with your bare hands
13:49 masak Xliff_: in my experience, going back is rough the first few times
13:49 tadzik C++ is similar, except you mutilate yourself first and then cover your face with the blood of infants
13:49 Xliff_ It's not that I can't do it. It's that I'd rather not!
13:49 masak Xliff_: going back and *forth* is even rougher
13:50 Xliff_ masak++
13:50 masak Xliff_: I can't tell you how many times I've written things like `a ? b ! c` or `a ?? b :: c`
13:50 Xliff_ Your head becomes a racketball court.
13:50 Xliff_ LOL!
13:50 masak Xliff_: ...but the good news is, it passes. at least it did for me.
13:50 masak brain learns to compartmentalize, and choose the right one in the right environment.
13:51 Xliff_ Yeah. That's assuming you play enough games of racketball. The "walls" get callouses.
13:51 Xliff_ OK. You said it better than I did.
13:51 masak gosh darnit, now I'm *staring* at `a ? b ! c` and my brain is going "but that's correct... isn't it?"
13:51 tadzik :D
13:51 Xliff_ Hahaha!
13:52 Xliff_ Sheesh. On a related topic, you know how long it took me to grok the difference between "x" and "xx"?
13:52 masak Xliff_: even more important is to grok why it has to be two ops in Perl 6.
13:52 Xliff_ That's what I mean.
13:53 Xliff_ Was about a week and it was like a switch flipping.
13:53 tadzik I never remember which one's which, x and xx, always have to try :P
13:53 Xliff_ O I C goes brain
13:53 tadzik does anyone have a good mnemonic?
13:53 Xliff_ x == Str, xx == Array
13:53 masak tadzik: oh? I have no problem at all distinguishing them. I wonder why.
13:53 Xliff_ Or if you really wanna be pedantic...
13:54 Xliff_ x ~~ Str, xx ~~ Array
13:54 cygx .oO( number of 'x' == number of 'r' in typename)
13:54 masak cygx++
13:54 masak tadzik: there's your mnemonic
13:54 tailgate I guess I remember that xx looks more like an array than x
13:54 tadzik masak : well, I know what they mean, I just don't remember which one's for what
13:54 * masak .oO( Listrr )
13:54 tadzik oh
13:54 dalek doc: 8f50e70 | (Armand Halbert)++ | doc/Type/Range.pod6:
13:54 dalek doc: Added method sum() to Range pod
13:54 dalek doc: review: https://github.com/perl6/doc/commit/8f50e70834
13:54 dalek doc: 5270805 | RabidGravy++ | doc/Type/Range.pod6:
13:54 dalek doc: Merge pull request #863 from ahalbert/861
13:54 dalek doc:
13:54 dalek doc: Added method sum() to Range pod
13:54 Xliff_ cygx++ # Wow! That really works. Took me a bit.
13:54 dalek doc: review: https://github.com/perl6/doc/commit/52708054e3
13:54 tadzik if there's more than one x, then it's a collection
13:55 tadzik ahahah
13:55 Xliff_ I like mine better though.
13:55 tadzik it took me even longer
13:55 tailgate then again, nobody's ever accused perl of having too few operators
13:55 nadim_ joined #perl6
13:56 Xliff_ Oh yeah!!
13:56 Xliff_ Someone mentioned something about QT
13:57 masak tadzik: though logically, `xx` ought to be a Bool-based operator, considering all the prior art with && || ^^ ?? !!
13:57 Xliff_ <nine> I wonder if the best way to have a Perl program with a Qt UI would actually be to build the Qt UI in Qt Designer (or maybe KDE Develop) and have it access the Perl functionality via a network socket and a lot of JSON
13:57 masak :P
13:57 Ven joined #perl6
13:57 Xliff_ nine: How would that even work?
13:57 cygx masak: but then, x should return a junction
13:58 Xliff_ Wouldn't it be better to write NativeCall bindings and write a pyuic equivalent in P6?
13:59 mst doubtful
13:59 mst neither rakudo nor qt have pluggable event loops AFAIK
13:59 Xliff_ nine: I admit that there is a possibility that your idea would be workable in an order of magnitude faster than what I am suggesting.
13:59 mst so separate processes strikes me as likely to be less annoying
13:59 mst otherwise they'll fight over e.g. signal handling
13:59 Xliff_ eep!
14:00 mst it's not hard to imagine how much fun that wouldn't be :)
14:00 nadim joined #perl6
14:00 Xliff_ I was hoping libqt would handle that and all we'd need is binding.
14:00 Xliff_ So much for that hope.
14:00 mst eh?
14:00 tadzik masak: that'd fit, yeah
14:00 mst point is, rakduo has a (UV) event loop, qt has its own event loop
14:01 mst everything gets complicated at that point
14:01 Xliff_ mst: and QT's event loop isn't exposed by the QT API?
14:01 tadzik masak: also, two-letter operators are for Strings: eq, ne, lt, gt... xx?
14:01 Xliff_ tadzik: stop trying to confuse the issue!!!
14:01 holyghost joined #perl6
14:01 tadzik xxxD
14:01 Xliff_ ROFLMAO
14:02 tadzik did you notice the joke, I put xxx there to get more confusion on board
14:02 Xliff_ That's what the added "MAO" was for.
14:03 tadzik much appreciated
14:03 Xliff_ ====)
14:03 tadzik xxD is when you need to get more than one person laughing, while xD is just one person laughing longer
14:04 Xliff_ And this is a fist bump.... (๑˃̵ᴗ˂̵)و
14:04 mcmillhj joined #perl6
14:04 mst Xliff_: that's not my point
14:04 tadzik ooh, that's going into ~/fatfaces, I didn't have that
14:05 mst Xliff_: my point is that a two-process model would allow you to use all of rakudo's native event stuff for the perl6 code
14:05 Xliff_ (tadzik++)++
14:05 Xliff_ mst: Oooooo... and hence the not fun
14:06 Xliff_ mst: You must pardon me. The emoticons have come out, my glass is empty, I've been up all night, and I've had to deal with fecking Python.
14:06 tadzik ooh, sweet karma for memeing
14:06 Xliff_ mst: So "I'm punchy" is putting it mildly. Also slow on the uptake.
14:06 Xliff_ Did I mention slow?
14:08 masak on the uptake, yes.
14:08 Xliff_ o(^▽^)o
14:09 Xliff_ mcmillhj is having a rough time of it.
14:11 titsuki m: loop (my $foo;0;){}; loop (my $foo;0;){} # is this a bug ?
14:11 camelia rakudo-moar d43ea0: OUTPUT«Potential difficulties:␤    Redeclaration of symbol $foo␤    at <tmp>:1␤    ------> 3loop (my $foo;0;){}; loop (my $foo7⏏5;0;){} # is this a bug ?␤»
14:14 nine Xliff_: the trouble with Qt bindings has historically been that maintaining them actually seems to be quite a lot of work and onebody seemed to stick to it.
14:15 mcmillhj joined #perl6
14:19 Xliff_ nine: onebody?
14:31 lambd0x https://bpaste.net/show/6096c9c29b15 Is there a way to optimize this code, removing those two basic opers. atributed to two vars and directly doing it? I made some attempts but found no way so far...
14:32 mcmillhj joined #perl6
14:35 timotimo mixed tabs and spaces? :(
14:39 espadrine joined #perl6
14:39 lambd0x timotimo: Sorry the my code lost identation when pasting: http://bpaste.net/show/27109db27469
14:40 lambd0x *sorry ...
14:46 mniip joined #perl6
14:46 ChoHag joined #perl6
14:47 mcmillhj joined #perl6
14:48 nine Xliff_: also, since nowadays Qt UIs are usually written with Qt Quick (and it's Javascript language), there's already good infrastructure for separating front- and backend.
14:48 nine Xliff_: err...nobody of course :)
14:48 timotimo huh?
14:49 timotimo are you sure anybody except mobile devs use qt quick for uis?
14:50 nine All of KDE?
14:50 timotimo what?
14:50 timotimo seriously?
14:50 timotimo that's certainly news to me
14:51 nine That was one of the huge changes with KDE SC 5. The move to Qt 5 and reimplementation of a lot of UIs in Qt Quick. Qt Quick 2 to be precise AFAIK
14:51 * Xliff_ boggles.
14:51 Xliff_ Well... Javascript. And rakudo is getting a javascript VM, right?
14:51 Xliff_ Not that will have much to do with it.
14:52 Xliff_ I think.
14:52 nine https://en.wikipedia.org/wiki/KDE_Plasma_5 "The graphical interface was fully migrated to QML, which uses OpenGL for hardware acceleration resulting in better performance and reduced power consumption."
14:57 leont QML for GUI seems to make sense, we do it at work (though I'm not near that part of the code)
14:57 timotimo wow
14:58 timotimo i didn't know you can make anything more complex than a big box of text and one or two buttons with QML
14:58 timotimo my brain just doesn't seem to work that way
14:58 timotimo i tried to build an app with qml once. it failed horribly
14:59 leont IME QML apps have a nasty habit of compiling fine when missing essential dependencies, and then giving cryptic error messages, but it's great for speed of development
14:59 nine QML is Qt catching up with the flexibility of XAML. Except that it's a lot less XML and more usable. Both are just a big step away from having a fixed list of widgets.
15:10 skids joined #perl6
15:15 * Xliff_ finally passes out....
15:25 moritz \o
15:37 Ven joined #perl6
15:39 setty1 joined #perl6
15:40 n1lp7r joined #perl6
15:54 pmurias joined #perl6
15:55 wamba joined #perl6
15:56 harmil Sometimes I just look up at the stars...
15:56 harmil m: say (1, 2, 3, * * * ** * ... *)[^5]
15:56 camelia rakudo-moar d43ea0: OUTPUT«(1 2 3 8 13122)␤»
15:56 pmurias timotimo: re extra deps being cthulu insane, why is just installing system packages (with confirmation from the user) so crazy?
15:56 pmurias s/extra/external/
15:58 leont It's hard to support in any portable manner
15:58 leont And it's not something and ordinary user can do, usually
16:00 timotimo pmurias, what is the package called?
16:02 BenGoldberg m: (1*2**3, 2*3**8, 3*8**13122).say;
16:02 camelia rakudo-moar d43ea0: OUTPUT«(8 13122 66670016560688825079491664910972522260588886272221​66005887173256462278906983053370146466725548450482​63293163433135351564196860100623595086240810785636​88266393865986948707966855328226595016090023126712​69415569151459443538320419362567186388828519037…»
16:05 vendethiel joined #perl6
16:05 khw joined #perl6
16:05 timotimo that eacalated quickly
16:18 lizmat joined #perl6
16:24 pmurias timotimo: the module authors can just provide the package name for the popular distros (like debian)
16:25 pmurias timotimo: often when installing stuff (and modules from cpan) I just look in the docs and install the debian packages they mention
16:25 harmil BenGoldberg: Yeah, there's a reason I only output the 4th element of that list :)
16:25 harmil er fifth
16:26 harmil Also note that the 7th element blows up Perl :)
16:26 harmil m: say (1, 2, 3, * * * ** * ... *)[^7]
16:26 camelia rakudo-moar d43ea0: OUTPUT«Numeric overflow␤  in whatevercode  at <tmp> line 1␤  in block <unit> at <tmp> line 1␤␤Actually thrown at:␤  in block <unit> at <tmp> line 1␤␤»
16:27 pmurias timotimo: or I'm installing a package with a somewhat related name and a -dev prefix without a particularly deep understanding about it
16:35 jonadab joined #perl6
16:37 pmurias timotimo: specifiying once for all platforms doesn't seems doable in a sane manner
16:41 timotimo quite.
16:50 dalek doc: e7c5a4a | (Jan-Olof Hendig)++ | doc/Language/control.pod6:
16:50 dalek doc: Fixed typos
16:50 dalek doc: review: https://github.com/perl6/doc/commit/e7c5a4a8dd
16:51 pmurias CPAN::Plugin::Sysdeps++ seems just have a mapping between modules and the required package in different system managers
16:56 salva joined #perl6
16:56 Purcell joined #perl6
17:11 ugexe i dont think a meta field for distro packages really fits the scope of rakudo though; rather some 3rd party module would just define their own format and you'd build-depends *that*
17:14 * stmuk_ wonders if zef could support prove6
17:14 M-Illandan where is zef from? It's the new panda?
17:15 ugexe stmuk_: it does https://github.com/ugexe/zef/blo​b/master/lib/Zef/Service/TAP.pm6 (havent tested in a few months though)
17:17 ugexe to enable you either edit the resources/config.json or do `--/prove --/default-tester` to disable the 2 testers that are tried first
17:17 stmuk_ ah!
17:18 Woodi ugexe: can I install modules via zef into eg. ~/perl6 dir ?
17:18 ugexe i've kept regular prove as the default for now because it was significantly faster. maybe not anymore
17:18 domidumont joined #perl6
17:18 ugexe Woodi: https://github.com/ugexe/zef#​custom-installation-locations
17:20 Woodi ugexe: thanx :)
17:20 ugexe Could use a config option to set the default still though
17:21 Woodi how I miss that ? I checked readme first...
17:23 domidumont joined #perl6
17:26 zacts joined #perl6
17:35 grondilu joined #perl6
17:37 labster joined #perl6
17:37 baest joined #perl6
17:38 espadrine joined #perl6
17:44 * grondilu is reading about Vulkan and considers adding its API to the most wanted modules list.
17:44 grondilu it seems to have a clean C API (and in surprisingly few different header files)
17:46 BenGoldberg m: sub hailstone-length(Int $n) is cached { $n == 1 ?? 1 !! $n +& 1 ?? 1+hailstone-length($n * 3 + 1) !! 1+hailstone-length($n div 2) }; say hailstone-length(27);
17:46 camelia rakudo-moar d43ea0: OUTPUT«5===SORRY!5=== Error while compiling <tmp>␤Use of the 'is cached' trait is experimental; please 'use experimental :cached'␤at <tmp>:1␤»
17:47 BenGoldberg m: use experimental :cached; sub hailstone-length(Int $n) is cached { $n == 1 ?? 1 !! $n +& 1 ?? 1+hailstone-length($n * 3 + 1) !! 1+hailstone-length($n div 2) }; say hailstone-length(27);
17:47 camelia rakudo-moar d43ea0: OUTPUT«112␤»
17:49 smls joined #perl6
17:49 zacts hi #perl6
17:50 dalek perl6-most-wanted: 48c04d0 | grondilu++ | most-wanted/bindings.md:
17:50 dalek perl6-most-wanted: update bindings.md
17:50 dalek perl6-most-wanted:
17:50 dalek perl6-most-wanted: add [Vulkan](https://en.wikipedia.org/wiki/Vulkan_%20API%21)
17:50 dalek perl6-most-wanted:
17:50 dalek perl6-most-wanted: Not sure it's really "most wanted", but it seems cool and from what I read OpenGL is doomed to disappear anyway, so we'll need something else for 3D graphics.
17:50 dalek perl6-most-wanted: review: https://github.com/perl6/perl6​-most-wanted/commit/48c04d0a49
17:50 El_Che zacts: hi
17:50 zacts does perl6 let you redefine the language kind of like lisp does?
17:50 leont Yes, except it has syntax
17:51 grondilu it's not quite completely operational now though.
17:51 grondilu but it's a major goal of the language.
17:52 zacts ah ok cool
17:52 zacts so what is making this difficult currently?
17:53 leont Having syntax :-p
17:53 geekosaur mostly that what's currently there needs to be rethought because it's not flexible enough as yet, I think
17:53 nine pmurias: rather than package names, I'd try depending on libraries, as package managers often have options to search for packages by library name.
17:55 grondilu btw will eventually be able to define and use slangs without having to use NQP code?
17:55 grondilu s/will /& we/
17:55 grondilu because the examples I've seen so far are quite cumbersome.
18:00 geekosaur eventually, yes. as I said, design still needs to be worked out; the current one never got finished (hence nqp goop) because it was realized it couldn't do everything they wanted
18:01 rindolf joined #perl6
18:01 dalek perl6-most-wanted: 7f475c7 | grondilu++ | most-wanted/bindings.md:
18:01 dalek perl6-most-wanted: Update bindings.md
18:01 dalek perl6-most-wanted:
18:01 dalek perl6-most-wanted: fix URI encoding
18:01 dalek perl6-most-wanted: review: https://github.com/perl6/perl6​-most-wanted/commit/7f475c709a
18:18 El_Che Interesting read with Perl 6 content: https://salva.github.io/YAPC-Europe-2016/
18:18 El_Che mst and lizmat are the heros again :)
18:19 El_Che "Perl 6 is mostly Lisp with a (funny) syntax!!!"
18:20 grondilu I've read the same thing about javascript, IIRC
18:28 * leont made that point years ago: http://blogs.perl.org/users/leon_timmerm​ans/2010/04/why-perl-6-is-different.html
18:30 mohae joined #perl6
18:30 RabidGravy who do some paths in the docs have the literal '$COLON' in them for ':' ?
18:30 RabidGravy is that intentional or just something having the wrong sort of quotes somewhere?
18:31 RabidGravy e.g. "https://docs.perl6.org/type/X$CO​LON$COLONStr$COLON$COLONNumeric"
18:32 stmuk_ It's intentional .. although I don't really understand why the usual url encoding isn't used
18:33 RabidGravy very odd
18:34 webstrand joined #perl6
18:34 AlexDaniel “someone has to start …” haha
18:37 cyphase joined #perl6
18:42 RabidGravy is there a better way of constraining the length of the elements of an array than something like:
18:42 RabidGravy m: my @foo where { !$_.grep({ $_.chars > 3}).elems }; @foo = <aaaa b c>;
18:42 camelia rakudo-moar d43ea0: OUTPUT«Type check failed in assignment to @foo; expected <anon> but got Str ("aaaa")␤  in block <unit> at <tmp> line 1␤␤»
18:43 ugexe m: my @foo[3]; @foo = <1 2 3 4>
18:43 camelia rakudo-moar d43ea0: OUTPUT«Index 3 for dimension 1 out of range (must be 0..2)␤  in block <unit> at <tmp> line 1␤␤»
18:44 ugexe m: my @foo[3]; @foo = <1 2 3>
18:44 camelia rakudo-moar d43ea0: ( no output )
18:44 ugexe oh of the elements, doh
18:44 RabidGravy yeah :)
18:44 smls m: my @foo where .all.chars > 3;   @foo = <aaaa b c>;
18:44 camelia rakudo-moar d43ea0: OUTPUT«Type check failed in assignment to @foo; expected <anon> but got Str ("b")␤  in block <unit> at <tmp> line 1␤␤»
18:45 domidumont joined #perl6
18:46 chris2 joined #perl6
18:47 zacts joined #perl6
18:48 atweiden joined #perl6
18:48 jameslenz joined #perl6
18:48 RabidGravy ah yes, that is at least nicer looking cheers
18:51 smls m: subset ShortStr of Str where .chars <= 3;   my ShortStr @foo;   @foo = <aaa bbbb>;
18:51 camelia rakudo-moar d43ea0: OUTPUT«Type check failed in assignment to @foo; expected ShortStr but got Str ("bbbb")␤  in block <unit> at <tmp> line 1␤␤»
18:53 smls RabidGravy: This one ^^ even produces a nicer error message
18:55 ufobat joined #perl6
19:00 atweiden i made a concise DSL grammar example, one that involves `include` directives such as those found in Haml templates
19:00 atweiden i'm trying to understand why the include directive AST isn't bubbling up in Actions
19:00 atweiden in this file: https://bitbucket.org/atweiden/recursive-i​nclude-parsing-example/src/10783d6b78ecf67​7c6b635bfadd738d8f834ac79/inclusive.pl?at=​default&amp;fileviewer=file-view-default
19:00 atweiden i am passing the AST up from `method include`, to `include-line`, to `segment:include-line`
19:00 atweiden but it stops bubbling up for some reason
19:03 stmuk_ http://blogs.perl.org/users/steve_mynott/2016/0​8/you-wouldnt-believe-what-i-saw-at-yapceu.html
19:04 smls atweiden: I think `Inclusive.parsefile` is setting $/ in the current scope to its own Match object, and then `make` operates on that.
19:05 smls atweiden: Instead of using `method include($/ is copy)`, try e.g. `method include($m)` and then do `$m.make:` instaed of `make`.
19:05 arnsholt Yeah, that's a classic action class surprise
19:07 atweiden smls: ty, wow i was spending so much time on this yesterday
19:08 atweiden didn't know you could do $m.make:
19:11 pecastro joined #perl6
19:13 grondilu joined #perl6
19:15 nadim joined #perl6
19:24 firstdayonthejob joined #perl6
19:26 RabidGravy smls, it's on my todo to find a way to let subsets to define the error messages
19:30 allanofkingston joined #perl6
19:36 canopus joined #perl6
19:36 ggoebel joined #perl6
19:40 AndyBotwin joined #perl6
19:43 cognominal joined #perl6
19:47 gfldex joined #perl6
19:55 dogbert11 joined #perl6
20:13 bioduds joined #perl6
20:17 MasterDuke joined #perl6
20:41 mvorg joined #perl6
20:43 luxio joined #perl6
20:46 moritz m: subset Foo of Int where { fail "not quite" }; my Foo $x = 42;
20:46 camelia rakudo-moar d43ea0: OUTPUT«not quite␤  in any  at /home/camelia/rakudo-m-inst-1/share​/perl6/runtime/CORE.setting.moarvm line 1␤  in block <unit> at <tmp> line 1␤␤»
20:46 moritz RabidGravy: ^^ see above
20:46 dalek whateverable: f649e15 | MasterDuke17++ | / (3 files):
20:46 dalek whateverable: Move commit shortening into a shared function (only implemented in Benchable and Committable for now)
20:46 dalek whateverable: review: https://github.com/perl6/wha​teverable/commit/f649e15b8f
20:47 cxreg joined #perl6
20:50 luxio left #perl6
20:55 pecastro joined #perl6
21:02 tbrowder I need help with the Build.pm.  I think I need my own script unless there's a way not to use the Build classes make.
21:03 dalek whateverable: c401d58 | MasterDuke17++ | Benchable.p6:
21:03 dalek whateverable: Set the background of the graph to white to make it more legible, Xliff++
21:03 dalek whateverable: review: https://github.com/perl6/wha​teverable/commit/c401d58344
21:15 ugexe so write a build class that runs your own script
21:16 ugexe class Build { method build($dir) { run '...', :cwd($dir); } };
21:22 TEttinger joined #perl6
21:24 pmurias joined #perl6
21:32 Rawriful joined #perl6
21:39 pyrimidine joined #perl6
21:53 heatsink joined #perl6
21:55 pecastro joined #perl6
22:06 ugexe m: my $module-support = BEGIN (try require ::("Test")) !~~ Nil; INIT { if $module-support { require ::("Test"); }; }; say ?$module-support ?? ::("Test").perl !! "Failed to load"; # Programmatic requires not only works, but it works in phasers
22:06 camelia rakudo-moar d43ea0: OUTPUT«Test␤»
22:15 dalek whateverable: 1919837 | MasterDuke17++ | Benchable.p6:
22:15 dalek whateverable: Don't know how this happened, but revert breaking change
22:15 dalek whateverable: review: https://github.com/perl6/wha​teverable/commit/1919837474
22:19 labster joined #perl6
22:24 BillSussman joined #perl6
22:27 cpage_ joined #perl6
22:28 lucs joined #perl6
22:28 notbenh joined #perl6
22:28 jdv79 joined #perl6
22:28 a3r0 joined #perl6
22:28 Hor|zon joined #perl6
22:29 bpmedley joined #perl6
22:29 decent joined #perl6
22:29 mindos joined #perl6
22:30 pnu_ joined #perl6
22:30 zostay joined #perl6
22:32 adrusi joined #perl6
22:36 Xliff_zzzzz ugexe++ # Mod support in phasers
22:39 aindilis joined #perl6
22:40 bjz joined #perl6
22:40 Khisanth joined #perl6
22:41 tailgate joined #perl6
22:41 charsbar_____ joined #perl6
22:41 b2gills joined #perl6
22:54 grondilu can I not declare a stub sub in a role and define it in a class implementing that role?
22:54 grondilu m: role Talker { sub talk {...} }; class :: does Talker { sub talk { say "hi" } }.talk
22:54 camelia rakudo-moar d43ea0: OUTPUT«Method 'talk' not found for invocant of class '<anon|57780256>'␤  in block <unit> at <tmp> line 1␤␤»
22:54 grondilu m: role Talker { sub talk {...}; method talk { talk } }; class :: does Talker { sub talk { say "hi" } }.talk
22:55 camelia rakudo-moar d43ea0: OUTPUT«Stub code executed␤  in sub talk at <tmp> line 1␤  in method talk at <tmp> line 1␤  in block <unit> at <tmp> line 1␤␤Actually thrown at:␤  in block <unit> at <tmp> line 1␤␤»
22:55 grondilu ^like that?
22:58 grondilu m: use NativeCall; sub fork is native {*}; fork; say "hi"
22:58 camelia rakudo-moar d43ea0: OUTPUT«hi␤hi␤»
22:59 jnthn grondilu: No, since subs are orthogonal to OO; the MOP doesn't have any idea about them.
22:59 pRiVi_ joined #perl6
23:00 jnthn So they're not really part of the role
23:00 jnthn They just happen to be in the lexical scope that is the role's body
23:08 robinsmidsrod joined #perl6
23:09 Lucas_One joined #perl6
23:09 SmokeMachine____ joined #perl6
23:09 notbenh_ joined #perl6
23:09 AngeloMichael joined #perl6
23:09 grondilu the thing is, I was reading https://docs.perl6.org/language/​nativecall#Basic_use_of_Pointers (the part about objects and handles) and I was wondering how to factorize it for various classes using different native functions.
23:10 grondilu so now I'm considering something like role Foo[Sub &native_func] is native('CPointer') {...}
23:11 grondilu and then something like class Bar does Foo(sub () is native(&lib) is symbol('make_a_bar') {*}) {...}
23:12 BuildTheRobots joined #perl6
23:12 kipd joined #perl6
23:15 mithaldu_ joined #perl6
23:16 olinkl joined #perl6
23:17 antiTORTURE joined #perl6
23:18 heatsink left #perl6
23:19 grondilu m: use NativeCall; say .WHAT given sub () is native() is symbol('fork') {*}
23:19 camelia rakudo-moar d43ea0: OUTPUT«(Sub+{}+{})␤»
23:19 grondilu so it seems I can use a sub declaration as an object, even if it's a native binding
23:20 grondilu so maybe I can get away with using a parametric role indeed.
23:29 grondilu 'fork' is a neat example of a function to use here for showcasing NativeCall here with camelia.  Anyone knows others?
23:29 b2gills m: #`(I finally have a use for the ring operator) say {([Ro] %(<+ - * />Z=>*+1,*-1,* *2,*div 2){.comb})(0)}('++**--/') # https://codegolf.stackexchange.com/a/91483/1147
23:29 camelia rakudo-moar d43ea0: OUTPUT«3␤»
23:30 grondilu nice.  If we had an obfuscation context, you might win :)
23:31 mniip joined #perl6
23:31 grondilu though to be fair it's actually fairly readable.
23:31 grondilu it is a nice golf anyway
23:32 grondilu m:  say {([Ro]
23:32 camelia rakudo-moar d43ea0: OUTPUT«5===SORRY!5=== Error while compiling <tmp>␤Unable to parse expression in parenthesized expression; couldn't find final ')' ␤at <tmp>:1␤------> 3say {([Ro]7⏏5<EOL>␤    expecting any of:␤        statement end␤        statement modifier…»
23:34 grondilu m: say ([Ro] %(<+ - * />Z=>*+1,*-1,* *2,*div 2)<+ + * * - - />)(0)
23:34 camelia rakudo-moar d43ea0: OUTPUT«3␤»
23:36 jnthn It may be possible to save a char by using the Unicode multiplication operator instead of * *2
23:37 jnthn (thus removing the space)
23:40 araujo joined #perl6
23:40 jnthn sleep &
23:43 mtj_ joined #perl6
23:44 _slade_ joined #perl6
23:48 b2gills On that site it is usually scored by bytes not chars, × is two bytes in utf8 so it would be the same number of bytes. Though it would make it clearer
23:51 grondilu if I have a repr('CPointer') can I still mix it with a role?
23:51 grondilu m: use NativeCall; role Foo {}; class Bar is repr('CPointer') does Foo {}
23:51 camelia rakudo-moar d43ea0: ( no output )
23:54 grondilu m: use NativeCall; role Foo { method foo { say "foo!" } }; class Bar is repr('CPointer') does Foo {}; Bar.foo
23:54 camelia rakudo-moar d43ea0: OUTPUT«foo!␤»
23:55 grondilu seems to work.
23:55 tomboy65 joined #perl6
23:55 grondilu It surprises me, considering I can't mix roles to Blobs.  Why Blobs would be harder to mixin than CPointers is beyond me.
23:58 grondilu m: use NativeCall; role Foo[Sub &native] { has &.native }; role Bar is repr('CPointer') {}; class :: does Bar does Foo(sub fork is native {*}) {}
23:58 camelia rakudo-moar d43ea0: OUTPUT«5===SORRY!5=== Error while compiling <tmp>␤Unable to parse expression in typename; couldn't find final ')' ␤at <tmp>:1␤------> 3ointer') {}; class :: does Bar does Foo(7⏏5sub fork is native {*}) {}␤»
23:59 grondilu m: use NativeCall; role Foo[Sub &native] { has &.native }; role Bar is repr('CPointer') {}; class :: does Bar does Foo(sub fork() is native {*}) {}
23:59 camelia rakudo-moar d43ea0: OUTPUT«5===SORRY!5=== Error while compiling <tmp>␤Unable to parse expression in typename; couldn't find final ')' ␤at <tmp>:1␤------> 3ointer') {}; class :: does Bar does Foo(7⏏5sub fork() is native {*}) {}␤»

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

Perl 6 | Reference Documentation | Rakudo