Perl 6 - the future is here, just unevenly distributed

IRC log for #perl6, 2016-04-12

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:02 michel_mno_afk joined #perl6
00:02 TEttinger joined #perl6
00:04 ZoffixWin How do I go about declaring my own traits?
00:04 ZoffixWin m: multi sub trait_mod:<is> (:$meow!) { say "Meowing!" }; sub foo is meow  {}; foo
00:04 camelia rakudo-moar 40a953: OUTPUT«5===SORRY!5=== Error while compiling /tmp/F8JFJWUdOq␤Can't use unknown trait 'is meow' in a sub declaration.␤at /tmp/F8JFJWUdOq:1␤    expecting any of:␤        rw raw hidden-from-backtrace hidden-from-USAGE␤        pure default DEPRECATED inl…»
00:04 ZoffixWin m: say &trait_mod:<is>.candidates
00:04 camelia rakudo-moar 40a953: OUTPUT«(sub trait_mod:<is> (Mu:U $child, Mu:U $parent) { #`(Sub|70629728) ... } sub trait_mod:<is> (Mu:U $child, :$DEPRECATED!) { #`(Sub|70636872) ... } sub trait_mod:<is> (Mu:U $type, :$rw!) { #`(Sub|70637024) ... } sub trait_mod:<is> (Mu:U $type, :$nativesize!)…»
00:05 ZoffixWin I guess I can poke the insides of Attribute::Lazy
00:06 timotimo you have to take a positional argument
00:07 sortiz m: multi sub trait_mod:<is> (Routine $r, :$meow!) { say "Meowing!" }; sub foo is meow {};
00:07 camelia rakudo-moar 40a953: OUTPUT«Meowing!␤»
00:07 ZoffixWin Ah, I see. sortiz++
00:08 sortiz And, as you see, the trait is applied at compile time of your sub.
00:13 ZoffixWin m: multi sub trait_mod:<is> (Variable:D $v, :$meow!) { say "$v is Meowing!" }; my Int $v is meow = 42;
00:13 camelia rakudo-moar 40a953: OUTPUT«Variable<140161728937224> is Meowing!␤»
00:13 ZoffixWin Perl6++
00:15 ZoffixWin m: multi sub trait_mod:<is> (Variable:D $v, :$meow!) { INIT say "$v is Meowing!" }; my Int $v is meow = 42;
00:15 camelia rakudo-moar 40a953: OUTPUT«Cannot call method 'Stringy' on a null object␤  in code  at /tmp/7lZOMQ0tGc line 1␤  in block <unit> at /tmp/7lZOMQ0tGc line 1␤␤»
00:16 ZoffixWin I guess I should read the speculations on the subject.
00:18 molaf joined #perl6
00:21 sortiz m: multi sub trait_mod:<is> (Variable $v, :$meow!) { say "{$v.VAR.name} is Meowing!" }; my Int $v is meow = 42; # Problem was INIT, at that time $v is null.
00:21 camelia rakudo-moar 40a953: OUTPUT«$v is Meowing!␤»
00:24 ZoffixWin But there's no way to obtain the assigned value "42" inside the trait?
00:24 timotimo no, it runs at a different time, sadly
00:24 sortiz Nop.
00:25 ZoffixWin Thanks.... Just gathering facts.
00:25 Actualeyes joined #perl6
00:29 sortiz Well, I suppose the trait can construct a Proxy over the var that get called at STORE time…
01:00 lizmat joined #perl6
01:01 stmuk_ joined #perl6
01:06 Sqirrel joined #perl6
01:16 TEttinger joined #perl6
01:20 dalek DBIish: 5ee8038 | (Salvador Ortiz)++ | t/03-lib-util.t:
01:20 dalek DBIish: NativeLibs: Missing libraries are OK
01:20 dalek DBIish: review: https://github.com/perl6/DBIish/commit/5ee8038283
01:21 stmuk joined #perl6
01:26 stmuk_ joined #perl6
01:32 BenGoldberg joined #perl6
01:34 Actualeyes joined #perl6
01:36 AlexDaniel joined #perl6
01:37 stmuk joined #perl6
01:38 dalek DBIish: 3de997e | (Salvador Ortiz)++ | / (2 files):
01:38 dalek DBIish: For panda's users, now v0.5.6
01:38 dalek DBIish: review: https://github.com/perl6/DBIish/commit/3de997e2d2
01:39 molaf joined #perl6
01:40 astj m: subset MaybeInt of Any where { !.defined || .WHAT ~~ Int }; my MaybeInt $a = 3;
01:40 camelia rakudo-moar 40a953: ( no output )
01:40 astj m: subset MaybeInt of Any where { !.defined || .WHAT ~~ Int }; my MaybeInt $a = "a";
01:40 camelia rakudo-moar 40a953: OUTPUT«Type check failed in assignment to $a; expected MaybeInt but got Str ("a")␤  in block <unit> at /tmp/j7E8uKQGvI line 1␤␤»
01:41 BenGoldberg joined #perl6
01:44 astj Is there any good way to define a typed but nullable property for some class? Currently I define `MaybeInt` as above..
01:46 AlexDaniel m: spurt ‘test’, ‘hello world’;
01:46 camelia rakudo-moar 40a953: OUTPUT«spurt is disallowed in restricted setting␤  in sub restricted at src/RESTRICTED.setting line 1␤  in sub spurt at src/RESTRICTED.setting line 17␤  in block <unit> at /tmp/0VT303p0JN line 1␤␤»
01:46 AlexDaniel we should probably run these snippets in a VM or something
01:46 ugexe m: "test".IO.spurt("hello world")
01:46 camelia rakudo-moar 40a953: ( no output )
01:46 AlexDaniel ? O_o
01:46 ZoffixWin astj, "a" is defined and not an Int
01:46 ugexe the secret to installing modules on camelia
01:46 AlexDaniel m: "test".IO.spurt("hello world"); say "test".IO.slurp
01:46 camelia rakudo-moar 40a953: OUTPUT«hello world␤»
01:47 ZoffixWin m: subset MaybeInt of Any where { !.defined || .WHAT ~~ Int }; my MaybeInt $a = Nil; say $a
01:47 camelia rakudo-moar 40a953: OUTPUT«(MaybeInt)␤»
01:47 ZoffixWin m: subset MaybeInt of Any where { !.defined || .WHAT ~~ Int }; my MaybeInt $a = 42; say $a
01:47 camelia rakudo-moar 40a953: OUTPUT«42␤»
01:47 AlexDaniel … why have the whole restricted setting then…
01:48 geekosaur wa gona say, isn't Int already the wanted MaybeInt?
01:48 ugexe just got overlooked i would imagine
01:48 geekosaur *was gonna
01:48 geekosaur and the one that isn;t "nullable" is Int:D
01:48 ZoffixWin m: use NativeCall; sub system(Str) is native {}; say system 'cal'
01:48 camelia rakudo-moar 40a953: OUTPUT«(Mu)␤»
01:48 ZoffixWin m: use NativeCall; sub system(Str) is native {}; say system 'ls'
01:48 camelia rakudo-moar 40a953: OUTPUT«#␤BenGoldBerg␤Perlito␤abc.txt␤asdf␤asdfasdfasfd␤dalek-queue␤evalbot␤evalbot.log␤foo␤lib␤log␤mbox␤niecza␤nqp-js␤p1␤p2␤p6eval-token␤perl5␤rakudo-inst␤rakudo-inst-1␤rakudo-inst-2␤rakudo-j-1␤rakudo-j-2␤rakudo-j-i…»
01:48 AlexDaniel ugexe: I still don't understand what restricted setting is trying to achieve
01:49 ugexe well it makes you type more characters, so you have less room to send a malicious command!
01:49 awwaiid hah
01:49 ZoffixWin :)
01:50 AlexDaniel .oO( does not find it funny that we have a feature that *pretends* to improve security )
01:51 AlexDaniel oops, that was supposed to be /me ↑
01:51 ugexe i dont think anyone is pretending its really doing that
01:51 astj ZoffixWin , geekosaur: Hmm.. thanks. I was misunderstanding my problem.
01:51 AlexDaniel ugexe: then why we have it?
01:52 ugexe its at least a place to start? now someone can easily fix these things instead of implementing everything
01:53 * sortiz have ready a patch to make NC unloadable under RESTRICTED.settings  ;-)
01:54 jamesnek1 joined #perl6
01:59 BenGoldberg m: "BenGoldberg".slurp.say
01:59 camelia rakudo-moar 40a953: OUTPUT«Method 'slurp' not found for invocant of class 'Str'␤  in block <unit> at /tmp/y7IVpxObuV line 1␤␤»
01:59 BenGoldberg m: "BenGoldberg".IO.slurp.say
01:59 camelia rakudo-moar 40a953: OUTPUT«Failed to open file /home/camelia/BenGoldberg: no such file or directory␤  in any  at /home/camelia/rakudo-m-inst-2/share/perl6/runtime/CORE.setting.moarvm line 1␤  in block <unit> at /tmp/S8k66JuRgY line 1␤␤Actually thrown at:␤  in any  at gen/m…»
01:59 AlexDaniel somehow I feel like instead of fixing endless holes in restricted setting it would be much better to get rid of it completely, so that people will have no broken-by-design option among other much better options. That is, I think that restricted setting will never make something more secure, so there's no reason to even have it.
01:59 BenGoldberg m: use NativeCall; sub system(Str) is native {}; say system 'ls B*'
01:59 camelia rakudo-moar 40a953: OUTPUT«BenGoldBerg␤(Mu)␤»
02:00 ugexe can be said of most security
02:01 Ben_Goldberg joined #perl6
02:08 MasterDuke joined #perl6
02:10 stmuk_ joined #perl6
02:13 sunnavy joined #perl6
02:13 go|dfish joined #perl6
02:14 noganex_ joined #perl6
02:15 MasterDuke Is there something obvious I'm missing that would cause '@array[0, 3, 7]' to be much slower than '(@array[0], @array[3], @array[7])'? With Rakudo version 2016.03 built on MoarVM version 2016.03
02:16 cpage_ joined #perl6
02:17 stmuk joined #perl6
02:21 kurahaupo joined #perl6
02:21 stmuk_ joined #perl6
02:25 khisanth_ joined #perl6
02:27 dg joined #perl6
02:28 tailgate joined #perl6
02:29 tailgate hey, is there a way to filter a hash in perl6 i.e. pass it a function and a hash, and keep only the key-values that the function returns true for.
02:34 ugexe grep
02:39 AlexDaniel ‪‫‬‭I wonder how many irc clients handle this correctly. ‪‫‬‭‮҉:)
02:44 noganex joined #perl6
02:44 cdg joined #perl6
02:46 sortiz stmuk_, I'm seeing your report about DBIish failing yesterday, what was the problem?
02:48 sortiz stmuk_, travis-ci logs do not reveal anything.
02:49 lucs tailgate: An example ->
02:49 lucs m: my %h = (a=>1, b=>2, c=>3, d=>4, e=>5); say %h.kv.grep(-> $k, $v { $v %% 2 });
02:49 camelia rakudo-moar 40a953: OUTPUT«((d 4) (b 2))␤»
02:50 MasterDuke tailgate: another example
02:50 MasterDuke m: my %h := {a => 1, b => 2, c => 3};my %g = %h.grep({.key ~~ "a"});say %g.perl
02:50 camelia rakudo-moar 40a953: OUTPUT«{:a(1)}␤»
02:56 AlexDaniel m: my %h = (‘a’..‘e’ Z=> ^∞); %h .= grep: *.key eq ‘a’|‘c’; say %h
02:56 camelia rakudo-moar 40a953: OUTPUT«{a => 0, c => 2}␤»
02:58 AlexDaniel tailgate: ↑ this is probably the closest one syntactically
02:58 AlexDaniel hmmm there's one more way
03:00 AlexDaniel m: my %h = (‘a’..‘e’ Z=> ^∞); %h{.key}:delete if .value !%% 2 for %h; say %h
03:00 camelia rakudo-moar 40a953: OUTPUT«{a => 0, c => 2, e => 4}␤»
03:01 lucs MasterDuke, AlexDaniel: Thanks for the more idiomatic versions, pretty neat.
03:04 dalek ecosystem: b458be7 | MasterDuke17++ | META.list:
03:04 dalek ecosystem: Add List::Combinations
03:04 dalek ecosystem: review: https://github.com/perl6/ecosystem/commit/b458be7861
03:04 dalek ecosystem: 6798f3e | (David Warring)++ | META.list:
03:04 dalek ecosystem: Merge pull request #194 from MasterDuke17/patch-1
03:04 dalek ecosystem:
03:04 dalek ecosystem: Add List::Combinations
03:04 dalek ecosystem: review: https://github.com/perl6/ecosystem/commit/6798f3e254
03:04 AlexDaniel sure enough you can write a function if you're doing that frequently
03:04 AlexDaniel m: sub filter-hash(%h, &fun) { %h{.key}:delete if &fun($_) for %h }; my %hash = (‘a’..‘e’ Z=> ^∞); filter-hash(%hash, {.value %% 2}); say %hash
03:04 camelia rakudo-moar 40a953: OUTPUT«{b => 1, d => 3}␤»
03:05 AlexDaniel hm, it is probably possible to add this function to Hash itself, isn't it?
03:07 AlexDaniel m: use MONKEY-TYPING; augment class Hash { method filter(&fun) { self{.key}:delete if &fun($_) for self } }; my %hash = (‘a’..‘e’ Z=> ^∞); %hash.filter{.value %% 2}; say %hash
03:07 camelia rakudo-moar 40a953: OUTPUT«Too few positionals passed; expected 2 arguments but got 1␤  in method filter at /tmp/hya3FfnW0a line 1␤  in block <unit> at /tmp/hya3FfnW0a line 1␤␤»
03:07 AlexDaniel hmm
03:09 MasterDuke m: use MONKEY-TYPING; augment class Hash { method filter(&fun) { self{.key}:delete if &fun($_) for self } }; my %hash = (‘a’..‘e’ Z=> ^∞); %hash.filter({.value %% 2}); say %hash
03:09 camelia rakudo-moar 40a953: OUTPUT«{b => 1, d => 3}␤»
03:09 AlexDaniel m: use MONKEY-TYPING; augment class Hash { method filter(&fun) { self{.key}:delete if &fun($_) for self } }; my %hash = (‘a’..‘e’ Z=> ^∞); %hash.filter: *.value %% 2; say %hash
03:09 camelia rakudo-moar 40a953: OUTPUT«{b => 1, d => 3}␤»
03:09 AlexDaniel yeah
03:10 AlexDaniel lucs: ↑ that's even more neat in my opinion
03:10 AlexDaniel lucs: but a little bit scary, yeah :)
03:10 AlexDaniel .u ➕
03:10 yoleaux U+2795 HEAVY PLUS SIGN [So] (➕)
03:11 lucs AlexDaniel: Yep, I'm noting all this down :)
03:15 jack_rabbit joined #perl6
03:17 tailgate MasterDuke: thanks
03:46 * BenGoldberg wonders how much a heavy plus sign weighs.
03:47 BenGoldberg m: my %h; say $h.grep:*;
03:47 camelia rakudo-moar 40a953: OUTPUT«5===SORRY!5=== Error while compiling /tmp/4PQROuv1FA␤Variable '$h' is not declared. Did you mean '%h'?␤at /tmp/4PQROuv1FA:1␤------> 3my %h; say 7⏏5$h.grep:*;␤»
03:47 BenGoldberg m: my %h; say %h.grep:*;
03:47 camelia rakudo-moar 40a953: OUTPUT«5===SORRY!5=== Error while compiling /tmp/HAhLk6PL8B␤Confused␤at /tmp/HAhLk6PL8B:1␤------> 3my %h; say %h.grep:7⏏5*;␤    expecting any of:␤        colon pair␤»
03:48 BenGoldberg m: my %h; say %h.grep: { True };
03:48 camelia rakudo-moar 40a953: OUTPUT«()␤»
03:48 AlexDaniel m: my %h; say %h.grep: *
03:48 camelia rakudo-moar 40a953: OUTPUT«()␤»
03:49 AlexDaniel yea, it's a bit sad that you always have to write space after : in this case.
03:49 AlexDaniel but I'm pretty sure that there is a reason
03:51 BenGoldberg m: my %h; say %h.grep( :foo(bar) );
03:51 camelia rakudo-moar 40a953: OUTPUT«5===SORRY!5=== Error while compiling /tmp/4tGppwq9mR␤Undeclared routine:␤    bar used at line 1. Did you mean 'VAR', 'bag'?␤␤»
03:51 BenGoldberg m: my %h; say %h.grep( :foo('bar') );
03:51 camelia rakudo-moar 40a953: OUTPUT«Cannot call grep(Hash: Str); none of these signatures match:␤    ($: Bool:D $t, *%_)␤    ($: Mu $t, *%_)␤  in block <unit> at /tmp/RDJ4zRn6_u line 1␤»
03:53 AlexDaniel m: my %h = <foo bar>; say %h.grep( (:foo(‘bar’)) )
03:53 camelia rakudo-moar 40a953: OUTPUT«(foo => bar)␤»
03:54 AlexDaniel .tell BenGoldberg it is parsed as a positional argument
03:54 yoleaux AlexDaniel: I'll pass your message to BenGoldberg.
04:21 Cabanossi joined #perl6
04:23 djbkd joined #perl6
04:32 nige1 joined #perl6
04:37 avalenn joined #perl6
04:52 skids joined #perl6
05:30 teatime heh, I thought .nude on Rat was named so because it shows you the naked values inside
05:30 teatime now I learn about .nu (numerator) and .de (denominator)
05:30 teatime but yet, I suspect my previous belief represents an intentional mnemonic :)
05:34 vendethiel joined #perl6
05:34 CIAvash joined #perl6
05:36 hjst joined #perl6
05:42 Xliff teatime++ # nu de
05:43 firstdayonthejob joined #perl6
05:44 teatime I still don't fully comprehend why Duration 'does Real' instead of 'does Rational[___, ___]'.
05:44 teatime but I'm much less certain it's 'wrong'
05:45 teatime I also just spent quite a few minutes trying to figure out how Rat's 'does Rational[Int, Int]' could be correct given the design docs, only to finally notice the comment one line above, "# XXX: should be Rational[Int, UInt64]"
05:48 djbkd joined #perl6
05:51 teatime it seems like Duration could even 'is Rat', but that could suck for future additions/changes, and/or make me people feel icky?  not sure.
05:53 tharkun joined #perl6
05:57 firstdayonthejob joined #perl6
06:08 moritz teatime: iirc it was a conscious decision to make Duration has-a Rat rather than is-a rat
06:09 teatime moritz: kk.  for my education, what would be likely rationale(s) for that decision?
06:09 teatime also, even though rakudo src/core/Rat.pm defines Rat as Rational[Int, Int], Rat in perl6 is *not* arbitrary precision like FatRat... I wonder what/where I'm missing
06:09 sjoshi joined #perl6
06:21 wamba joined #perl6
06:23 darutoko joined #perl6
06:30 _mg_ joined #perl6
06:35 _nadim joined #perl6
06:37 perturbation joined #perl6
06:40 nakiro joined #perl6
06:47 rindolf joined #perl6
06:49 jjido joined #perl6
06:51 domidumont joined #perl6
06:51 fireartist joined #perl6
06:52 moritz teatime: a duration isn't simply a number, it's a time span
06:52 moritz it can be represented as a number only if you assume a certain unit
06:53 moritz so you have to be careful not to lose that (implied) unit by implicitly converting to any number type
06:53 teatime moritz: well, except, rakudo and design docs both implement/define it as a Rat, with units seconds
06:54 teatime I think the typical (non-perl) technical definition of 'duration' actually includes the specific start Instant and end Instant, and the word for 'an amount of time in e.g. seconds' is something different
06:54 teatime but too late to consider that, heh
06:55 jjido joined #perl6
06:55 teatime moritz: Duration is supposed to 'happily become a Rat in numeric context' also; does 'is Cool does Real' achieve that without unexpectedly having it become a Num (and thus losing precision?)
06:55 domidumont joined #perl6
06:56 teatime I feel like I just need to figure out how to define what to return in 'numeric context'
06:57 moritz teatime: for specific types (like Rat) it's simply a method of the same name
06:57 moritz teatime: and for "just give me any number type", it's method Bridge
06:57 teatime moritz: right, and Duration.Rat does the right thing already
06:57 teatime aha
06:57 geekosaur joined #perl6
07:01 ggoebel19 joined #perl6
07:03 teatime moritz: have you got a moment
07:04 teatime I could explain my issue concisely, and you could probably help me understand.
07:04 teatime (I'm working on a trivial patch that fixes a reported/accepted bug, but I want to also line out what seem to be a couple of related issues at the same time / make sure this does everythign it's suppsoed to)
07:06 teatime and perhaps the answer is as simple as:  Duration is currently doing  "method Rat(Duration:D:) { $!tai }  method Bridge(Duration:D:) { $!tai.Num }"  and perhaps should be changed to  "… method Bridge(Duration:D:) { $!tai }"
07:08 teatime this is the behavior I object to:
07:08 teatime m: my ($a, $b) = 1, 1e10; say (Duration.new($a) / Duration.new($b)).Rat.nude, (Rat($a) / Rat($b)).Rat.nude
07:08 camelia rakudo-moar 40a953: OUTPUT«(0 1)(1 10000000000)␤»
07:09 teatime this *particular* case is not really an issue, because I will be defining * and / explicitly for the Duration type
07:09 teatime but I want to fix the *general* case of Duration losing precision in numeric operations where it shouldn't
07:09 teatime </explanation>
07:14 teatime (I told myself I wasn't going to bring this up again, until I had some code and a good thorough write-up w/ citations; maybe I should just go make that, and then submit it as a PR or RT issue)
07:18 masak morning, #perl6
07:19 masak if implementations always have flaws and always are (as it were) imperfect renditions of some perfect platonic form... on what grounds does it even make sense to talk about technical debt?
07:20 zakharyas joined #perl6
07:20 teatime heh is that related to my inquire, or just a general musing?
07:20 masak general musing
07:20 masak though not a rhetorical question :)
07:21 azawawi joined #perl6
07:21 wamba joined #perl6
07:21 azawawi good morning
07:22 teatime I will go make my code / write-up.
07:22 azawawi m: use File::Which;
07:22 camelia rakudo-moar 40a953: OUTPUT«===SORRY!===␤Could not find File::Which in:␤    /home/camelia/.perl6␤    /home/camelia/rakudo-m-inst-2/share/perl6/site␤    /home/camelia/rakudo-m-inst-2/share/perl6/vendor␤    /home/camelia/rakudo-m-inst-2/share/perl6␤    CompUnit::Repository:…»
07:23 wamba joined #perl6
07:23 azawawi any reason why we cant have line number error information for the 'use NotFoundModule;' ?
07:23 masak azawawi: no reason. feel free to submit a rakudobug on that.
07:23 wamba joined #perl6
07:23 masak (we might well have one already, but in that case we'll just merge 'em)
07:24 stmuk_ /last star
07:24 stmuk_ oops :)
07:26 * masak notices that the p6u from Ivaylo Ilianov about Proc::Async has gone unanswered for 8 days...
07:27 masak p6u email*
07:32 abraxxa joined #perl6
07:34 azawawi masak: https://rt.perl.org/Public/Bug/Display.html?id=127883 # Thanks :)
07:35 masak no, thank *you* :)
07:36 rindolf joined #perl6
07:44 masak tadzik: it always comes as a surprise to me that the $path in `get $path => &cb` in Bailador is a string but is interpreted as a regex. I wonder if that could be designed in some less jarring/safer way...
07:51 cognominal joined #perl6
07:58 dakkar joined #perl6
08:00 astj_ joined #perl6
08:22 Actualeyes joined #perl6
08:25 RabidGravy joined #perl6
08:31 g4 joined #perl6
08:35 RabidGravy boom
08:39 AlexDaniel masak: ufobat took over Bailador. So you'd better tell that to him :)
08:40 moritz .oO( the ufo took over ... )
08:43 masak AlexDaniel: ah! thanks for letting me know
08:43 masak ufobat: ohai, kthx
08:44 masak ufobat: I might even be willing to sit down and draw up some alternatives. maybe look at how other Danceroids do this.
08:45 RabidGravy kidnapped by aliens
08:46 masak RabidGravy: I suppose you've read the ufo README at some point?
08:46 RabidGravy yeah, ages ago I guess
08:46 RabidGravy :)
08:47 * masak wonders if he should deprecate ufo somehow, now that we live in the age of .precomp folders
08:49 michel_mno joined #perl6
08:50 moritz masak: fwiw Mojolicious uses named placeholders for routes, so things like /concert/:id
08:51 moritz masak: the background is that they want to be able to reverse it, that is, generate the URL from placeholder values and the route spec
08:51 RabidGravy Hmm maybe before I finally finish Sofa I should fix the HTTP::UserAgent failing very rudely if the remote end closes the connection without return a status line
08:52 psch m: enum Foo <A B C>; constant D = Foo::C; say D.perl
08:53 camelia rakudo-moar 40a953: ( no output )
08:53 masak moritz: I thought Bailador did the same? not sure.
08:53 masak psch: I think camelia has a slight flu.
08:53 psch yeah, still :/
08:53 psch well, not like i even tried to look what's up there
08:55 moritz masak: but then it's not a regex, is it?
08:58 masak moritz: it's a preprocessed string that's EVAL'd as a regex
08:58 masak moritz: my surprise consists in that I expect a bunch of characters (such as '.' and '-') to have their literal meaning in the URL, and they don't
08:59 RabidGravy there is something in the ecosystem that uses a more rfc6570 form for picking the bits out of a URI for servery things
08:59 psch well, having C♯/D♭ be synonymous would be nice, but not with an enum...
08:59 psch .u ♭
08:59 yoleaux U+266D MUSIC FLAT SIGN [So] (♭)
08:59 psch does that even work in the first place..?
09:00 psch i might want to learn unicode categories eventually... :)
09:00 masak psch: what are you talking about? C♯ and D♭ are not synonymous :P
09:00 psch masak: not completely, no, i know
09:01 psch masak: but they are numerically identical in midi
09:01 moritz they just translate to the same frequency
09:01 psch well, and that
09:01 masak one tastes like strawberries, the other smells like fresh linen
09:01 arnsholt They're only synonymous in well-tempered tunings though =)
09:01 masak they're only iden... what arnsholt++ said
09:01 DrForr There's C## as well, no?
09:01 masak aye
09:02 arnsholt Double sharp is just up a full step instead of a half step, though
09:02 psch that's C𝄪
09:02 moritz C#, now extra sharp!
09:03 psch anyway, the more interesting thing i was wondering about is whether a mode should now the next chords with a given interval from root to root or if a chord itself should also know that, with an optional mode
09:03 * masak .oO( Gilette C♯, now with five blades! )
09:03 psch like, the former can't do tritone substitutions, but what does that latter actually mean for e.g. a major chord?
09:03 ggoebel19 joined #perl6
09:04 nine Ok, so what _is_ the difference between C♯ and D♭?
09:04 psch nine: one appears in sharp scales, the other in flat scales
09:04 ocbtec joined #perl6
09:04 masak nine: depending on how you tune your instrument, they might be different frequencies.
09:04 masak nine: pianos (nowadays) are often well-tempered, which means they're the same.
09:04 masak nine: but on a violin or a trombone, they're probably not.
09:04 nine Ok, since I only play an electronic piano, it doesn't affect me :)
09:05 psch except e-pianos, which are usually stretch tuned
09:05 [particle] joined #perl6
09:05 masak "stretch tuned"?
09:05 psch https://en.wikipedia.org/wiki/Stretched_tuning
09:05 psch well, old ones apparently only
09:06 ryand joined #perl6
09:06 psch basically a solution to a material science problem, afaiu
09:07 arnsholt Yeah, basically sounded like a solution to a physical effects problem
09:09 M-tadzik joined #perl6
09:11 psch relevant for this kind of e-piano: http://www.shadetreekeys.com/775368/StretchTuning/DSCN0547.JPG
09:11 psch i only know about it because i tried to tune one similar to that one
09:11 psch it didn't really work out
09:14 masak nine: I've been talking to more than one violin player, and they tend to go "pfff... of course those tones sound different!"
09:15 masak nine: on many instruments, instead of well-tempering, the goal is to make a perfect fifth have a 3/2 frequency ratio
09:16 psch well, violin player *could* make them sound the same
09:16 psch but yeah, the pure fifth discourages that
09:17 masak m: say my $perfect = 3/2; say my $well-tempered = 2 ** (7/12)
09:17 camelia rakudo-moar 40a953: OUTPUT«1.5␤1.49830707687668␤»
09:17 masak m: my $perfect = 3/2; my $well-tempered = 2 ** (7/12); say $perfect - $well-tempered
09:17 camelia rakudo-moar 40a953: OUTPUT«0.00169292312331848␤»
09:21 psch hm, or maybe tritone-substitution is best just a method on any (maj7) chord
09:21 psch but then i'd need to distinguish those from other chords as well... :/
09:22 azawawi joined #perl6
09:27 ggoebel110 joined #perl6
09:29 teatime If S02 and S32 disagree, which one is authoritative?  (or, I guess, roast is authoritative over both of these?)
09:30 moritz the latter
09:30 teatime S32?
09:31 psch no, roast
09:32 azawawi what's the best way (OOP-wise) to make separate OS-dependant implementations of Foo::Bar::XYZ to be used as Foo::Bar (transparently)?
09:32 vendethiel- joined #perl6
09:33 azawawi so you have Foo::Bar::Win32, Foo::Bar::Linux, ..etc and you need to access them as Foo::Bar
09:34 nine Have a Foo::Bar that contains a Foo::Bar::Whatever
09:34 psch azawawi: make Foo::Bar::Linux and Foo::Bar::Win32 roles and mix them into Foo::Bar during Foo::Bar BUILD?
09:34 nine And delegate from Foo::Bar to Foo::Bar::Whatever
09:35 azawawi thanks :)
09:36 teatime .perl is supposed to print something you could give back to perl6 and get an object == to the original, right?
09:37 masak teatime: depends how literally you mean `==`
09:37 masak teatime: `==` is numeric comparison
09:38 teatime so, is this a bug:
09:38 masak teatime: and regardless, you'll always get a *new* object
09:38 masak (and there are various other caveats)
09:38 teatime m: my $r = Rat.new(1,1000000000000000000000); say $r.nude; say $r.perl; say $r == $r.perl.EVAL
09:38 camelia rakudo-moar 40a953: OUTPUT«(1 1000000000000000000000)␤0.0000000000000000000010000000000000006661338147750939242541790008544921875␤False␤»
09:38 teatime or not, since that Rat doesn't fit in Int/UInt64... (above works w/ FatRat)
09:39 psch ...i dislike that Exception thrown inside a react { } point at the react :/
09:39 masak even the $r.perl output there looks suspect
09:44 teatime m: my $r = Rat.new(1,1000000000000000000000); say $r.WHAT; say $r.perl.EVAL.WHAT; say $r ~~ $r.perl.EVAL
09:44 camelia rakudo-moar 40a953: OUTPUT«(Rat)␤(Rat)␤False␤»
09:44 teatime I would have expected that second one to be Real, but apparently it does become a rat?
09:45 * teatime is so confused, le soupir
09:45 teatime one last question:  If S02 and S32 contradict, and roast is silent on the point, which of S02 or S32 is more likely to be 'correct'?
09:46 M-tadzik joined #perl6
09:46 masak Real is not a concrete type, it's a role. maybe you're thinking of Num
09:46 masak teatime: S02
09:46 teatime yes, Num, sorry.
09:53 teatime lol, I just can't win today; why does this happen:
09:53 teatime m: my @ab = <a b>; @ab».say; @ab».WHAT.say
09:53 camelia rakudo-moar 40a953: ( no output )
09:53 teatime m: my @ab = <a b>; @ab».say; @ab».WHAT.say
09:53 camelia rakudo-moar 40a953: ( no output )
09:53 teatime er
09:53 teatime pretend camelia replied "a␤b␤(Array)"
09:54 teatime nm; I guess you need ».WHAT».say ?  this runs forever on my rakudo, though.
09:56 psch .WHAT is kinda of special
09:56 psch s:1st/a//
09:56 M-matthew joined #perl6
09:56 M-Illandan joined #perl6
09:57 psch which among other things means it doesn't hyper well (or at all, actually, i think)
09:58 kid51 joined #perl6
09:58 teatime ok.
10:02 djbkd joined #perl6
10:07 espadrine joined #perl6
10:10 ggoebel111 joined #perl6
10:13 moritz m: my @ab = <a b>; @ab».say; @ab».^name.say
10:13 camelia rakudo-moar 40a953: OUTPUT«a␤b␤Array␤»
10:13 moritz hm.
10:14 psch m: my @ab = <a b>; say @a.perl
10:14 camelia rakudo-moar 40a953: OUTPUT«5===SORRY!5=== Error while compiling /tmp/fCv1cU06N2␤Variable '@a' is not declared␤at /tmp/fCv1cU06N2:1␤------> 3my @ab = <a b>; say 7⏏5@a.perl␤»
10:14 psch m: my @ab = <a b>; say @ab.perl
10:14 camelia rakudo-moar 40a953: OUTPUT«["a", "b"]␤»
10:14 ggoebel112 joined #perl6
10:15 ZoffixWin .WHAT hypers, it just doesn't .say
10:15 ZoffixWin m: 5.WHAT.say
10:15 camelia rakudo-moar 40a953: OUTPUT«(Int)␤»
10:15 psch m: my @ab = <a b>; @ab».say; @ab».^name.elems.say
10:15 camelia rakudo-moar 40a953: OUTPUT«a␤b␤1␤»
10:15 ZoffixWin Oh. Never mind me.
10:15 moritz m: my @ab = <a b>; @ab».say; say @ab.map: *.^name
10:15 camelia rakudo-moar 40a953: OUTPUT«a␤b␤(Str Str)␤»
10:15 psch well, something doesn't hyper there
10:16 psch m: my @ab = <a b>; @ab».say; say @ab».^name
10:16 camelia rakudo-moar 40a953: OUTPUT«a␤b␤Array␤»
10:16 psch ...and that is kind of weird
10:17 moritz m: my @ab = <a b>; say @b>>.git
10:17 camelia rakudo-moar 40a953: OUTPUT«5===SORRY!5=== Error while compiling /tmp/VdJN4hf9aB␤Variable '@b' is not declared␤at /tmp/VdJN4hf9aB:1␤------> 3my @ab = <a b>; say 7⏏5@b>>.git␤»
10:17 moritz m: my @ab = <a b>; say @ab>>.gist
10:17 camelia rakudo-moar 40a953: OUTPUT«[a b]␤»
10:17 moritz that's the nodal/not-nodal distinction
10:32 kaare_ joined #perl6
10:33 M-tadzik masak: in what situation has it bit you?
10:38 masak tadzik: `get '/jquery-3.0.0-beta1.js' => sub { return slurp("jquery-3.0.0-beta1.js"); }`
10:39 masak (I later changed that to just `get '/jquery.js'`, which felt less abstraction-leaky)
10:40 tadzik masak: ah, I see how that could be problematic
10:40 masak tadzik: and every time I use '.' in one of those URLs, I'm aware that it matches something slightly wider than I intend, for example '/jqueryZjs'
10:41 tadzik right
10:41 masak somehow I feel that the exact mix of regex and plain text string is pushed a little bit too far towards "regex" right now
10:42 tadzik I think it would be all fine as long as it's interpolated in the regex as a verbatim string, not a ... regex
10:42 masak right
10:42 masak that sounds like what I expect
10:43 masak this would be a "breaking API change", but I expect the fallout'd be small or zero
10:43 tadzik I don't imagine myself making any other behaviour intended, so this is apparently a 4-5 year old bug :)
10:44 masak I see the current implementation as a quick-and-dirty way to get mostly the right behavior :)
10:45 tadzik yeah :)
10:45 tadzik I guess I figured "if I do that I get the other feature for free"
10:48 nine Experience from Catalyst suggests that users rarely need real regex matching
10:51 cyberviking joined #perl6
10:53 cyberviking joined #perl6
10:53 dvinciguerra_ joined #perl6
10:54 vendethiel joined #perl6
10:54 ZoffixWin TBH, I'd expect to write exactly zero code for the jquery file above.
10:55 ZoffixWin It should be served from something like ./public/ automatically. Every app has some CSS/JS/Image files. Requiring the user to write their own routes for it is a bit of an overkill.
10:56 cognominal joined #perl6
10:56 pmurias joined #perl6
10:56 pmurias +1 for what ZoffixWin said
10:57 pmurias having to manually serve static files is both lame and annoying
10:57 masak I would approve of such a default.
10:58 masak every time something new is proposed for Bailador though, I wonder "is there prior art?"
10:58 masak prior art is a great way not to repeat some other Danceroid's mistakes, and to possibly even get a better solution than one bargained for
10:59 ZoffixWin Mojolicious does it the way I described.
10:59 tadzik masak: Dancer has exactly that as prior art
10:59 tadzik //public is served automatically
10:59 masak cool
10:59 masak ok, so we're basically at "PRs welcome", then ;)
11:00 ZoffixWin :)
11:04 kid511 joined #perl6
11:08 teatime where can I find .Bridge described
11:08 teatime I've looked in a bunch of places, no luck so far
11:08 teatime lol nm, just found it.
11:09 RabidGravy TAKE ME TO THE BRIDGE!
11:10 RabidGravy now to remember where I had left Sofa at
11:14 pmurias_ joined #perl6
11:20 _mg_ joined #perl6
11:22 psch hrm, i ran into a bad design decision i made previous /o\
11:23 psch without paying attention to the root there's no difference between the 1st inversion of a sus2 chord and the 2nd inversion of a sus4 chord
11:24 grondilu m: say @*INC
11:24 camelia rakudo-moar 40a953: OUTPUT«Dynamic variable @*INC not found␤  in block <unit> at /tmp/44VmqNSvYp line 1␤␤Actually thrown at:␤  in block <unit> at /tmp/44VmqNSvYp line 1␤␤»
11:24 DrForr Hrm., I brought my music theory books back with me from Amsterdam...
11:24 grondilu ^was @*INC renamed?
11:24 psch m: say %*INC
11:24 camelia rakudo-moar 40a953: OUTPUT«Dynamic variable %*INC not found␤  in block <unit> at /tmp/klrFzqNysn line 1␤␤Actually thrown at:␤  in block <unit> at /tmp/klrFzqNysn line 1␤␤»
11:24 nine grondilu: http://niner.name/talks/A%20look%20behind%20the%20curtains%20-%20module%20loading%20in%20Perl%206/Module%20loading%20in%20Perl%206.pdf page 19 and following
11:24 teatime does 'does Real does Rational[…]' make any sense
11:24 teatime I'm leaning toward no
11:25 nine grondilu: also docs/module_management.md in the rakudo repo
11:25 psch DrForr: does that mean you want a commit bit for https://github.com/peschwa/p6-Music-Helpers ? ;)
11:26 teatime and assuming no, it's OK for a 'does Real' to have .Bridge return a Rat ?
11:27 DrForr psch: Oh, sure, why not.
11:29 grondilu ok, that makes a few entries in S28 obsolete though.
11:29 psch DrForr: fair warning, it's not documented, and the tests are, well, an empty directory :l
11:30 * grondilu still uses the synopses as his first documentation resource.  Maybe he's wrong.
11:30 bakedb joined #perl6
11:31 grondilu m: say $*REPO, *.next-repo ... ~*
11:31 camelia rakudo-moar 40a953: OUTPUT«(inst#/home/camelia/.perl6)␤»
11:31 psch also i probably have at least one questionable decision in there and a few oversights
11:31 psch like the thing with sus2/sus4 just then
11:32 * grondilu would have just called 'next-repo' 'succ'.
11:32 psch and the plus side, it does kind of work and the example does actually produce interesting improvisations, albeit often not that smooth
11:32 psch s/and/on/
11:33 psch DrForr: 'tis done, feel free to hemm the feature creep in or whatever vOv
11:38 nine m: say $*REPO.repo-chain
11:38 camelia rakudo-moar 40a953: OUTPUT«(inst#/home/camelia/.perl6 inst#/home/camelia/rakudo-m-inst-2/share/perl6/site inst#/home/camelia/rakudo-m-inst-2/share/perl6/vendor inst#/home/camelia/rakudo-m-inst-2/share/perl6 CompUnit::Repository::AbsolutePath.new(next-repo => CompUnit::Repository::NQ…»
11:43 grondilu ^ oh ok I'll use that.
11:49 gregf_ joined #perl6
12:09 nine What for if I may ask?
12:13 grondilu I want to write C version of functions I use in one of my modules.  Trying to write a sub to give to the native trait.
12:15 grondilu ended up writing something like : sub path { first { .IO ~~ :f }, $*REPO.repo-chain >>~>> 'libmyfunc.so' }
12:15 grondilu and then sub myfunc is native(&path) {...}
12:17 grondilu next-repo and repo-chain are poor name choices IMHO.  I would have used succ and ZEN-POS
12:18 ptolemarch joined #perl6
12:20 sjoshi joined #perl6
12:21 brrt joined #perl6
12:22 nine What does ZEN-POS mean?
12:22 jnthn I think $comp-unit-repo++ is a bit *too* cute :P
12:23 nine grondilu: you can completely forget that approach and instead learn about %?RESOURCES. It is a much better solution for finding your lib :)
12:23 grondilu anything that implements the notion of a "successor" should implement succ imho
12:23 grondilu nine: ok I'll do
12:23 nine grondilu: see for example https://github.com/niner/Inline-Perl5/blob/master/lib/Inline/Perl5.pm6#L18
12:24 nine grondilu: is @array[1] the successor of @array[0]?
12:24 jnthn It feels rather unnatural to me to think of it as a successor, is all
12:25 eone joined #perl6
12:25 psch m: class A { method ZEN-POS { "foo" } }; say "{ A.new[] }"
12:25 camelia rakudo-moar 40a953: OUTPUT«foo␤»
12:25 grondilu it's dubious for @array[1] but if $*REPO implement a 'next-repo' method it's clear to me it should implement succ.
12:26 grondilu Linked lists have a natural 'succ' method.
12:26 masak jnthn: it's unnatural because it's not the only possible sequence. it's not "canonical".
12:26 moritz but it's more a fallback than a successor, no?
12:26 masak grondilu: it's far from clear to me.
12:26 nine I've always called them .prev and .next for linked lists
12:26 psch nine: ZEN-POS is for empty slices, to clear the example up
12:27 psch empty *positional* slices
12:27 psch ...i don't know if ZEN-ASSOC exists, though
12:27 masak grondilu: the next/prev and sequence view here are not at all inherent to the repos themselves. they're imposed from the outside.
12:27 nine psch: thanks!
12:27 grondilu ok, fine.
12:28 tokomer joined #perl6
12:28 grondilu nine: there is no occurence of RESOURCES in any synopses :/
12:29 grondilu m: say %?RESOURCES
12:29 camelia rakudo-moar 40a953: OUTPUT«Nil␤»
12:29 grondilu oh hang on, singular
12:29 grondilu m: say %?RESOURCE
12:29 camelia rakudo-moar 40a953: OUTPUT«5===SORRY!5=== Error while compiling /tmp/XahKlKzPcO␤Variable '%?RESOURCE' is not declared␤at /tmp/XahKlKzPcO:1␤------> 3say 7⏏5%?RESOURCE␤»
12:30 grondilu wth
12:31 masak grondilu: I've come across such situations before, where a particular next/prev makes sense only while in a certain "view"
12:31 masak grondilu: someone the other day had such a case for Rat
12:35 azawawi joined #perl6
12:35 azawawi hi
12:36 masak hi azawawi
12:36 azawawi how do i access the C level FILE* descriptor from Perl 6 API? e.g. to pass it to a native call function
12:36 teatime azawawi: I don't know that you can, you can only get a fd / file descriptor (int) afaik
12:37 timotimo http://doc.perl6.org/routine/native-descriptor
12:37 teatime although perhaps you can turn that into a FILE* with fdopen native lib func, not sure
12:37 teatime speculated this one day, MadcapJake or Xliff (can't remember) may have tested it.
12:38 jnthn Yeah, getting native-descriptor and obtaining a FILE * from that is the right way
12:38 jnthn Pretty sure it's been done before :)
12:38 jnthn Note that internally we don't actually have a C-level FILE* to give you :)
12:38 azawawi cool thanks :)
12:39 jnthn That's C's higher level API, rather than the OS-level handle.
12:39 azawawi https://github.com/azawawi/perl6-net-curl/blob/master/examples/TODO/rtsp.c # converting to perl6 to do RTSP video playback via Net::Curl :)
12:39 grondilu is it OK to have circular use of 'use'?  I mean for instance in A.pm6 'unit module A; use B;' and in B.pm6: 'unit module B; use A;'  ?
12:39 teatime grondilu: yes.
12:39 jnthn grondilu: No
12:39 teatime lol, dang I tried.
12:40 jnthn Because 1-pass parsing.
12:40 * psch .oO( maybe.  i don't know.  can you repeat the question? )
12:40 grondilu what the correct method then?
12:40 spanner_ joined #perl6
12:40 timotimo put both into the same module
12:41 timotimo well, into the same compunit
12:41 grondilu I really don't want to put them in the same file though
12:41 masak then you need to symmetry-break the order somehow
12:41 dalek doc: 3e69963 | (Zoffix Znet)++ | doc/Language/exceptions.pod:
12:41 dalek doc: Fix typo
12:41 dalek doc: review: https://github.com/perl6/doc/commit/3e6996349b
12:42 jast isolate things needed by both into a third unit
12:45 sufrostico joined #perl6
12:47 masak aye
12:47 masak or as the DDD book has it, "Shared Kernel" :)
12:48 timotimo what does the D&D book call it?
12:48 moritz Fireball!
12:49 DrForr . o ( I cast "Magic Missile." )
12:50 moritz https://www.fanfiction.net/s/8096183/1/Harry-Potter-and-the-Natural-20
12:50 timotimo i put on my robe and system designer's hat
12:51 moritz the story of a D&D character transported into Harry Potter universe
12:53 masak I tried reading that one twice now, and got distracted someways through.
12:53 masak it's actually quite decent, but I guess HPMoR has skewed my standards and made me picky.
12:53 molaf joined #perl6
12:54 moritz its amusing to me old RPG player
12:55 masak yes, to me too.
12:55 azawawi https://gist.github.com/azawawi/d3a333076f107849cc26bc0b0a8505b8 # so a p6 method is a sub in disguise?
12:57 moritz azawawi: no, a method can also act as a class method (unless you put a :D on the invocant type)
12:57 pmurias is something like /dev/fd/1000 possible on windows?
12:57 psch m: say Method.isa(Routine)
12:57 camelia rakudo-moar 40a953: OUTPUT«True␤»
12:57 psch scnr
12:57 psch m: say Method.isa(Sub)
12:57 camelia rakudo-moar 40a953: OUTPUT«False␤»
12:58 cdg joined #perl6
12:58 moritz the main difference between sub invocantions and method invocations is how they are looked up
12:58 moritz method call: method tables. Sub calls: lexical scopes
12:58 psch another, less important one, is the minimum amount of arguments
12:58 mr-foobar joined #perl6
12:58 psch even a class method needs 1 argument
12:59 psch +at least
12:59 moritz m: my $m = method() { say 42 }; $m()
12:59 camelia rakudo-moar 40a953: OUTPUT«5===SORRY!5===␤Word 'method' interpreted as 'method()' function call; please use whitespace around the parens␤at /tmp/uZT5n_i6HY:1␤------> 3my $m = method7⏏5() { say 42 }; $m()␤Unexpected block in infix position (two terms in a row)␤at …»
12:59 masak azawawi: right, what moritz++ said. it's a method even when you're doing `Foo.method`
12:59 moritz m: my $m = my method() { say 42 }; $m()
12:59 camelia rakudo-moar 40a953: OUTPUT«5===SORRY!5===␤Type 'method' is not declared. Did you mean 'Method'?␤at /tmp/fuTiJvEJ0i:1␤------> 3my $m = my method7⏏5() { say 42 }; $m()␤Malformed my␤at /tmp/fuTiJvEJ0i:1␤------> 3my $m = my7⏏5 method() { say 42 }; $m()␤␤»
12:59 moritz m: my $m = my method () { say 42 }; $m()
12:59 camelia rakudo-moar 40a953: OUTPUT«Too few positionals passed; expected 1 argument but got 0␤  in method <anon> at /tmp/rt0xWHxRns line 1␤  in block <unit> at /tmp/rt0xWHxRns line 1␤␤»
12:59 moritz ... which nicely illustrates psch++'s point
12:59 masak azawawi: a method could be seen as "a sub, but with an additional (implicit) first $self parameter"
13:00 masak azawawi: in Perl 6, you can make that parameter explicit by writing `method foo($self: $p1, $p2) {`
13:00 masak azawawi: in the case of calling it on the class, `$self` simply contains the type object instead
13:00 azawawi so Foo.zzz is a method on an uninitialized object, right?
13:00 masak on the type object Foo, yes
13:01 masak m: class C { method x { say self.defined ?? "instance" !! "type object" } }; C.new.x; C.x
13:01 camelia rakudo-moar 40a953: OUTPUT«instance␤type object␤»
13:02 masak m: class C { method x($self:D: ) { say self.defined ?? "instance" !! "type object" } }; C.new.x; C.x
13:02 camelia rakudo-moar 40a953: OUTPUT«5===SORRY!5=== Error while compiling /tmp/gjZ6198jCR␤Invalid typename 'D' in parameter declaration.␤at /tmp/gjZ6198jCR:1␤------> 3class C { method x($self:D7⏏5: ) { say self.defined ?? "instance" !! ␤»
13:02 sufrostico joined #perl6
13:02 * moritz doesn't really like the term "undefined" for type objects. They are rather well-defined.
13:02 masak m: class C { method x(C:D $self: ) { say self.defined ?? "instance" !! "type object" } }; C.new.x; C.x
13:02 camelia rakudo-moar 40a953: OUTPUT«instance␤Invocant requires an instance of type C, but a type object was passed.  Did you forget a .new?␤  in method x at /tmp/RkzS683Rep line 1␤  in block <unit> at /tmp/RkzS683Rep line 1␤␤»
13:03 masak moritz: it doesn't bother me at all, though I see what you mean
13:03 masak "undefined" is just one of these programming terms whose meaning has taken a life of its own
13:03 azawawi so basically it is a cool way of not using 'is export' and module(s) if you need a fully qualified name :)
13:03 psch azawawi: that's an interesting summary of OOP :)
13:03 azawawi moritz++, masak++
13:03 masak azawawi: no, basically it's just a method that you can call on the class itself ;)
13:04 azawawi Java's static :)
13:04 arnsholt I guess undefined is kind of like length. A bit overloaded
13:04 masak azawawi: by default Perl 6 doesn't have much of a distinction between "instance methods" and "static (class) methods"
13:04 masak but if you want, you can impose that distinction
13:05 masak or (even better), have the lack of distinction work to your advantage in your code
13:05 azawawi cool
13:05 ggoebel112 joined #perl6
13:06 masak if you think about it, this lack-of-distinction is the thing that makes .new methods tick
13:06 masak they're not special-cased in any way in Perl 6, like constructors are in many other OO settings
13:07 masak they just happen to work (and be called most often) on the type object
13:07 arnsholt Speaking of defined/undefined, I quite like the term jnthn++ uses in 6model: concrete
13:07 azawawi i think we need a PopularLanguageA-to-Perl6 cheatsheets
13:08 [particle] joined #perl6
13:08 timotimo someone started a ruby to perl6 guide on doc.perl6.org, but it was deemed "not the right thing to have on doc.perl6.org"
13:09 awwaiid timotimo: not quite
13:09 timotimo that's not it?
13:09 awwaiid timotimo: the current status is that I need to re-organize the table of contents to put it in a good spot
13:09 timotimo ah! that was you! :)
13:09 awwaiid I have just never circled back around
13:09 awwaiid yes -- PR is still there, really we just want a good home for it and right now the docs are too flat
13:10 awwaiid otherwise it is a great doc :)
13:10 perlpilot awwaiid: What's wrong with "ruby-to-perl6"?  Put it in a section called "Coming at Perl 6 from other languages" and you're good.
13:11 awwaiid perlpilot: nothing at all! that's exactly what I'm going to do
13:11 awwaiid https://raw.githubusercontent.com/perl6/doc/rb-nutshell/doc/Language/rb-nutshell.pod is the raw doc if anyone actually is asking for the content
13:11 perlpilot azawawi: I'd like to see what Haskell-to-Perl6 looks like.   They both have concepts that map well to each other, but not quite the same.
13:12 awwaiid definitely
13:12 moritz "forget everything you know. Now start reading the beginner's tutorial."
13:12 awwaiid the other day at a meetup we did a sample problem in Elixir and then translated it to Perl6 and it mapped very nicely (just a boring problem, no concurrency, but did have multi dispatch with guards)
13:13 perlpilot awwaiid: Is the code anywhere public?  (like Rosettacode?)
13:14 sue joined #perl6
13:14 azawawi awwaiid++
13:14 awwaiid https://gist.github.com/awwaiid/ca6a33b419ac8a03b0f753ddb46783c4 and https://gist.github.com/awwaiid/655f4dd4f7dd5bfa1719aae788a9cde9, though I need to get the elixir code
13:14 awwaiid azawawi++ # tab-complete-buddies
13:15 azawawi hehe
13:15 azawawi Maybe start a module like https://metacpan.org/pod/perlfaq?
13:15 * perlpilot mentally changes azawawi to awazawi to make that more true.
13:16 awwaiid I have DC-Baltimore Perl Workshop this weekend, but afterward I'll come back around to this and get these docs a nice spot and close out that PR
13:17 azawawi perlpilot: that's what happens when you have a popular and generic name in Arabic... you go by the family name :)
13:17 zakharyas joined #perl6
13:19 perlpilot azawawi: btw, http://doc.perl6.org/language/faq
13:19 pmurias masak: it's interesting that the "Harry Potter fanfic" part of HPMoR has detered all my outside-of #perl6 friends from even looking at it when I tell my friends about it
13:20 moritz pmurias: TBH I shied away from it for exactly that reason
13:20 azawawi perlpilot: thanks. I meant for the language-to-perl6 faq/cheatsheet guides
13:20 moritz pmurias: and only started reading it after getting several recommendations from different folks
13:21 * azawawi going home.... thanks
13:23 pmurias a lot of my enjoyment of it is from the weirdness of the Harry Potter universe mixing in with the weird AI/rationality religion of the author
13:23 teatime pmurias: /me /join's #bayesianconspiracy
13:23 teatime (not really, but..)
13:25 rindolf joined #perl6
13:28 masak pmurias: yes, same here
13:28 masak HPMoR is *inseparably* Eliezer
13:31 jast I read parts of it but the "in-your-face rationality" got old after a while
13:32 psch from an 11 year old, too
13:32 masak it's not possible to dispute those points without spoiling the end.
13:32 psch huh.  if there was anything that makes that make sense i forgot it
13:33 psch well, or i didn't actually read it until the end
13:33 psch now i'm really not sure anymore :/
13:33 pmurias the end is a bit disapointing with the AI cult propagand taking over a lot
13:33 jast I can kind of imagine that it goes to some kind of "whoops, your rationality sucked, you lose" climax, but I'm not going to spend the time to get there
13:33 * geekosaur tried to read HPMoR and bounced off it *hard*
13:33 jast I did last until chapter 90-something
13:33 masak pmurias: I found the end dissapointing mostly by virtue of being an end. not quite sure what you mean by "AI cult propagand[a]" in this case.
13:34 masak maybe you're thinking of the two documented cases where Eliezer got out of the box? :P
13:36 pmurias I view the HPMoR as a balance between the story and singularity bullshit
13:37 masak I dunno, author's clearly colored by his views -- but I felt the story presses less strongly on those points than (say) you're doing right now
13:37 pmurias in right proportions it's interesting to see what Elizer is trying to promote
13:39 psch oh, i remember why HPMoR!Harry is 11 years old and in-your-face rational
13:39 timotimo because of his parents?
13:39 jast because scientist
13:39 masak because spoilers
13:39 psch yeah
13:39 jast now I want to continue reading it even less
13:40 masak the story was a lot more about rationality than it was about the singularity and transhumanism, IMHO
13:40 psch i'd even argue morality comes before the singularity and transhumanism as well
13:40 psch but that's probably also because spoilers
13:40 masak also, it was in no small part about female witches and equal rights
13:41 tony-o are you talking about harry potter fanfic or something else..
13:41 scovit joined #perl6
13:42 * [Coke] gave it a shot when people were raving over it years ago, but didn't find it compelling.
13:42 stmuk_ "lesswrong"
13:42 eone left #perl6
13:43 masak tony-o: a particular (and unusual) one, called "Harry Potter and the Methods of Rationality"
13:43 jast I'd hesitate to call any one fanfic 'unusual', given the extreme variance
13:44 scovit Hello, I have question which I cannot find an answer in the docs: if I want to smartmatch against a hash key=>value, you can do like this: %hash ~~ :ciao("mamma")  # and it works
13:44 scovit m: my %g; %g<ciao> = "mamma"; say %g ~~ :ciao("mamma");
13:44 camelia rakudo-moar 40a953: OUTPUT«True␤»
13:44 scovit How do you do this in a grep call ?
13:44 scovit in practice: you have a supply which supply u hashes
13:45 stmuk_ I prefered Yudkowsky's blog posts to HPMoR
13:45 scovit how do you grep for the one which have :ciao("mamma") ?
13:45 tony-o m: my %g = ciao => "mama"; %g.grep({ $_ eqv :ciao("mama") }).so.say;
13:45 camelia rakudo-moar 40a953: OUTPUT«True␤»
13:45 timotimo you can grep( "ciao" => "mama"
13:45 tony-o if you want the key pair then drop the .so
13:45 timotimo )
13:45 tony-o m: my %g = ciao => "mama"; %g.grep({ $_ eqv :ciao("mama") }).perl.say;
13:45 camelia rakudo-moar 40a953: OUTPUT«(:ciao("mama"),).Seq␤»
13:45 timotimo it's important to quote the key, so that it doesn't just become a named argument to the grep method
13:46 teatime is "use warnings;" not a thing anymore?
13:46 perlpilot scovit: why are you using grep on a hash?
13:46 ZoffixW joined #perl6
13:46 ZoffixW What is X?
13:46 scovit perlpilot: an experiment
13:47 scovit timotimo thanks I try
13:47 ZoffixW m: class X {}; say X.new.perl; X::AdHoc.new.throw
13:47 camelia rakudo-moar 40a953: OUTPUT«X.new␤Could not find symbol '&AdHoc'␤  in block <unit> at /tmp/Cn7LTVFRna line 1␤␤Actually thrown at:␤  in block <unit> at /tmp/Cn7LTVFRna line 1␤␤»
13:47 ZoffixW m: X::AdHoc.new.throw
13:47 camelia rakudo-moar 40a953: OUTPUT«Unexplained error␤  in block <unit> at /tmp/5qZ_QC5CpS line 1␤␤»
13:47 ZoffixW I see defining X class breaks exceptions. What's the significance of X? I tried to find it in rakudo source, but failed.
13:47 scovit mmh, not working
13:47 perlpilot scovit: grep is for listy things, not hashy things, so you may have an impedence mismatch (or just do extra work that could be done more simply if you keep things in hash-land)
13:48 teatime ZoffixW: X is either the base class or actually I think just the name space where all exceptions live
13:48 scovit perlpilot it's a Supply
13:48 stmuk_ "Rationality: From AI to Zombies" looks interesting
13:48 teatime ZoffixW: or you probably knew that, and just looking for where it gets setup?
13:48 tony-o ZoffixW: https://github.com/rakudo/rakudo/blob/nom/src/core/Exception.pm#L117
13:48 geekosaur ZoffixW, I think that's a known bug
13:48 perlpilot scovit: your supply is generating Pairs or Hashes ?
13:48 ZoffixW tony-o, thanks.
13:48 geekosaur although currently treated as a DIHWIDT
13:48 psch ...i think it's expected behavior
13:48 ZoffixW teatime, I figured it was a classlike thing, I wanted to know more.
13:48 scovit the supply is generating hashes
13:49 scovit so you want to grep for a specific field
13:49 psch m: class Int { method Str { die "huhue" } }; say 5
13:49 camelia rakudo-moar 40a953: OUTPUT«===SORRY!===␤P6opaque: must compose before allocating␤»
13:49 timotimo m: say X.HOW.WHAT
13:49 camelia rakudo-moar 40a953: OUTPUT«(PackageHOW)␤»
13:49 timotimo X is just a package containing all our exceptions
13:49 ZoffixW tony-o, I don't see X there. Only X::AdHoc.
13:49 psch i mean, if you overwrite a CORE package or class you don't get the CORE one anymore
13:49 geekosaur (I think it's just namespace but currently if a namespace is instantiated already in one compunit then using it elsewhere explodes)
13:50 psch the case with X is a bit unfortunate, because people might want to use it for an example
13:51 psch but i think that's still fair vOv
13:52 geekosaur teatime, re "use warnings", that perl5 had warnings off by default was considered a bug, and perl 6 has warnings on by default
13:52 tony-o ZoffixW: a quick grep on the rakudo source doesn't yield any definition of X itself
13:52 geekosaur I think there is currently no way to turn warnings *off* in fact
13:52 timotimo well, when the compiler throws its own errors, it looks in the core setting for X
13:52 ZoffixW m: class X::NPQ {}; X::NQP::NotFound.new( op => "blah" ).throw
13:52 camelia rakudo-moar 40a953: OUTPUT«Could not find nqp::blah, did you forget 'use nqp;' ?␤  in block <unit> at /tmp/TowW9GzhDf line 1␤␤»
13:52 ZoffixW there's quietly block
13:52 psch m: my @a = { a => 1 }, { b => 2 }, { c => 3 }; my $sup = @a.Supply; $sup.tap({ if $_<b>:exists { say "found $_!" } });
13:52 camelia rakudo-moar 40a953: OUTPUT«found b      2!␤»
13:52 timotimo so declaring an X class or something doesn't break things any more
13:52 psch scovit: ^^^ is that what you're looking for?
13:52 ZoffixW m: say quietly 42 + Any
13:52 camelia rakudo-moar 40a953: OUTPUT«42␤»
13:53 teatime geekosaur: so "use warnings" in repl is supposed to fail?  kk, thx.
13:53 geekosaur yes, because no such module
13:53 tony-o i'll write that module
13:53 geekosaur because currently it can't do anything
13:53 geekosaur (useful)
13:53 tony-o it'll just print out 'you\'ve been warned'
13:53 ZoffixW :)
13:54 scovit thanks psch
13:54 teatime tony-o: "we WARNED you to read 5to6.pod!" ?  :)
13:54 geekosaur "this means WARning!"
13:55 tony-o version .2 of the module will choose a random line from perl6 backlog with the word 'warn' in it and print that out
13:58 tony-o ZoffixW: it looks like X is implicitly declared through all of the other X:: stuff in source, i'm not finding anything in the source explicitly defining X either
13:58 tony-o m: class T::R { }; say T; #and this seems to work
13:58 camelia rakudo-moar 40a953: OUTPUT«(T)␤»
13:58 timotimo yeah
13:59 timotimo declaring something to be inside some package will declare the package for you if it doesn't exist yet
13:59 ZoffixW That's really weird to a Perl 5 mind...
14:00 * psch .oO( what do you mean '0' is true?! )
14:00 timotimo you can't declare something like Foo::Bar unless that happens
14:00 ZoffixW tony-o, thanks. I think I understand what's going on with X now.
14:01 tony-o it makes sense with teh way that stuff is stored in GLOBAL:: , too
14:01 geekosaur yes, as things currently work if you define an X::something then it has to create a namespace X for it to live in
14:01 geekosaur and that renders it unusable in a different scope
14:02 timotimo if you're in an inner lexical scope, you can frely redeclare stuff
14:02 ZoffixW Does this imply if I have class MyCompany::Something::OrOther {} in one package and then define class MyCompany::Something {} on the other package, the ::OrOther class will become broken?
14:02 teatime woe...  POSIX does not seem to list \e escape for printf utility...  it's so much prettier than printf "\033"  >:(
14:02 ZoffixW I see why X is there, but now why declaring it in your code breaks all the X::whatever classes
14:02 tony-o ZoffixW: no
14:02 ZoffixW s/now/not/;
14:03 tony-o ZoffixW: well, kind of..if you define conflicting methods or roles/classes in 'MyCompany::' then, yes, right now it would break
14:04 tony-o you can look at HTTP::Server and .. i'm drawing a blank on the other module, have that conflict in the existing ecosystem
14:04 ZoffixW No, not conflicting. say, Y::AdHoc and Y
14:04 psch m: package X { }; X::AdHoc.throw
14:04 camelia rakudo-moar 40a953: OUTPUT«Could not find symbol '&AdHoc'␤  in block <unit> at /tmp/_FVhdfnwwZ line 1␤␤Actually thrown at:␤  in block <unit> at /tmp/_FVhdfnwwZ line 1␤␤»
14:04 tony-o ZoffixW: then no, you'd be fine
14:04 jnthn Note that X, coming from the setting, is a lexically scoped package, meaning that your own X hides it. That's a bit different from where you have other symbols in GLOBAL, which undergo merging
14:04 ZoffixW But then why does it break in X?
14:04 ZoffixW Ah
14:04 geekosaur because ti funbd X::AdHoc it needs to look inside X, but the X it gets is the wrong one
14:04 psch m: package GLOBAL::X { }; X::AdHoc.throw
14:04 camelia rakudo-moar 40a953: OUTPUT«Could not find symbol '&AdHoc'␤  in block <unit> at /tmp/0WIolem4Z_ line 1␤␤Actually thrown at:␤  in block <unit> at /tmp/0WIolem4Z_ line 1␤␤»
14:05 jnthn m: class X { }; CORE::X::AdHoc.throw
14:05 camelia rakudo-moar 40a953: OUTPUT«Invocant requires an instance of type X::AdHoc, but a type object was passed.  Did you forget a .new?␤  in block <unit> at /tmp/3vsACX7Re2 line 1␤␤»
14:05 jnthn m: class X { }; CORE::X::AdHoc..newthrow
14:05 camelia rakudo-moar 40a953: OUTPUT«5===SORRY!5=== Error while compiling /tmp/KahIwsJ2d6␤Undeclared routine:␤    newthrow used at line 1␤␤»
14:05 jnthn m: class X { }; CORE::X::AdHoc.new.throw
14:05 camelia rakudo-moar 40a953: OUTPUT«Unexplained error␤  in block <unit> at /tmp/7sy_5taue5 line 1␤␤»
14:05 psch ehh, the missing .new might play a role there...
14:05 ZoffixW psch, same error with .new
14:05 khw joined #perl6
14:06 ZoffixW m: class Proc {}; Proc::Async.new
14:06 camelia rakudo-moar 40a953: OUTPUT«Could not find symbol '&Async'␤  in block <unit> at /tmp/zNserfes4Y line 1␤␤Actually thrown at:␤  in block <unit> at /tmp/zNserfes4Y line 1␤␤»
14:06 psch i still think that's fine, because shadowing is a thing... vOv
14:06 skids joined #perl6
14:07 geekosaur shadowing is a thing but most people don't expect it to apply at that level
14:07 timotimo it's only bad inside the lexical scope(s) that have the redeclared X
14:07 * ZoffixW releases Break::AllThePerl
14:07 geekosaur ideally if it doesn't find a symbol in the nearest namespace in scope then it should look in that namespace in other scopes
14:08 tony-o a package that redefines all CORE::<xyz>
14:08 psch m: package CORE { }; say 1
14:08 camelia rakudo-moar 40a953: OUTPUT«5===SORRY!5=== Error while compiling /tmp/iAnULuje2U␤Cannot use pseudo package CORE in package name␤at /tmp/iAnULuje2U:1␤------> 3package CORE7⏏5 { }; say 1␤    expecting any of:␤        generic role␤»
14:08 timotimo if i recall correctly, CORE is a pseudopackage
14:08 psch aww, that woulda been shorter
14:08 timotimo and immutable
14:09 tony-o MVMContext
14:09 ely-se joined #perl6
14:09 ZoffixW m: role IO {}; IO::Path.new
14:09 camelia rakudo-moar 40a953: OUTPUT«Could not find symbol '&Path'␤  in block <unit> at /tmp/EeERcfCRL6 line 1␤␤Actually thrown at:␤  in block <unit> at /tmp/EeERcfCRL6 line 1␤␤»
14:09 ZoffixW I kinda would've expected a warning at least for this one, due to there being an IO role in core
14:10 jnthn We don't treat "it's in core" specially.
14:10 jnthn (For language extensibility and backward compatibility reasons)
14:10 ZoffixW m: role IO {}; role IO {};
14:10 camelia rakudo-moar 40a953: ( no output )
14:10 psch m: class Perl6::ClassHOW { }; 1
14:10 camelia rakudo-moar 40a953: OUTPUT«WARNINGS for /tmp/jODdCZiZeO:␤Useless use of constant integer 1 in sink context (line 1)␤»
14:10 psch m: class Perl6::ClassHOW { }; say 1
14:10 camelia rakudo-moar 40a953: OUTPUT«1␤»
14:11 psch oh, everything already compose, of course
14:11 geekosaur now here's a potential use for `use warnings`: shadowing warnings
14:11 sjoshi joined #perl6
14:11 ZoffixW You can have to same-named roles in a row, but now classes? :S
14:12 ZoffixW m: role IO {}; role IO {}; class Meow {}; class Meow {}
14:12 camelia rakudo-moar 40a953: OUTPUT«5===SORRY!5=== Error while compiling /tmp/M6ji2iFQQY␤Redeclaration of symbol Meow␤at /tmp/M6ji2iFQQY:1␤------> 3}; role IO {}; class Meow {}; class Meow7⏏5 {}␤    expecting any of:␤        generic role␤»
14:12 psch m: role R { }; role R { }; 1 does R
14:12 camelia rakudo-moar 40a953: OUTPUT«No appropriate parametric role variant available for 'R'␤  in any specialize at gen/moar/m-Metamodel.nqp line 2609␤  in any compose at gen/moar/m-Metamodel.nqp line 2988␤  in any generate_mixin at gen/moar/m-Metamodel.nqp line 1324␤  in any  at gen…»
14:12 psch m: role R { }; role R { }; 1 but R
14:12 camelia rakudo-moar 40a953: OUTPUT«No appropriate parametric role variant available for 'R'␤  in any specialize at gen/moar/m-Metamodel.nqp line 2609␤  in any compose at gen/moar/m-Metamodel.nqp line 2988␤  in any generate_mixin at gen/moar/m-Metamodel.nqp line 1324␤  in any  at gen…»
14:12 jnthn Roles are implicitly multi
14:12 jnthn That error should probably complain about ambiguous roles
14:12 ZoffixW m: multi class Meow {}; multi class Meow {}
14:12 camelia rakudo-moar 40a953: OUTPUT«5===SORRY!5=== Error while compiling /tmp/Rd00GcBNsU␤Missing block␤at /tmp/Rd00GcBNsU:1␤------> 3multi class7⏏5 Meow {}; multi class Meow {}␤    expecting any of:␤        new name to be defined␤»
14:12 jnthn hah, I didn't mean literally :)
14:12 ZoffixW I was just checking :)
14:13 jnthn just that role A { } and role A[::T] { } are disambiguated using multi dispatch :)
14:13 jnthn As with all multi thing though, it'd be nice to catch the obvious ambiguities at compile time.
14:14 dakkar joined #perl6
14:17 tharkun joined #perl6
14:18 mcsnolte joined #perl6
14:39 scovit what do you think about this workaround: http://pastebin.com/gu7ezN6s  do you have anything more simple to suggest?
14:43 tony-o lol, these people mime encoded their email address for you to send a resume to - https://www.ziprecruiter.com/jobs/evoknow-inc-800b69bb/web-software-developer-lamp-stack-5354b771?source=ziprecruiter-jobs-site
14:43 zostay joined #perl6
14:43 zostay joined #perl6
14:44 psch ...what
14:45 psch why do they need a developer with leadership experience
14:46 psch and what does "Linux - you must know Linux command-line very very well" even mean
14:46 timotimo "very very well"
14:46 timotimo - must know how to use "uniq"
14:46 perigrin you know how to deal with arrays in bash.
14:47 timotimo oh, wow
14:47 tony-o must know Linux command-line personally and have attended 3 formal dinners with her
14:47 timotimo that's a harsh requirement
14:47 ptolemarch (Interview question #6: "On the Linux command line, does the stuff you type come before the $ or after?")
14:47 tony-o lol
14:47 psch obviously both, duh :)
14:48 tony-o depends on PS1 settings and how much of a one liner nerd you are
14:48 psch i never understood the desire for multi-line prompts
14:48 psch ...as a side note
14:48 perigrin ptolemarch: trick question, everyone here has login as root.
14:49 tony-o a lot of these jobs are like this, 'must have led men in combat, needs to have code in core PHP, and 30 years JEE experience + MySQL, POSTGRES, HADOOP, HBASE, and HIVE implementations - salary starts at $40k'
14:49 ufobat :D
14:50 tony-o perigrin: the retail company i worked for before, everyone had sudo so everyone would just 'sudo su -' as soon as they logged into any server
14:50 perigrin tony-o: I've had that experience.
14:50 brrt tony-o, tbh, i'm not really seeing how that encoding works
14:51 * psch mostly was lucky with that kind of thing
14:51 jnthn brrt: hah, no employment for you!
14:51 tony-o they asked me to figure out who performed some command that took down 30 some odd servers and there were 8 people logged into that server with sudo at that time
14:51 psch the worst i saw was a 4k or so .jspf that started a catch in line 50 and ended it in line 3950 or somesuch
14:51 psch 4k loc*
14:51 brrt can't be a php progammer then....
14:51 tony-o lol
14:52 jnthn brrt: I think you came out on top of that one... :)
14:52 tony-o you can be a brogrammer
14:52 brrt :-P
14:53 timotimo oh hey brrt
14:53 brrt ohhai timotimo
14:53 brrt yeah, long time no visit, i know
14:54 brrt (fwiw, on the topic of jobs, i have a great argument ready)
14:54 brrt consider the following question:
14:54 jnthn Guess since you're not up to being a PHP programmer you'll have to go with some lowly job, like JIT compiler writer... :)
14:54 brrt "please convince my boss that test-driven development is worth the investment"
14:55 brrt right :-)
14:55 * brrt is seriously not so sure that is a very profitable carreer choice, though, compared to writing php
14:55 brrt although considering the added mental sanity, it might add up
14:56 Actualeyes joined #perl6
14:56 jnthn haha... danger money
14:57 brrt anyway, my argument is that the question is one of the best interview questions to ask
14:57 brrt much better than 'implement a method to do $x in O($y), never mind that the original researchers took +5 years to figure it out'
14:58 ZoffixW joined #perl6
14:58 zostay joined #perl6
14:58 * psch can see that
14:59 psch that is, questions that ask for reasons for development methodology vs. implementation details
14:59 psch like, "why is a VCS useful" vs "how do you do $x in git"
14:59 ZoffixW m: my $x = '8 1k1a1b1i1r1+1c1l4-1p1h1p4-1d1e1v1@1e1v1o1k1n1o1w1.1c1o1m8'; $x.subst: /(\d+)(.)/{$2 x $1}/; say $x
14:59 camelia rakudo-moar 40a953: OUTPUT«5===SORRY!5=== Error while compiling /tmp/SqnlptuOPg␤Missing required term after infix␤at /tmp/SqnlptuOPg:1␤------> 1c1o1m8'; $x.subst: /(\d+)(.)/{$2 x $1}/7⏏5; say $x␤    expecting any of:␤        prefix␤        term␤»
15:00 ZoffixW Well, damn. Apparently I can get a PHP job, but not a Perl 6 job :P
15:00 timotimo yeah, that's not how you subst with the method form
15:00 hoelzro o/ #perl6
15:01 * brrt afk
15:01 psch o/ hoelzro
15:02 ZoffixW m: my $x = '8 1k1a1b1i1r1+1c1l4-1p1h1p4-1d1e1v1@1e1v1o1k1n1o1w1.1c1o1m8'; say $x ~~  s/(\d+)(.)/{$2 x $1}/; say $x
15:02 camelia rakudo-moar 40a953: OUTPUT«Use of Nil in string context  in block  at /tmp/viG60QR9v1 line 1␤「8 」␤ 0 => 「8」␤ 1 => 「 」␤1k1a1b1i1r1+1c1l4-1p1h1p4-1d1e1v1@1e1v1o1k1n1o1w1.1c1o1m8␤»
15:02 ZoffixW I don't get how P6's s/// works :/
15:02 psch m: $_ = "ab"; m/(.)(.)/; say $0, $1, $2
15:02 camelia rakudo-moar 40a953: OUTPUT«「a」「b」Nil␤»
15:03 timotimo yeah, we start at 0 here
15:04 * psch wanted to leave in it the spirit of a puzzle :P
15:04 ZoffixW m: my $x = '1k1a1b1i1r1+1c1l4-1p1h1p4-1d1e1v1@1e1v1o1k1n1o1w1.1c1o1m'; $x ~~  s:g/(\d+)(.)/{$1 x $0}/; say $x
15:04 camelia rakudo-moar 40a953: OUTPUT«kabir+cl----php----dev@evoknow.com␤»
15:04 ZoffixW Hooray!
15:04 timotimo oh, sorry psch
15:04 psch hah, it's fine :)
15:04 ZoffixW It was RLE encoded in base64. Some puzzle
15:05 hoelzro o/ psch
15:05 tony-o upload your resume & fill out your job experience manually!
15:05 ZoffixW My only experience with PHP is running away while screaming "Oh, God!"
15:07 tony-o i can type <?php
15:07 timotimo i've created a typical forum thing with php and mysql in the past
15:07 psch i have actually worked on a project on the low end of medium size in php
15:07 ZoffixW So .subst/,subst-mutate can't use captures?
15:07 tony-o actually i've had to go and create modules for wordpress and various other php things for my dad
15:08 ZoffixW m: my $x = '1k1a1b1i1r1+1c1l4-1p1h1p4-1d1e1v1@1e1v1o1k1n1o1w1.1c1o1m'; $x.subst-mutate: /(\d+)(.)/, "{$1 x $0}", :g; say $x
15:08 camelia rakudo-moar 40a953: OUTPUT«Use of Nil in string context  in block  at /tmp/kY5_7KixDb line 1␤Use of Nil in numeric context  in block  at /tmp/kY5_7KixDb line 1␤␤»
15:08 tony-o and drupal projects
15:08 psch ZoffixW: add $/ as explicit parameter to block
15:08 psch ZoffixW: that's the current workaround, because it misses the rightly scoped $/
15:08 psch *the block
15:08 psch m: my $x = '1k1a1b1i1r1+1c1l4-1p1h1p4-1d1e1v1@1e1v1o1k1n1o1w1.1c1o1m'; $x.subst-mutate: /(\d+)(.)/, -> $/ {$1 x $0}, :g; say $x
15:08 camelia rakudo-moar 40a953: OUTPUT«kabir+cl----php----dev@evoknow.com␤»
15:09 ZoffixW Ah. I see. psch++
15:11 tony-o php has a cool orm, readbean: http://www.redbeanphp.com/index.php
15:12 timotimo you can tell it's php by the ".php" at the end and the "php." in the front
15:12 tony-o is what i modeled DB::ORM::Quicky after, loosely.  except DOQ is easier/better because it isn't php
15:13 tony-o it's almost a palindrome
15:13 timotimo oh, that's harsh
15:13 timotimo just because it's not php doesn't automatically mean it's better
15:13 psch "RedBeanPHP will [...] giv[e] you the NoSQL experience"
15:13 timotimo it just means it's kind of likely
15:13 psch i don't know what to think of that
15:14 tony-o timotimo: was a joke
15:14 timotimo it creates your schemas on the fly, i'm not entirely sure what that means for performance
15:14 timotimo since usually .php files are run once for every request
15:14 timotimo does every request start by asking the database what its tables look like?
15:14 tony-o it's slower, it's useful for prototyping things
15:14 psch timotimo: "When deploying [...] you can freeze the schema [...]"
15:15 timotimo yeah, but how is it frozen? they claim there's no configuration anywhere
15:15 timotimo do they just put a table into the database with the pre-compiled php code?
15:15 psch probably add "R::freeze()" at the top of every file during deploy... :)
15:16 psch seriously though, i probably don't really know enough about DBMS in theory or practise to actually criticise any such project
15:16 psch if it works and does what they say it does it's probably at least decent..? vOv
15:17 timotimo probably
15:17 tony-o i wouldn't use it in a productive environment, but if you're building something for a client where they're not quite sure what data they want to capture it's easier than modifying the table manually/updating the schema manually while prototyping
15:18 scovit I made this small module as an experiment and as a way to learn asynchronous stuff; I am amazed of how simple it was to do this in Perl6 : https://github.com/scovit/perl6-IRC-Async
15:20 Actualeyes joined #perl6
15:21 ZoffixW That code looks shockingly like my own lol :)
15:22 scovit :) you guess where I got the inspiration?
15:22 ZoffixW :)
15:22 tony-o you *are* credited in the readme
15:23 ZoffixW heh
15:25 scovit it's basically your module with a different programming paradigm
15:26 ZoffixW scovit, cool. Add it to the ecosystem.
15:26 RabidGravy :)
15:26 psch what was the actual plan behind Koalatee, anyway?
15:26 scovit :)
15:26 psch (and why does it link to not_implemented_yet and not not_yet_implemented?!)
15:27 ZoffixW psch, the plan behind was making something similar to Perl 5's Kwalitee where dists have a bunch of metrics that sorta represent their quality: http://cpants.cpanauthors.org/ranking/five_or_more
15:27 psch RabidGravy: btw, if you have ideas or suggestions re https://github.com/peschwa/p6-Music-Helpers (minus "test and docs" :P ) i'd like to hear them
15:27 ZoffixW And because I can never remember which order it's goes in :)
15:28 psch ZoffixW: ah.  figuring out the metrics is gonna be fun i guess
15:29 RabidGravy psch, looks good to me, ship it!
15:30 psch RabidGravy: right, so "test and docs" i guess :P
15:30 psch +s
15:31 psch fwiw, i'm still missing features vOv
15:32 psch the chord type roles are lacking, for example
15:33 psch also there's an argument to be made for having the first inversion of Cmaj be equivalent to E46, which could be a chord in its own right...
15:33 psch also modes aware of sharp vs flat could be neat i guess
15:36 tony-o ZoffixW: if you want some help with koalatee, i'm a willing contributor (and i do that type of data analysis as a day job)
15:37 RabidGravy sure, but as it stands it's useful :) make a first release and then add the other stuff later
15:37 psch it is useful, yeah.  also bin/example.pl6 is actually fun to listen to
15:38 psch even though it chokes occassionally
15:38 psch i'm not completely sure why that happens, but i guess it's because sometimes the random intervals it picks don't exists from the current root
15:39 ZoffixW tony-o, no, I don't do any more work on modules.perl6.org, because we're supposed to be going with Meta6CPAN thing
15:39 tony-o is there a channel for that?
15:39 psch like, current chord is Cmaj, with C as root, and it gets m2, TT, m7 or something
15:39 * psch might work a bit more on docs and README later
15:40 tony-o or someone currently working on a meta6cpan thing?
15:40 ZoffixW tony-o, no idea. I know jdv79 was at some point.
15:40 ZoffixW And ranguard, if IRC
15:40 tony-o i was working on one for zef too, a while ago
15:41 tony-o if no one is working on it, i'd be willing to head that up
15:42 spanner joined #perl6
15:42 spanner__ joined #perl6
15:43 pmurias having a meta6cpan working would be awesome
15:44 pmurias having a standarised per module page is much better than just using github
15:45 gregf_ https://gist.github.com/anonymous/1af73f2254f839f58690a6e7e3dc9c5e <= why does this hang?
15:45 tony-o the zef thing i was writing was similar to NPM's set up for modules, had the README and github stats on it (bugs/etc)
15:45 gregf_ oops :/ sorry
15:46 tony-o it was also storing the modules with versions and caching them as available for download by packagers
15:47 tony-o i'd restart that project if that is still interesting
15:47 lostinfog joined #perl6
15:48 tony-o gregf_: does line 12 ever finish?
15:48 zakharyas joined #perl6
15:49 gregf_ tony-o: :|, sorry lol.. but it surely should. it does for 300, but not for 1800 :|
15:50 tony-o for 300 files?
15:55 dalek ecosystem: af5674d | (Vittore F. Scolari)++ | META.list:
15:55 dalek ecosystem: Add IRC::Async to the ecosystem
15:55 dalek ecosystem: review: https://github.com/perl6/ecosystem/commit/af5674d4cb
15:55 dalek ecosystem: 6df5608 | (Zoffix Znet)++ | META.list:
15:55 dalek ecosystem: Merge pull request #195 from scovit/master
15:55 dalek ecosystem:
15:55 dalek ecosystem: Add IRC::Async to the ecosystem: https://github.com/scovit/perl6-IRC-Async/
15:55 dalek ecosystem: review: https://github.com/perl6/ecosystem/commit/6df5608d90
15:57 grondilu m: say do for ^5 { .sqrt }.Set;
15:57 camelia rakudo-moar 40a953: OUTPUT«set(2, 0, 1, 1.4142135623731, 1.73205080756888)␤»
15:57 grondilu ^not sure if that syntax is acceptable
15:58 tony-o acceptable how?
15:58 grondilu don't know, "bad taste" or something.
15:59 grondilu just to be clear I'm talking about using a method call to a do block, with no parenthesis at all.
15:59 grondilu I like it but it bugs me in the same time.
16:00 jnthn m: say do for ^5 { .sqrt } .Set; # can use whitespace to maybe clarify a tad
16:00 camelia rakudo-moar 40a953: OUTPUT«set(2, 0, 1, 1.4142135623731, 1.73205080756888)␤»
16:00 jnthn m: say set do for ^5 { .sqrt }; # but maybe this is clearer?
16:00 camelia rakudo-moar 40a953: OUTPUT«set(2, 0, 1, 1.4142135623731, 1.73205080756888)␤»
16:02 sue_ joined #perl6
16:05 TEttinger joined #perl6
16:05 grondilu sure but I wanted a MixHash actually, just used a set for a not too peculiar example.
16:05 [Coke] m: say 0.0 cmp 0
16:05 camelia rakudo-moar 40a953: OUTPUT«Same␤»
16:05 [Coke] m: say '0.0' ~~ 0 ^..^ 1; say 0.0  ~~ 0 ^..^ 1; say '1.0' ~~ 0 .. 1  ; say 1.0  ~~ 0 .. 1
16:05 camelia rakudo-moar 40a953: OUTPUT«True␤False␤False␤True␤»
16:06 [Coke] m: say '0.0' cmp 0
16:06 camelia rakudo-moar 40a953: OUTPUT«More␤»
16:06 [Coke] I imagine those should work. (RT #124400)
16:06 synopsebot6 Link:  https://rt.perl.org/rt3//Public/Bug/Display.html?id=124400
16:17 michel_mno left #perl6
16:21 pmurias tony-o: is there a big difference between RedBean and just doing something like automatically generating the schema in DBIx::Class
16:23 tony-o pmurias: i'm aware, i just thought redbean was neat for quickly prototyping something out.  I do have an appreciation for DBIx::Class.  Admittedly, it took me a while to fully appreciate DBIx stuff
16:35 pmurias joined #perl6
16:46 pmurias rakudo-js, compiles and prints out the "To exit type 'exit'...". (and then fails when trying to load the BOOTSTRAP, which needs to be done next)
16:47 jnthn pmurias: Nice progress :)
16:47 [Coke] pmurias++
16:49 pmurias a buffer size of 10 in nqp::readallfh was killing the nqp-js-on-js performance ;)
16:49 ptolemarch peregrin++  # just saw reply to me from 2 hours ago...
16:51 teatime Are patch files emailed to rakudobug truly preferred as rakudo/README.md says, or are github PR's equally acceptable ?
16:53 psch teatime: i'd say the README is outdated - generally, github PRs are prefered
16:53 psch ISTR there was a time stuff was on SVN somewhere..?
16:54 psch pmurias++
16:54 teatime thx
16:54 CIAvash joined #perl6
16:56 teatime my next question was, where can I find the CLA document to fill out
16:57 mprelude joined #perl6
16:57 psch teatime: http://www.perlfoundation.org/contributor_license_agreement
16:58 psch teatime: note that's only really necessary if you expect yourself to regularly contribute to rakudo
16:58 perl6newbee joined #perl6
16:58 perl6newbee hi all
16:58 psch (fsvo "regularly", considering e.g. my commit history...)
16:59 nige1 joined #perl6
16:59 teatime it's not required to get any code whatsoever accepted into Rakudo?  seems like it would be, if it's required at all.
17:00 [Coke] if you have a PR or submit a ticket, someone is reviewing your code.
17:00 [Coke] if you have commit bits, you need a CLA.
17:02 teatime interesting.  I don't see how someone reviewing the code I submit ensures Perl's ultimate right to use that code in the same way CLA does.  Perhaps I mis-assume its primary goal.
17:04 teatime reading it, I suppose it's not quite the same sort of thing as the copyright assignment I was expecting
17:04 teatime like GNU's.
17:05 perl6newbee I know how to stringify a object. my $str = MyClass.new.perl; But what is the official way to create a object with the string? I mean, is there a way without MONKEY-No-SEE-EVAL?
17:05 teatime MyClass.new.perl.EVAL ?
17:05 psch perl6newbee: .perl doesn't stringify.  .perl contractly is expected to provide a Str representation that EVALs to an equivalent object
17:05 psch *contractually
17:06 teatime ~MyClass.new.perl coerces to a string, like python __str__... .perl is like Python __repr__
17:06 tony-o pmurias++
17:06 psch perl6newbee: but the "offical" way to create an object from something produced by that objects .perl is in fact EVAL
17:06 teatime there's also gist, which I think is the same as ~
17:07 psch teatime: no, prefix:<~> calls .Str, &say uses .gist internally
17:07 teatime and I think there's another method name for stringing, .Str or .String or .str or something?
17:07 psch m: my @a = ^5; say ~@a; say @a
17:07 camelia rakudo-moar 40a953: OUTPUT«0 1 2 3 4␤[0 1 2 3 4]␤»
17:07 teatime psch: are they actually different though?
17:07 psch m: my @a = ^5; say ~@a; say @a; print @a.gist
17:07 teatime I've read conflicting docs
17:07 camelia rakudo-moar 40a953: OUTPUT«0 1 2 3 4␤[0 1 2 3 4]␤[0 1 2 3 4]»
17:07 psch teatime: ticket the docs please :)
17:08 teatime is gist the same a perl then?
17:08 perl6newbee thx all. psch: Do I need the MONKEY-NOT-SEE-EVAL also with $str.eval?
17:08 timotimo no, it is not
17:08 psch m: my @a = 0..*; say @a.gist; say @a.perl
17:08 camelia rakudo-moar 40a953: OUTPUT«[...]␤Cannot .elems a lazy list␤  in block <unit> at /tmp/tQ2aiagzmT line 1␤␤Actually thrown at:␤  in block <unit> at /tmp/tQ2aiagzmT line 1␤␤»
17:08 timotimo m: say DateTime.now().Str; say DateTime.now().gist
17:08 camelia rakudo-moar 40a953: OUTPUT«2016-04-12T19:08:34.645492+02:00␤2016-04-12T19:08:34.655969+02:00␤»
17:08 timotimo hm, in this case it is
17:08 psch m: Str.^can('eval')
17:08 camelia rakudo-moar 40a953: ( no output )
17:08 psch m: Str.^can('eval').say
17:08 camelia rakudo-moar 40a953: OUTPUT«()␤»
17:08 timotimo uppercase eval
17:08 psch perl6newbee: there is no .eval
17:08 psch *snrk*
17:09 perl6newbee m: Str.^can(EVAL)
17:09 camelia rakudo-moar 40a953: OUTPUT«Too few positionals passed; expected 1 argument but got 0␤  in block <unit> at /tmp/jq6vRyRGGn line 1␤␤»
17:09 psch m: Str.^can('EVAL').say
17:09 camelia rakudo-moar 40a953: OUTPUT«(EVAL)␤»
17:09 psch m: Str.EVAL
17:09 camelia rakudo-moar 40a953: OUTPUT«Use of uninitialized value $code of type Str in string context␤Any of .^name, .perl, .gist, or .say can stringify undefined things, if needed.  in block <unit> at /tmp/nl8A1h2B2w line 1␤»
17:09 teatime so .Str, .gist, and .perl are all unique.  but ~ calls .Str (and say calls .gist).  yes?
17:09 psch m: "[0 1]".EVAL.perl.say
17:09 camelia rakudo-moar 40a953: OUTPUT«5===SORRY!5=== Error while compiling /home/camelia/EVAL_0␤Two terms in a row␤at /home/camelia/EVAL_0:1␤------> 3[07⏏5 1]␤    expecting any of:␤        infix␤        infix stopper␤        statement end␤        statement modifier␤…»
17:09 tony-o m: 'say "hi"'.EVAL;
17:09 camelia rakudo-moar 40a953: OUTPUT«hi␤»
17:09 psch oh, that's gist
17:10 psch i think that *should* fall behind the pragma
17:10 psch it apparently doesn't, though
17:10 perl6newbee Thanks for the help
17:11 tony-o behind the restricted setting psch ?
17:11 psch tony-o: no, behind use MONKEY-SEE-NO-EVAL
17:11 tony-o m: my $r = 'Proc::Async.new'.EVAL; $r.WHAT.say;
17:11 camelia rakudo-moar 40a953: OUTPUT«Proc::Async is disallowed in restricted setting␤  in sub restricted at src/RESTRICTED.setting line 1␤  in method new at src/RESTRICTED.setting line 32␤  in block <unit> at EVAL_0 line 1␤  in block <unit> at /tmp/3xobMR1yn9 line 1␤␤»
17:11 tony-o psch: ah
17:11 psch m: EVAL "say 'hi'"
17:11 camelia rakudo-moar 40a953: OUTPUT«hi␤»
17:11 psch ...unless it's not needed in RESTRICTED..? :/
17:12 psch or maybe camelia injects it, idk vOv
17:12 psch it doesn't care locally either?  did anything happen to that and i missed it..?
17:13 TimToady it only cares if you interpolate
17:13 tony-o m: my $what = 'Proc::Async'; "$what.new".EVAL;
17:13 camelia rakudo-moar 40a953: OUTPUT«Proc::Async is disallowed in restricted setting␤  in sub restricted at src/RESTRICTED.setting line 1␤  in method new at src/RESTRICTED.setting line 32␤  in block <unit> at EVAL_0 line 1␤  in block <unit> at /tmp/lcxnDZf9cO line 1␤␤»
17:13 tony-o m: my $what = 'Proc::Async'; "say $what".EVAL;
17:13 camelia rakudo-moar 40a953: OUTPUT«Proc::Async is disallowed in restricted setting␤  in sub restricted at src/RESTRICTED.setting line 1␤  in method gist at src/RESTRICTED.setting line 33␤  in block <unit> at EVAL_0 line 1␤  in block <unit> at /tmp/JIf_AVFoQw line 1␤␤»
17:14 TimToady but yes, the method form might be too permissive
17:16 TimToady m: my $injection = "die 'foo';"; say EVAL "$injection + 1"
17:16 camelia rakudo-moar 40a953: OUTPUT«5===SORRY!5=== Error while compiling /tmp/LSyTbcgPLY␤EVAL is a very dangerous function!!! (use MONKEY-SEE-NO-EVAL to override,␤but only if you're VERY sure your data contains no injection attacks)␤at /tmp/LSyTbcgPLY:1␤------> 3 "die 'foo';"; s…»
17:16 TimToady m: my $injection = "die 'foo';"; say "$injection + 1".EVAL
17:16 camelia rakudo-moar 40a953: OUTPUT«foo␤  in block <unit> at EVAL_0 line 1␤  in block <unit> at /tmp/ioeB_xa1gI line 1␤␤»
17:22 Begi joined #perl6
17:24 spider-mario joined #perl6
17:26 domidumont joined #perl6
17:27 timotimo http://unicode.party/ - neat
17:28 _mg_ joined #perl6
17:29 tony-o 😘
17:29 tony-o interesting
17:29 psch .u 😘
17:29 yoleaux U+1F618 FACE THROWING A KISS [So] (😘)
17:30 timotimo .u 🦄
17:30 yoleaux No characters found
17:30 timotimo ... :\
17:31 TimToady Someday people will give their babies names with emoticons in them.
17:34 * masak .oO( her real name is U+1F618, but most of the time we just call her "U" )
17:34 * psch is reminded of a video game - "Citizen Ka👢o"
17:35 psch m: say "\u1F618"
17:35 camelia rakudo-moar 40a953: OUTPUT«5===SORRY!5=== Error while compiling /tmp/w65hGZL5_K␤Unrecognized backslash sequence: '\u'␤at /tmp/w65hGZL5_K:1␤------> 3say "\7⏏5u1F618"␤    expecting any of:␤        argument list␤        double quotes␤        term␤»
17:35 psch m: say "\x1F618"
17:35 camelia rakudo-moar 40a953: OUTPUT«😘␤»
17:35 psch grr
17:36 psch but hey, at least i don't have to ask yoleaux again, cause *now* i realize it's the same codepoint...
17:37 grondilu joined #perl6
17:39 teatime m: say "\x{1F618}", "\N{U+1F618}"
17:39 camelia rakudo-moar 40a953: OUTPUT«5===SORRY!5=== Error while compiling /tmp/AnrFXv1uad␤Unsupported use of curlies around escape argument; in Perl 6 please use square brackets␤at /tmp/AnrFXv1uad:1␤------> 3say "\x{7⏏1F618}", "\N{U+1F618}"␤»
17:40 teatime m: say "\x[1F618]", "\N[U+1F618]"
17:40 camelia rakudo-moar 40a953: OUTPUT«5===SORRY!5=== Error while compiling /tmp/b8ZfabGlVa␤Unrecognized backslash sequence: '\N'␤at /tmp/b8ZfabGlVa:1␤------> 3say "\x[1F618]", "\7⏏5N[U+1F618]"␤    expecting any of:␤        double quotes␤        term␤»
17:41 timotimo m: say "\c[PILE OF POO]"
17:41 camelia rakudo-moar 40a953: OUTPUT«💩␤»
17:41 timotimo m: say "\c[U+1F618]"
17:41 camelia rakudo-moar 40a953: OUTPUT«5===SORRY!5=== Error while compiling /tmp/G4FyCM8iW7␤Unrecognized character name U+1F618␤at /tmp/G4FyCM8iW7:1␤------> 3say "\c[U+1F6187⏏5]"␤»
17:41 timotimo we could totally have support for that format
17:42 psch not in \c though i think
17:42 teatime m: say "\x[1F618]"
17:42 camelia rakudo-moar 40a953: OUTPUT«😘␤»
17:44 timotimo i mean for accepting the U+ in front
17:46 * pmurias reading the backlog remembers that he should submit the CLA
17:47 pmurias teatime: I think it's just a rule to make sure all the more serious contributors submit a CLA
17:53 perlpilot timotimo: I always think I should type  \u[1F618], can we make that one work too?  :)
18:00 teatime in my XCompose DSL, I'll probably use something like \xhh \uhhhh and \Uhhhhhh, since the largest codepoint is 0x10FFFF now.
18:04 Sqirrel_ joined #perl6
18:04 smls joined #perl6
18:05 smls m: my %hash;  my (:$a) := %hash;  $a //= 42;
18:05 camelia rakudo-moar 40a953: OUTPUT«Type check failed in binding lhs; expected Any but got Mu (Mu)␤  in block <unit> at /tmp/KE1bKO_JhE line 1␤␤»
18:06 smls ^^ is there a way to destructure a Hash without getting Mu (rather than Any) for nonexistent fields?
18:07 smls Seeing how Mu isn't accepted by most functions/operators, and is thus pretty annoying to handle
18:08 nige1 joined #perl6
18:10 cdg joined #perl6
18:12 Sqirrel joined #perl6
18:12 xchg joined #perl6
18:12 skids Hrm...
18:13 skids m: my %hash;  my $a; :(:$a = 32) := %hash;  $a //= 42; $a.say;
18:13 camelia rakudo-moar 40a953: OUTPUT«32␤»
18:13 skids m: my %hash;  my $a; :(:$a = Any) := %hash;  $a //= 42; $a.say;
18:13 camelia rakudo-moar 40a953: OUTPUT«Cannot assign to a readonly variable or a value␤  in block <unit> at /tmp/y334aw4ITN line 1␤␤»
18:13 skids m: my %hash;  my $a; :(:$a = Nil) := %hash;  $a //= 42; $a.say;
18:13 camelia rakudo-moar 40a953: OUTPUT«Cannot assign to a readonly variable or a value␤  in block <unit> at /tmp/aGVPeJg87h line 1␤␤»
18:14 skids Well,
18:14 kent\n joined #perl6
18:14 kent\n joined #perl6
18:14 skids m: my %hash;  my $a; :(:$a = 42) := %hash; $a.say;
18:14 camelia rakudo-moar 40a953: OUTPUT«42␤»
18:14 skids Gets the initial job done, but I don;t know why it complains about "= Any"
18:14 smls yes, that looks strange
18:15 smls On a related matter, why do pointy block arguments default to Mu but sub/method arguments default to Any?
18:15 timotimo yes
18:15 skids I though methods also defaulted to Mu but sub to Any?
18:16 jnthn No, all routine args default to Any, including Method
18:16 jnthn It's because auto-threading junctions on routine boundary is sensible, but inside routine boundaries tended to be weird
18:16 jnthn As I remember it, anyway :)
18:17 jnthn There may well have been other reasons. I think it's been that way for at least half a decade.
18:18 kent\n joined #perl6
18:22 kentnl joined #perl6
18:26 moritz people where surprised when the block of their if-block or for-loop autothreaded :-)
18:28 kent\n joined #perl6
18:28 kent\n joined #perl6
18:31 jnthn moritz: Indeed :)
18:32 kentnl joined #perl6
18:33 sjn_phone joined #perl6
18:34 sjn_phone_ joined #perl6
18:38 silug joined #perl6
18:42 Sqirrel_ joined #perl6
18:46 smls Causes a number or WATs or annoying edge-cases when you're *not* working with junctions, though.
18:46 smls I suppose everything has its trade-offs... :)
18:52 moritz smls: example?
18:53 smls moritz:  Say you have a pointy block with an optional parameter, and inside the block you call a function and want to pass that variable along
18:54 smls It works fine as long as the optional parameter is passed, but when it isn't, it blows up with "expected Any got Mu"
18:54 moritz m: (-> $x? { say $x.^name })()
18:54 camelia rakudo-moar 40a953: OUTPUT«Mu␤»
18:54 moritz smls: could be fixed easy enough by making the default value Any
18:54 moritz I mean in the language
18:55 moritz that's how untyped 'my' scalars work: type constraint to Mu, default to Any
18:56 smls hm, true
18:56 pomJ joined #perl6
18:56 moritz TimToady: ^^ do you think that would be a sensible change for Perl 6.d?
18:59 teatime If you add type-specific operators to a class in rakudo/src/core/____.pm, do you need to also list these somewhere else?
19:00 teatime thought I read something about needing to include them somewhere, for correct precedence
19:00 moritz teatime: new operators must go into the grammar; the setting is special that way
19:01 timotimo it will loudly complain if you don't do ti, IIRC
19:01 grondilu m: dd MixHash.new: gather take 'foo' => 1
19:01 camelia rakudo-moar 40a953: OUTPUT«(:foo(1)=>1).MixHash␤»
19:01 timotimo look for O( or O< in the grammar, if i'm not mistaken
19:01 grondilu m: dd MixHash.new: 'foo' => 1
19:01 camelia rakudo-moar 40a953: OUTPUT«(:foo(1)=>1).MixHash␤»
19:02 grondilu m: dd ('foo' => 1).MixHash
19:02 camelia rakudo-moar 40a953: OUTPUT«("foo"=>1).MixHash␤»
19:02 grondilu so confusing
19:04 dogbert2 hello perl6
19:04 teatime moritz: oh, I'm only adding type-specific multis for things like infix *, /, +, -, % ... is that strill true, or only for *new* operators?
19:04 dogbert2 sigh, just made my first pull request ever on github for the docs
19:04 moritz teatime: no, you don't need it there
19:04 teatime sweetness
19:05 dogbert2 I tried to fix two typos and spelt the fix wrong :( what to do now?
19:05 dalek doc: e64b9ee | (Jan-Olof Hendig)++ | doc/Type/Cool.pod:
19:05 dalek doc: Fixed two typos
19:05 dalek doc: review: https://github.com/perl6/doc/commit/e64b9ee6f2
19:05 dalek doc: 86d716f | moritz++ | doc/Type/Cool.pod:
19:05 dalek doc: Merge pull request #449 from dogbert17/fix-typo
19:05 dalek doc:
19:05 dalek doc: Fixed two typos
19:05 dalek doc: review: https://github.com/perl6/doc/commit/86d716f2dc
19:05 ZoffixW joined #perl6
19:05 moritz dogbert2: you celebrate your first contribution to Perl 6. Thank you!
19:06 dogbert2 well, if I hade used a spell checker :(
19:06 dogbert2 *had
19:06 dogbert2 wanted to change 'firm' -> 'from' but wrote 'form', sigh
19:07 dalek doc: d6176ab | (David H. Adler)++ | doc/Type/Cool.pod:
19:07 dalek doc: Adjust doc for ord to indicate it returns *first* code point. (#448)
19:07 dalek doc:
19:07 dalek doc: Adjusted doc for ord so that it indicates that it returns the *first*
19:07 dalek doc: code point.
19:07 dalek doc: review: https://github.com/perl6/doc/commit/d6176ab6f9
19:07 perlpilot dogbert2: eh?  "form" is correct
19:07 moritz subroutine form vs. method form
19:07 moritz yes, form is good
19:07 dogbert2 yay, I'm a moron, probably nervousness :-)
19:08 ZoffixW m: my $i = 3; my @a = (loop { $i.say; last unless --$i }); say "take off"; # Eager
19:08 camelia rakudo-moar 40a953: OUTPUT«3␤2␤1␤take off␤»
19:08 ZoffixW m: my @foo = 1, 2 ... *; say @foo[2]; # Lazy
19:08 camelia rakudo-moar 40a953: OUTPUT«3␤»
19:08 ZoffixW #m: my $x = 1, 2 ... *; # freezes up
19:08 ZoffixW m: my $i = 3; my $x = (loop { $i.say; last unless --$i }); say $x[0] # Doesn't freeze up, but looking up a single value, iterates over all of them
19:08 camelia rakudo-moar 40a953: OUTPUT«3␤2␤1␤Nil␤»
19:08 perlpilot dogbert2: no worries.  You'll just have to make more contributions so that you can get rid of that nervousness
19:08 perlpilot :-)
19:08 dogbert2 was thinking off adding docs for some missing methods/subs
19:08 ZoffixW I'm struggling to understand why this inconsistency is there?
19:09 moritz ZoffixW: probably performance; lazy lists are quite expensive
19:09 moritz ZoffixW: and if you want a lazy list, you can use gather/take and the likes
19:10 ZoffixW Does (loop { $i.say; last unless --$i }); produce a lazy list?
19:10 moritz I don't think so
19:10 ZoffixW m: my $i = 3; my $x = (loop { $i.say; last unless --$i }); my $y = 1, 2 ... * < 10; say $x.WHAT; say $y.WHAT
19:10 camelia rakudo-moar 40a953: OUTPUT«(Seq)␤(Int)␤»
19:11 ZoffixW :S
19:11 moritz wow, I'm trying to golf a Rakudo segfault, and the source file makes vim segfault :(
19:11 Sqirrel joined #perl6
19:12 ZoffixW Yo bro, we heart you like...
19:12 moritz ZoffixW: scalar assignment has a too tight precedence here
19:12 moritz ZoffixW: my $y = (...)
19:13 ZoffixW That makes $y[0] return a (Seq).
19:13 ZoffixW I need to read up on containers more.
19:14 ZoffixW Oh, nevermind. Works fine
19:17 _mg_ joined #perl6
19:17 go|dfish joined #perl6
19:18 dogbert2 so, after moritz merged my fix am I supposed to ditch the branch I made and create a new one for the next (which haven't been written yet) or is that a bogus workflow?
19:18 moritz dogbert2: no, that sounds correct
19:19 moritz dogbert2: but we can simplify that by giving you direct push access to perl6/doc
19:19 moritz dogbert2: that way you can just work on the master branch, no pull requests necessary
19:19 AlexDaniel joined #perl6
19:20 moritz dogbert2: invitation sent :-)
19:20 dogbert2 :-)
19:20 yqt joined #perl6
19:23 dogbert2 received invitation and joined perl6
19:23 dogbert2 moritz++
19:24 sjn__ joined #perl6
19:25 dogbert2 so, just to avoid confusion, when I make changes I do them i a branch I have created perl6/doc, not directly in master or?
19:25 travis-ci joined #perl6
19:25 travis-ci Doc build errored. David H. Adler 'Adjust doc for ord to indicate it returns *first* code point. (#448)
19:25 travis-ci https://travis-ci.org/perl6/doc/builds/122600215 https://github.com/perl6/doc/compare/86d716f2dc52...d6176ab6f9ce
19:25 travis-ci left #perl6
19:26 sjn joined #perl6
19:27 dogbert2 hmm, I should rephrase my question
19:27 dogbert2 so, just to avoid confusion, when I make changes I do them in a branch I have created in the perl6/doc project, not directly in master or?
19:28 RabidGravy I tend to do the work in a branch, merge to master when I'm done and push
19:28 dogbert2 at $work devs are not allowed to push to master, hence my question
19:29 dogbert2 RabidGravy: thx, sounds like the way to go
19:29 RabidGravy that way if you need to do something else in the meanwhile you can start a different branch based on the unchanged master
19:30 moritz dogbert2: you can push directly to master, and I regularly do that for small and uncontroversial changes
19:30 moritz like, typos, grammar and markup fixes, or documentation for a builtin that wasn't documented before
19:30 moritz when I have larger stuff that has the potential to break stuff, or when I want to get feedback from others, I do a branch
19:31 dogbert2 moritz: ok, sounds good
19:32 dogbert2 i was thinking of doing the 'builtin that wasn't documented before' part, i.e. undocumented methods
19:32 teatime Do you need to define % for a numeric type, if you already define / ?
19:33 dogbert2 there are a few missing in Cool.pod, e.g. sech
19:33 teatime i.e., can perl infer
19:33 moritz teatime: it doesn't
19:33 teatime k
19:37 nige1 joined #perl6
19:37 MadcapJake 'ello Sixians!
19:38 dogbert2 here's a repeat question, why is Camelia running a version from friday, i.e. 40a953?
19:40 moritz dogbert2: looks like the rebuild is broken :(
19:40 dogbert2 uh oh :(
19:43 moritz huh, one of the git checkouts on the camelia server had local modifications
19:43 Begi1 joined #perl6
19:44 geekosaur added files? someone found that restricted setting isn't very, yesterday
19:45 moritz no, modifications in Grammar.pm or Actions.pm
19:49 sufrostico joined #perl6
19:49 ZoffixW That travis doc failure seems to be due to JSON::Fast failing a test
19:49 sjn_phone joined #perl6
19:50 ZoffixW passes locally and no recent commits in the repo. weird
19:50 moritz oh, seems camelia is out of disk space
19:50 dogbert2 a classic
19:51 moritz niecza: say 42
19:51 camelia niecza v24-109-g48a8de3: OUTPUT«sh: mono: command not found␤»
19:53 sjn_phone_ joined #perl6
19:53 masak moritz++ # disk space discovery
19:53 moritz huh
19:54 moritz /dev/vda2       6,7G  5,9G  373M  95% /tmp
19:54 moritz /dev/vda2       6,7G  5,9G  373M  95% /home
19:54 masak uhm
19:54 moritz wait what? /dev/vda2 is mounted both to /tmp and /home ?
19:55 moritz oh, that seems to be some kind of btrfs shenenigan
19:56 Begi1 joined #perl6
19:58 timotimo subvolumes probably
19:58 timotimo you can check with "mount", it'll show subvol=...
19:59 CurtisOvidPoe joined #perl6
19:59 moritz ===SORRY!===
19:59 moritz Failed to open file /home/camelia/rakudo-m-inst-1/share/perl6/dist/3FD70CCCD6914FAEC84AFAE6F97AF461A3EE15883FD70CCCD6914FAEC84AFAE6F97AF461A3EE1588: no such file or directory
20:01 go|dfish joined #perl6
20:02 CurtisOvidPoe Years ago (during the days of Pugs?) I wrote a prime-factor() sub, but it was primitive. Is this better? https://gist.github.com/Ovid/ed70be4dd5261af2a53f89a79a07863e If so, what’s the best way of submitting a pull request to clean up some old 99-problems examples?
20:02 CurtisOvidPoe This was the original: http://examples.perl6.org/categories/99-problems/P36-ovid.html
20:03 CurtisOvidPoe I was just noticing that the 99-problems that are linked off the web site are terribly out of date and misrepresent Perl 6.
20:03 * masak looks
20:04 moritz CurtisOvidPoe: stuff on example.perl6.org comes from the github.com/perl6/examples.perl6.org repo
20:04 moritz CurtisOvidPoe: ... and you should be able to push directly to that repo; if not, please tell and I'll make it so.
20:04 masak CurtisOvidPoe: I'm not sure it's 100% realistic with today's Bag type, but it seems to me a Bag would be a much better fit for the result type here than a Hash
20:05 masak in a sense, a Bag already is a mapping from some type T to Int
20:06 masak CurtisOvidPoe: your new code looks good to me
20:06 masak of course, it's "terribly imperative" :P
20:06 moritz CurtisOvidPoe: also, can I ask you to please retweet https://twitter.com/nogoodnickleft/status/717979391603683328 ?
20:06 moritz m: say 42
20:06 camelia rakudo-moar d1eeb3: OUTPUT«42␤»
20:07 CurtisOvidPoe Retweeted!
20:07 * masak retwut it too
20:07 moritz CurtisOvidPoe: thanks
20:07 nine For those who don't know: findmnt is much better for displaying mounted file systems
20:08 timotimo lsblk is also nice
20:08 timotimo findmnt has much more details. nice.
20:09 awwaiid nine: nice tip!
20:09 awwaiid moritz: that's a fancy web repl thingie you got there! RT'd
20:09 moritz nine: the problem with findmnt is that I can never remember its name :-)
20:09 moritz awwaiid: not mine, but worth sharing IMHO :-)
20:10 CurtisOvidPoe masak: looking for a clear example of how I would declare and use the Bag type today. Link?
20:10 masak m: say bag 1, 2, 3
20:10 camelia rakudo-moar d1eeb3: OUTPUT«bag(3, 1, 2)␤»
20:10 moritz m: say bag(<a a a b b c>)
20:10 camelia rakudo-moar d1eeb3: OUTPUT«bag(a(3), c, b(2))␤»
20:10 masak m: say Bag.new(1, 2, 3)
20:10 camelia rakudo-moar d1eeb3: OUTPUT«bag(3, 1, 2)␤»
20:10 moritz it's basically a set that counts how often an element is in it
20:11 awwaiid CurtisOvidPoe: http://doc.perl6.org/type/Bag has some things
20:11 tony-o m: .perl.say do for bag(<a a a b b c>)
20:11 camelia rakudo-moar d1eeb3: OUTPUT«5===SORRY!5=== Error while compiling /tmp/EMgpnqBzo8␤Two terms in a row␤at /tmp/EMgpnqBzo8:1␤------> 3.perl.say7⏏5 do for bag(<a a a b b c>)␤    expecting any of:␤        infix␤        infix stopper␤        statement end␤        s…»
20:11 moritz ... but I don't see how it help with primes, at least not off-hand
20:11 nine *lol* 719 directories in ~camelia/.perl6
20:11 moritz nine: these can all go, no?
20:12 nine just removed them
20:12 moritz nine: thanks
20:12 nine Frees a couple 100 megs. I can also easily enlarge the virtual disk (as soon as I find out how). There's plenty of space available.
20:12 moritz I also removed some old rakudo and R* builds (some of them from 2014!)
20:12 CurtisOvidPoe masak: Sorry, why is bag better there? If I could say “only primes are allowed as keys and positive integers as values”, I could see it being better. What did I miss? :)
20:12 nine But now to bed :)
20:12 moritz nine: don't need to; we now have 2.4G available
20:13 moritz and we should clean up now and again anway
20:13 moritz good night nine
20:14 masak CurtisOvidPoe: I think it's a math thing, to be honest.
20:15 mst < moritz> m: say bag(<a a a b b c>)
20:15 mst is probably the better example
20:15 masak CurtisOvidPoe: the factors of a positive numbers are described as being a "list of primes, *with multiplicity and unique up to reordering*" -- but that's just describing a Bag (or a multiset) without having that concept in one's vocabulary
20:16 masak CurtisOvidPoe: Dijkstra wrote about this once. I can dig you up the link.
20:16 * perlpilot idly wonders if there's a "bag" unicode character
20:16 moritz masak: ah, you're talking abouth the return type; I thought you meant a Bag would help calculate the prime factors
20:16 moritz .u bag
20:16 yoleaux U+22FF Z NOTATION BAG MEMBERSHIP [Sm] (⋿)
20:16 mst I personally tend to avoid math-based examples because they lose quite a few people
20:16 yoleaux U+27C5 LEFT S-SHAPED BAG DELIMITER [Ps] (⟅)
20:16 yoleaux U+27C6 RIGHT S-SHAPED BAG DELIMITER [Pe] (⟆)
20:16 CurtisOvidPoe Yeah, they lose me. Oops!
20:17 mst CurtisOvidPoe: aha, I know the example I'd use
20:17 masak moritz: yes, talking about the return type
20:17 mst CurtisOvidPoe: file of lines (names? whatever), count them
20:17 mst CurtisOvidPoe: more elegant than a hash
20:17 mst masak: that seem reasonable?
20:18 CurtisOvidPoe file of lines? Er, that seems to imply IO, which I’m not doing. What did I miss? :)
20:19 masak mst: dunno what you're asking -- factoring a number already seems reasonable to me :P
20:20 cdg joined #perl6
20:20 mst CurtisOvidPoe: yeah, just an example
20:20 mst CurtisOvidPoe: making a bag from an array/list basically does a 'uniq -c' on it
20:20 mst CurtisOvidPoe: 'file of lines' is just where I usually get an array from when doing examples like that
20:21 CurtisOvidPoe moritz: tried to push and got: “remote: Permission to perl6/perl6-examples.git denied to Ovid.”
20:21 perlpilot Only barely paying attention here, it seems a Bag is better to me too.   Prime factorization gets you a list of numbers like (2,2,2,3,3,5) which feels more Bag-like than Hash-like.
20:21 CurtisOvidPoe mst: ah, I see where you were going then. Pretty sure that woudl have been less clear :)
20:21 masak perlpilot: yes, that's what I'm getting at
20:22 masak perlpilot: though I can't guarantee that the Bag API will be perfectly helpful for this use case...
20:22 mst masak: I get it. I just don't think it's suitable to people who can't immediately recall prime factorisation
20:22 masak (it should, but it may not be there yet)
20:22 masak mst: I'd reply to that, but I'd come off as terribly elitist... ;)
20:22 mst CurtisOvidPoe: I mean, conceptually, one can emulate a set with a hash of (thing => 1), and one can emulate a bag with a hash of (thing => count)
20:23 masak mst: mostly because I don't tend to forget math once I learn it.
20:23 mst CurtisOvidPoe: starting from there might give you some inspiration
20:23 mst masak: *I* have no problem with that example. but somebody coming in from the language/linguistics side quite possibly would
20:23 moritz CurtisOvidPoe: github invitation sent
20:23 masak mst: yes, you're right
20:23 masak mst: but isn't it always thus? different examples will speak to people of different backgrounds
20:24 masak others will hate file I/O, for example
20:24 perlpilot most of the methods of Baggy/Bag seem to be about taking things out of the bag rather than putting them in.
20:24 CurtisOvidPoe Yes, but isn’t a bag for weights? These aren’t weighted. And immutability means I need to construct the hash and then construct a bag and return it. In that sense, it seems like more work that just confuses things.
20:24 mst CurtisOvidPoe: weighted? what?
20:24 perlpilot CurtisOvidPoe: I'd argue that prime factorization is *exactly* weights  ;)
20:25 mst CurtisOvidPoe: a bag is just a non-unique set, like a table in a databases without a PK
20:25 dalek perl6-examples: 59aea7d | Ovid++ | categories/99-problems/P36-ovid.pl:
20:25 dalek perl6-examples: A modern version of a prime factor sub
20:25 dalek perl6-examples: review: https://github.com/perl6/perl6-examples/commit/59aea7d266
20:25 CurtisOvidPoe Thanks, moritz :)
20:25 perlpilot CurtisOvidPoe: but, yeah, the Bag API isn't very good for bag construction if you want to do it piece-meal, so it's just extra work for you.
20:25 mst masak: historically, I've seen fewer people put off by file I/O, since that's usually something everybody has to learn anyway
20:26 CurtisOvidPoe @mstL the bag is documented as having an integer weight. Thus, it would be repurposing the hash for something where the prime factors are equal in value, even though some occur more often than others. That’s not really weighted, is it?
20:27 mst you could see 'weight' as equally meaning 'count'
20:27 CurtisOvidPoe mst: point.
20:27 mst I worry that you're hung up on the word 'weight' here and thereby missing the simpler possibilities
20:28 * teatime seems to recall a mutable bag type and/or a type w/ Real/Num/something weights
20:28 CurtisOvidPoe At the end of the day, I’d just like to fix up some earlier examples so that they’re not misleading. I know some of the early stuff I hacked out/up is pretty bad.
20:29 skids m: my %f := BagHash.new(); %f{13}++; %f.perl.say
20:29 camelia rakudo-moar d1eeb3: OUTPUT«(13=>1).BagHash␤»
20:29 skids Mutable version
20:30 skids I would not get hung up on "weight" since "bag" comes from discrete math word problems involving colored balls in bags.
20:30 masak skids++ # yes, BagHash here is exactly what's called for
20:30 masak I should've remembered that.
20:31 masak with BagHash, you probably get the best of both worlds.
20:31 masak you can treat it as a Bag, or as a Hash
20:31 teatime BagHash sounds like something teenage hobbits would smoke.
20:32 go|dfish joined #perl6
20:32 teatime (sorry)
20:32 mst teatime: http://trout.me.uk/quotes.txt
20:33 teatime lol
20:33 dalek perl6-examples: 47a4676 | Ovid++ | categories/99-problems/P36-ovid.pl:
20:33 dalek perl6-examples: Add a constraint so we don't try to factor numbers with no prime factors
20:33 dalek perl6-examples: review: https://github.com/perl6/perl6-examples/commit/47a4676aee
20:37 skids At least we managed not to call it a "Sack".
20:38 sjn joined #perl6
20:41 skids m: class Holding { }; my Bag of Holding $f; $f.WHAT.say; # darn.
20:41 camelia rakudo-moar d1eeb3: OUTPUT«5===SORRY!5=== Error while compiling /tmp/TcOh6smwll␤Bag cannot be parameterized␤at /tmp/TcOh6smwll:1␤------> 3class Holding { }; my Bag of Holding7⏏5 $f; $f.WHAT.say; # darn.␤»
20:42 masak skids: "lament for the third sack"? :P
20:42 * masak wonders whether someone else read Anathem
20:43 masak mst: "it's an attempt to express relational algebra in cobol" -- lol!
20:43 masak suddenly SQL makes perfect sense!
20:44 telex joined #perl6
20:45 dalek perl6-examples: 9b7405a | Ovid++ | categories/99-problems/P40-rhebus.pl:
20:45 dalek perl6-examples: Modernize the code a bit.
20:45 dalek perl6-examples: review: https://github.com/perl6/perl6-examples/commit/9b7405a078
20:46 mst skids++
20:47 mst masak: since it's not really an important machine, my quotefile is effectively the monitoring system for the server it's on :D
20:47 masak ;)
20:48 espadrine joined #perl6
20:55 dalek perl6-examples: 033e62d | Ovid++ | categories/99-problems/P39-rhebus.pl:
20:55 dalek perl6-examples: Make this more perl6ish.
20:55 dalek perl6-examples:
20:55 dalek perl6-examples: Also removed the last example because it was basically a broken duplicate of
20:55 dalek perl6-examples: the first example
20:55 dalek perl6-examples: review: https://github.com/perl6/perl6-examples/commit/033e62dcfc
20:56 [Coke] https://doc.perl6.org/language/io should probably reference std in/out/err
21:02 hankache joined #perl6
21:04 go|dfish joined #perl6
21:04 donaldh joined #perl6
21:06 ZoffixWin CurtisOvidPoe, Set, Mix, and Bag types have mutable versions: SetHash, MixHash, and BagHash
21:09 firstdayonthejob joined #perl6
21:09 espadrine joined #perl6
21:10 espadrine left #perl6
21:10 jjido joined #perl6
21:15 Begi masak: are you still working on your Text::Mardown module ?
21:16 Begi because there are yours, and this one : https://github.com/retupmoca/p6-markdown
21:16 nige1 joined #perl6
21:18 hacst left #perl6
21:23 masak Begi: depends on your definition of "working" -- I still mean to finish it, but I haven't been active for a while :/
21:33 [Coke] FINISH HIM!
21:33 [Coke] </kombat>
21:35 masak the payoff -- for me -- would be that I could move my blog engine over to a p6 Markdown module.
21:42 teatime how do Type($x) and Type.new($x) differ semantically?  When do we use/implement one vs. the other.
21:42 tony-o do you mean Type[$x] ?
21:43 teatime no, btu I also don't mean "Type" literally
21:43 teatime MyType($x) vs. MyType.new($x)
21:44 teatime or actually, what does Xyz($x) actually do / how is actually implemented
21:44 teatime for things like Int(3.5)
21:44 geekosaur those are different things. the former is a coercion, the latter crerates a new object with a specified value
21:44 masak teatime: this is just my personal interpretation, but I think a cast is different from a construction in various ways
21:44 teatime ok, that's what I was mising
21:44 masak oh, what geekosaur++ said
21:44 geekosaur the former *may*, but is not guaranteed to, be equivalent to the latter in some cases
21:44 teatime *missing.  I didn't realize it was just coercion.
21:45 masak yes, B(A) in Perl 6 means coerce A to B
21:45 masak m: sub foo(Int(Str) $x) { say $x; say $x.^name }; foo("42")
21:45 camelia rakudo-moar d1eeb3: OUTPUT«42␤Int␤»
21:46 perigrin m: sub foo(Int(Str) $x) { say $x; say $x.^name }; foo(Str.new(42))
21:46 camelia rakudo-moar d1eeb3: OUTPUT«Default constructor for 'Str' only takes named arguments␤  in block <unit> at /tmp/tDUdSUvxos line 1␤␤»
21:47 perigrin teatime: the latter also may cause an exception for people who don't know what the heck they're doing :)
21:48 teatime heh, perigrin that would be me;  when would it?
21:48 teatime oh nm, mis-read
21:49 perigrin teatime: might be _both_ of us.
21:54 patrickz joined #perl6
21:55 patrickz tony-o: afaik The current path to 6PAN goes like this:
21:55 * masak .oO( none of us have any idea what the heck we're doing )
21:58 geekosaur maybe a concrete example: it makes no sense to initialize a Str from an IO::Handle, but Str($some-handle) could produce a description including the source (if known) and current offset (if meaningful)
21:58 patrickz 1. fix EVAL precomp bug (nine) 2. get Repository API straight 3. get zef up to speed, 4. continue with the metacpan fork for perl6 (jdv). Since there t's more or less in that order, the toolchain work has pretty much come to a halt currently.
21:59 tony-o patrickz++
22:00 patrickz The most hopes are up for the metacpan clone as a successor to modules.perl6.org, but it all depends on whether someone actually does the work.
22:00 ZoffixWin patrickz, where is all the code for people to contribute? I see people ask about it frequently, but I have no codebase to point potential volunteers to.
22:01 patrickz https://github.com/jdv/metacpan-web < that's the metacpan clone
22:02 ZoffixWin "Latest commit 99d446a  on Dec 20, 2015"
22:02 ZoffixWin :(
22:02 patrickz https://github.com/ugexe/zef < zef has some prototypical support for metacpan
22:02 patrickz true
22:02 teatime I can't figure out the dyntax to make a local alias e.g. D() for Duration.new() ?
22:03 teatime some combination of \ and & and ...
22:03 patrickz but until recently there was a working prototype up (which isn't hard since metacpan is a working system)
22:03 tony-o patrickz: yea we'd planned to do that a while ago, we also started down the road of making something like metacpan (but not cpan _at all_)
22:04 tony-o patrickz: i dug it up, it was last updated in 2014 and i'm playing around with the front end right now, can be seen here: http://git.darcsys.com:9000/modules
22:04 ZoffixWin m: my &D = Duration.^can('new')[0]; say D(42)
22:04 camelia rakudo-moar d1eeb3: OUTPUT«Too few positionals passed; expected 2 arguments but got 1␤  in block <unit> at /tmp/2PXQpqD3FV line 1␤␤»
22:04 ZoffixWin *shrug*
22:04 RabidGravy teatime: something like "constant D = Duration but role { method CALL-ME(|c) { self.new(|c) } }"
22:05 patrickz tony-o: That's the system you wrote from scatch!
22:05 tony-o patrickz: yea, i kind of.  i modeled it after npm but with support for the perl6ish way of handling modules:auth:vers:etc
22:05 tony-o and yes, rewrote from scratch
22:06 patrickz s/clone/fork/ wrt jdvs work
22:06 tony-o search is broken because i'm modifying it to just be a module browser rather than an actual repo
22:06 geekosaur m: my &D = Duration.^can('new')[0].assuming(Duration); say D(42)
22:06 camelia rakudo-moar d1eeb3: OUTPUT«42␤»
22:06 RabidGravy tony-o, looks good
22:06 patrickz I think jdv had an instance up on hack
22:08 cpage_ joined #perl6
22:09 teatime oh, durp... sub D($a) { Duration.new($a) }  ?
22:09 patrickz I wish there'd be some more discussion about coordinating work. It happened more than once, that someone put huge amounts of effort into something, which later died away because of missing coordination of the efforts.
22:10 masak 'night, #perl6
22:11 RabidGravy if only there was an irc channel where most of the stakeholders can be found
22:11 dalek doc: 4ba4f1a | (Zoffix Znet)++ | doc/Language/modules.pod:
22:11 dalek doc: The Future of Ecosystem
22:11 dalek doc:
22:11 dalek doc: Organize the plan for current work needed on 6PAN
22:11 dalek doc: review: https://github.com/perl6/doc/commit/4ba4f1a2af
22:12 patrickz #perl6-toolchain :-P
22:17 dalek doc: ade320d | (Zoffix Znet)++ | doc/Language/modules.pod:
22:17 dalek doc: List #perl6-toolchain and toolchain repo
22:17 dalek doc: review: https://github.com/perl6/doc/commit/ade320d095
22:17 patrickz Just for the sake of ZoffixWin commit above: I'm a total bystander who hasn't done a single commit in any part of perl6. That "plan" is just what I caught up here and there.
22:20 RabidGravy righr, cause I'm not sure why 1 & 3 are pertinent to the larger project
22:22 RabidGravy but hey I'm just a module author why would my input cout?
22:23 donaldh ugh, sort thorws java.lang.NullPointerException on JVM
22:23 yoleaux 4 Apr 2016 20:13Z <hoelzro> donaldh: I tried your JVM REPL fix patch, and sadly it only kinda works =/
22:24 donaldh Breaks precomp. All sort tests fail.
22:25 RabidGravy my wife provoked a nullPointerException in some app on her phone yesterday, I laughed
22:25 donaldh :)
22:26 donaldh The JVM backend is needing a lot of love. Unfortunately I'm struggling to find any time ...
22:26 teatime is there a Test.pm operator for == ?  If not, I assume it's not what I should be using in tests to compare to (small, exact) numbers?
22:26 travis-ci joined #perl6
22:26 travis-ci Doc build passed. Zoffix Znet 'The Future of Ecosystem
22:26 travis-ci https://travis-ci.org/perl6/doc/builds/122644650 https://github.com/perl6/doc/compare/d6176ab6f9ce...4ba4f1a2af4c
22:26 travis-ci left #perl6
22:28 ZoffixWin I'm a hero!
22:29 donaldh hoelzro: JVM is more broken now and won't install. I'll dig into it and the REPL if I find tuits.
22:29 ZoffixWin m: use Test;  cmp-ok 1, 2, '==', 'all good'; cmp-ok 1, '2', '==', 'nah';
22:29 camelia rakudo-moar d1eeb3: OUTPUT«not ok 1 - all good␤␤# Failed test 'all good'␤# at /tmp/2ze0xMcbpN line 1␤# Could not use '2' as a comparator␤not ok 2 - nah␤␤# Failed test 'nah'␤# at /tmp/2ze0xMcbpN line 1␤# Could not use '2' as a comparator␤»
22:30 ZoffixWin ah
22:30 ZoffixWin teatime, ^ like that, but put the comparator as second positional
22:30 teatime hehe, that's what I have been doing
22:31 teatime but I figured since it wasn't built-in, there must be some drawback to using == widely in tests
22:31 donaldh hoelzro: when you say the REPL fix patch only kinda works, what kinda does and what kinda doesn't ?
22:31 teatime there's an apx eql built-in, and string comparison..
22:31 teatime but I'll stick w/ that for now 'cause afaict it's what Iw ant
22:32 ZoffixWin m: use Test;  cmp-ok 1, '==', 2, 'all good'; cmp-ok 1, '==', '2', 'nah';
22:32 camelia rakudo-moar d1eeb3: OUTPUT«not ok 1 - all good␤␤# Failed test 'all good'␤# at /tmp/a4BsoG7D0f line 1␤# expected: '2'␤Sub+{<anon|81793072>}+{Precedence} object coerced to string (please use .gist or .perl to do that)  in block  at /home/camelia/rakudo-m-inst-2/share/perl6/s…»
22:32 ZoffixWin Why does it fail? :S
22:32 donaldh .tell hoelzro http://irclog.perlgeek.de/perl6/2016-04-12#i_12326940
22:32 yoleaux donaldh: I'll pass your message to hoelzro.
22:32 ZoffixWin m: use Test;  cmp-ok 1, &('=='), 2, 'all good'; cmp-ok 1, &('=='), '2', 'nah';
22:32 camelia rakudo-moar d1eeb3: OUTPUT«not ok 1 - all good␤␤# Failed test 'all good'␤# at /tmp/xQCbU82uw5 line 1␤# expected: '2'␤Sub+{<anon|81793072>}+{Precedence} object coerced to string (please use .gist or .perl to do that)  in block  at /home/camelia/rakudo-m-inst-2/share/perl6/s…»
22:32 teatime because 1 !== '2' ?
22:32 ZoffixWin Oh, damn
22:32 teatime but that's not exactly why
22:33 RabidGravy I think the upload perl6 modules to pause failed at the first hurdle "Could not enter the URL into the database. Reason:
22:33 RabidGravy Binary logging not possible. Message: Transaction level 'READ-COMMITTED' in InnoDB is not safe for binlog mode 'STATEMENT'"
22:33 teatime hrm, it doesn't even work w/ 2 ints
22:33 teatime nm, it works with 1 == 1 and 1 == '1' :)
22:34 travis-ci joined #perl6
22:34 travis-ci Doc build passed. Zoffix Znet 'List #perl6-toolchain and toolchain repo'
22:34 travis-ci https://travis-ci.org/perl6/doc/builds/122645990 https://github.com/perl6/doc/compare/4ba4f1a2af4c...ade320d09525
22:34 travis-ci left #perl6
22:34 ZoffixWin teatime, but to answer your question, I think it might be because plain' old `is` is perfectly sufficient.
22:35 ZoffixWin I don't recall the last time I needed '==' comparator.
22:35 ZoffixWin RabidGravy, used to work 4 months ago :/
22:35 Sgeo joined #perl6
22:35 teatime is does string comparison.. which, I mean, is potentially better for test cases 'cause it could catch a class of errors numeric comparison could miss?
22:36 RabidGravy ZoffixWin, it appears it can't fetch from a URL
22:36 ZoffixWin Did you give it a URL to tarball or to a GitHub repo?
22:37 RabidGravy the url of the gh .tar.gz
22:37 ZoffixWin *shrug*
22:37 ZoffixWin When I tried, I just uploaded a file.
22:37 RabidGravy oh well, no-one uses the modules anyway
22:39 RabidGravy there actually isn't any point in uploading to pause at the moment is there?
22:39 ZoffixWin Don't think so.
22:41 RabidGravy I'm sure at some point some shadowy cabal will mandate that they must be but expect the authors to know this by detecting a disturbance in the force
22:52 RabidGravy ah no pause is actually broken right now
22:59 vendethiel- joined #perl6
23:04 RabidGravy anyway bed time toodles
23:05 timotimo bedtime noodles?
23:07 cpage_ joined #perl6
23:17 jack_rabbit joined #perl6
23:22 really joined #perl6
23:24 teatime TINP5C
23:25 sortiz joined #perl6
23:28 ZoffixWin :/
23:30 ZoffixWin Wow. Hawkin and some Russian dude put forth a plan for a flyby at Alpha Centauri: https://www.facebook.com/stephenhawking/photos/a.722563527830747.1073741833.710234179063682/1004427326311031/?type=3&amp;theater
23:30 ZoffixWin Too bad I'll be dead by then :(
23:32 adrian_ion joined #perl6
23:32 sortiz Me too, but the navigation system will be written in perl6! :-)
23:34 ZoffixWin sortiz++
23:41 really p6: say 3;
23:41 camelia rakudo-moar d1eeb3: OUTPUT«3␤»
23:48 perlawhirl joined #perl6
23:49 cdg joined #perl6
23:52 ZoffixLappy joined #perl6
23:59 MasterDuke joined #perl6

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

Perl 6 | Reference Documentation | Rakudo